A modern cookiecutter template for creation of a Python package following best practices.
The resulting generated Python package features:
pyproject.toml
ruff
for formatting/lintingpytest
andcoverage
for running testspre-commit
to enforce formatting/linting before committingclick
(optional if making a CLI app)sentry-sdk
for error reporting (optional)twine
for publishing to PyPIMakefile
with common development related commands- 100% test coverage
- Passes
ruff check
linting
Install Cookiecutter, if you don't already have it:
python3 -m pip install -U cookiecutter
Generate a Python package:
cookiecutter https://github.com/tsantor/cookiecutter-pyproject.git
make env
make pytest
Run make
to view a list of available commands with descriptions.
This is what I want. It might not be what you want. If you have differences in your preferred setup, I encourage you to fork this to create your own version.