An opinionated project template for Python built with poetry/tox
This is a template repository. It comes with support for the following:
- Unit testing via pytest
- Code coverage via coverage
- Linting via flake8
- Formatting via yapf and isort
- Static type checking via mypy
- Orchestration of the above quality gates via tox
- Dependency and module management via poetry
To get started with this template, changes will need to be made to the module name in various locations.
pyproject.toml
attributes for name and package- The
src/python_template
folder name src/python_template/__init__.py
name variable
The poetry.lock
file will need to be deleted so it can be regenerated with the new module's values.
The template comes provided with a venv.sh
file for helping in the setup of a Python virtual environment. The script will perform the following actions:
- Install the required developer tooling
- Create the virtual environment
- Activate the virtual environment
- Install the project dependencies
- Display outdated dependencies
This is purely for convienence. It can be ran again with the virtual environment created to perform an update and activate.
Project configuration options and flag referenced by the following locations.
https://docs.pytest.org/en/7.1.x/reference/reference.html#ini-options-ref
https://coverage.readthedocs.io/en/6.5.0/config.html
https://tox.wiki/en/latest/config.html
https://mypy.readthedocs.io/en/stable/config_file.html
https://pycqa.github.io/isort/docs/configuration/config_files.html
https://github.com/google/yapf#knobs