A Modern Cookiecutter template for Python packages and applications using Poetry.
-
Poetry: Dependency management and packaging
-
Tox: Easily run tests for different python versions
-
Github Actions: Ready for Continous Integration testing
-
Tests using Pytest including support for
- pytest-mock for mocking
- code coverage using coverage.py
-
[pre-commit] hook to run
- flake8, flake8-bugbear
- isort,
- mypy and
- black
-
(optional) Preconfigured for Django applications
- Support for Twelve-factor-Methodology using django-environ
-
Simple pull request template with checklist
Get the latest version of Cruft (or Cookiecutter) I recommend pipx to install it into a global isolated environment.
pipx install cruft
Generate a new python package
cruft create https://github.com/escaped/cookiecutter-pypackage.git
cd <chosen project slug>
git init
git add .
git commit -m "feat: initial project structure"
In order get automatic releases to pypi you need to add your pypi access token to the secrets github (named PYPI_TOKEN
).
Instructions can be found here: python.org.
This cookiecutter template comes with an auto update feature if the project was created using cruft. A GitHub action automatically checks for updates and creates a pull request.
It is required to add a personal access token
as github secret to the repository (named AUTO_UPDATE_GITHUB_TOKEN
).
While creating the access token, the following permissions have to be granted
- repo
- workflow