Contributing

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 alongside Make and Graphviz to fully automate all development and deployment tasks.

Setup

Requirements

Pyenv will manage all our python version.

  • Python: $ pyenv install 3.7.3

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.3

Poetry will manage our dependencies and create our virtual environment for us.

To confirm these system dependencies are configured correctly:

$ make doctor

Installation

Install project dependencies into a virtual environment:

$ make install

Note: - 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 .install file and execute a make install

Development Tasks

Manual

Run the tests:

$ make test

Run static analysis:

$ make check

Build the documentation:

$ make docs

Automatic

Keep all of the above tasks running on change:

$ make watch

In order to have OS X notifications, brew install terminal-notifier.

Integration With Visual Studio Code

Even 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

    settings.virtualenvs.create = true
    settings.virtualenvs.in-project = false
    settings.virtualenvs.path = "/Users/xxxx/Library/Caches/pypoetry/virtualenvs"
    repositories = {}
    
    As now, i cannot have a working system with 'settings.virtualenvs.in-project' set to true or 'settings.virtualenvs.path' setted with a custom path.

  • How Launch Visual Studio Code within virtual environment created by poetry ? After do a make install, you have to do:

    poetry shell
    code .
    
    poetry shell will activate project virtual environment.

Continuous Integration

The CI server will report overall build status:

$ make ci

Release Tasks

Release to PyPI:

$ make upload