DevelopersPython3Environment » History » Revision 18
Revision 17 (Alexandre J. Raymond, 05/24/2024 09:53 AM) → Revision 18/21 (Alexandre J. Raymond, 05/27/2024 06:55 PM)
# Python 3 Developer Environment Setup {{>toc}} ## Windows ### Install Python 1. Download and install from [python.org](https://www.python.org/downloads/windows/). At the time of this writing, "Python 3.10.8" is recommended. During install note these options: 1. Choose *Add python.exe to PATH* 1. Choose *Disable path length limit* 1. In Windows settings, search "Manage app execution aliases" and: 1. Disable *App Installer: python.exe* 1. Disable *App Installer: python3.exe* 1. Disable *App Installer: python3.7.exe* ### Install Git 1. Download and install from [git-scm.org](https://git-scm.com/download/win). During installation take the defaults except for: 1. Configuring the line ending conversions: choose *Checkout as-is, commit Unix-style line endings* ### Configure Git From a command line: 1. `git config --global user.name "FIRST_NAME LAST_NAME"` 1. `git config --global user.email "MY_NAME@example.com"` 1. Optional, if you want to set an editor: `git config --global core.editor "PATH TO EDITOR"` ### Clone the CHIRP git repository (master branch) From a command line: ``` C:\Users\{user}\Documents> git clone https://github.com/kk7ds/chirp C:\Users\{user}\Documents> cd chirp ``` ### Install the python dependencies 1. `python3 -m pip install -r requirements.txt` 1. `python3 -m pip install tox` ### Run CHIRP From inside the chirp git repo, type this to run CHIRP from source: ``` chirpwx.py ``` ### Optional, but recommended: Install GitHub CLI Via winget: `winget install --id GitHub.cli` or manually from [github.com](https://cli.github.com/) Note: {user} as shown in paths above is the logged in Windows user Note: The steps above were done on Windows 10 Pro, version 22H2 ## MacOS ### Install command-line tools ```shell $ xcode-select --install ``` ### Clone the CHIRP git repository ```shell $ git clone https://github.com/kk7ds/chirp $ cd chirp ``` ### Install python requirements ```shell $ python3 -m pip install -r requirements.txt $ python3 -m pip install tox ``` (Note that `tox` is only needed for running tests, not for running CHIRP itself) ### Run CHIRP ```shell $ ./chirpwx.py ``` ## Linux These instructions are for Debian/Ubuntu, but should be generally applicable to other distros, possibly with different package names. You can use all distro packages (recommended), or install the python requirements with `pip install -r requirements.txt` but you probably want to get wxPython from distro packages. ### Install packages ```shell $ sudo apt install git python3-wxgtk4.0 python3-serial python3-six python3-future python3-requests python3-serial python3-suds python3-wxgtk4.0 python3-yattag python3-pip $ python3 -m pip install tox ``` (Note that `tox` is only needed for running tests, not for running CHIRP itself) ### Clone the CHIRP git repository ``` $ git clone https://github.com/kk7ds/chirp ``` ### Run CHIRP ```shell $ cd chirp $ ./chirpwx.py ``` ## Python 3.11 Notes Python 3.11 breaks a lot of things by removing some compatibility with previous releases. Right now (as of 9-March-2023), the main CHIRP builds are done on <= 3.10 and will continue that way until the wxPython team provides pre-built 3.11 wheels for macOS and Windows. For `attrdict` related issues, see [this github issue](https://github.com/wxWidgets/Phoenix/issues/2296). ## Running tests Below are some examples for running tests using tox. This is required to pass the CI checks on submissions before things can be merged. Running everything: ``` $ tox ``` Running just style checks: ``` $ tox -e style ``` Running just driver tests for only drivers with changes since `origin/master`: ``` $ tox -e fast-driver ``` Running just one driver test by module name: ``` $ tox -e driver -- -k ic2820 ``` Running all driver tests for a given vendor: ``` $ tox -e driver -- -k Icom ```