Skip to content

Commit

Permalink
docs: update documentation about Python version from 2.7 to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
GMinucci committed Jan 16, 2025
1 parent c938fd7 commit b380f43
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ This file is responsible for:

### Dependencies

In order to generate the code from templates, Variants requires Python 2.7. We recommend configuring the python version using a version management tool such as Pyenv.
In order to generate the code from templates, Variants requires Python 3. We recommend configuring the python version using a version management tool such as Pyenv.

For details on how to install and use it check the [Pyenv repo](https://github.com/pyenv/pyenv).

### On Github Actions CI

See [Switching Variants on CI](docs/GITHUB_ACTION.md) for a better understanding and examples.

### Homebrew (recommended)
### Homebrew **(recommended)**

```sh
brew install backbase/m/variants
Expand All @@ -69,6 +69,16 @@ cd variants
make install
```

Once the installation is completed, the binary will be added to your `~/.local` folder. Make sure to have the folder included in your `PATH` variable. This should be done in the shell configuration file

Add the following to the `~/.zshrc` or `~/.bashrc` file:
```sh
export PATH=$HOME/.local/bin:/usr/local/bin:$PATH
```

Make sure to restart your terminal or source the changed file with `source ~/.zshrc` or `source ~/.bashrc`


### Swift Package Manager

#### Use as CLI
Expand Down
12 changes: 6 additions & 6 deletions Sources/VariantsCore/Factory/iOS/VariantsFileFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ class VariantsFileFactory {
guard let message, !message.isEmpty else { return }

switch message {
case _ where message.contains("env: python2.7: No such file or directory"):
case _ where message.contains("env: python3: No such file or directory"):
logger.logFatal(item:
"""
We're unable to find a 'python2.7' executable.
Install 'python2.7' or ensure it's in your executables path and try running this Variants command again.
We're unable to find a 'python3' executable.
Install 'python3' or ensure it's in your executables path and try running this Variants command again.
Tip:
* Install pyenv (brew install pyenv)
* Install python2.7 (pyenv install python2.7)
* Install python3 (pyenv install python3)
* Add "$(pyenv root)/shims" to your PATH
""")
case _ where message.contains("for chunk in chunks(encode(os.environ.get("):
Expand All @@ -108,8 +108,8 @@ class VariantsFileFactory {
logger.logFatal(item:
"""
Looks like you have pyenv installed but the current configured version is not correct.
Please, select the latest build of python 2.7 as local version.
For example: `pyenv local 2.7`
Please, select the latest build of python 3 as local version.
For example: `pyenv local 3`
""")
default:
logger.logFatal(item: message as Any)
Expand Down

0 comments on commit b380f43

Please sign in to comment.