This project is based on Geronimo-iaa's Python Template. This is a cookiecutter template for a typical Python library following modern packaging conventions. It utilizes popular libraries to fully automate all development and deployment tasks.
You will need:
A powerfull tool:
- macOS:
$ xcode-select --install - Linux: https://www.gnu.org/software/make
- Windows: https://mingw.org/download/installer
Pyenv will manage all our python version. Follow https://github.com/pyenv/pyenv#installation
Do:
$ pyenv install 3.7
Note for MacOS 10.14 user:
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk MACOSX_DEPLOYMENT_TARGET=10.14 pyenv install 3.7.3Poetry Installation: https://poetry.eustace.io/docs/#installation
Poetry will manage our dependencies and create our virtual environment for us.
To confirm these system dependencies are configured correctly:
$ make doctor$ make installNote:
- this target create a dummy file
.install. The makefile rule depends on pyproject.toml and poetry.lock file - if for whatever reason, you have to force installation, just remove this
.installfile and execute amake install
$ make test$ make check$ make docs$ make buildFor help:
$ make helpEven if we use fabulous tool like pyenv, poetry, ... at the end, we just want to go on, and code.
So here, few detail of my installation.
-
.bashrc
# init pyenv with default python version if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi # add poetry in path export PATH="$HOME/.poetry/bin:$PATH" # Add Visual Studio Code (code) export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
-
poetry configuration: all is let with default
-
How Launch Visual Studio Code within virtual environment created by poetry ? After do a
make install, you have to do:poetry shell code .poetry shellwill activate project virtual environment.
The CI server will report overall build status:
$ make ci
Release to PyPI:
$ make publish