Use this template to create new shell packages.
tox is an open source tool we use to run tests in multiple virtual environments.
- To run all tests described in tox.ini, just run
tox
. - To run a particular env use
tox -e env_name
.
pre-commit is an open source library we use to manage pre-commit hooks.
- Run all code linters with a command
pre-commit run --all-files
. - Add git hook with command
pre-commit install
. - To update versions of pre-commit hooks in config file run
pre-commit autoupdate
We use these hooks:
- isort sorts imports (config in tox.ini)
- black reformats code to one style (config in pyproject.toml)
- flake8 checks code style (config in tox.ini). We use these plugins:
flake8-docstring
to check docstringsflake8-builtins
to avoid using builtins as variable namesflake8-comprehensions
to check list/dict comprehensionsflake8-print
to ensure we don't leave prints in the codeflake8-eradicate
to ensure we don't leave commented lines in the code
- Set the
package-name
var regarding your package. - Set the python version in envlist.
- Set the python version regarding tox.ini.
- Set the python version for black.
- Set a name and description for the package.
- Set the python version of the shell.
- Update links for build, coverage etc.
- Add the line to README
We use tox and pre-commit for testing. Services description