Cookiecutter ๐ช template for a modern Python package ๐๐ฆ.
- GitHub repo: https://github.com/fedejaure/cookiecutter-modern-pypackage.git
- Documentation: https://cookiecutter-modern-pypackage.readthedocs.io
- Free software: MIT license
- Dependency tracking: ๐ฆ Utilizes Poetry for efficient package management.
- Testing setup: ๐งช Includes Pytest for comprehensive and reliable testing.
- Continuous Integration: ๐ Github Actions integration for seamless CI testing.
- Linting: ๐งน Enhanced code quality with Ruff.
- Docstring: ๐ Follows the Google Python Style Guide for clear and consistent documentation.
- Static type checking: ๐ Ensured by Mypy.
- Formatting: โจ Consistent code formatting with Black and Isort.
- Security checks: ๐ Uses Safety to identify and address known vulnerabilities.
- Git hooks: ๐ฃ Managed by pre-commit for streamlined development workflows.
- Development tasks CLI: ๐ ๏ธ All-in-one Python CLI provided by invoke.
- Multiple Python environments testing: ๐ฅ Supported by Nox.
- Documentation: ๐ Utilizes Sphinx for clear and comprehensive documentation, ready for Read the Docs.
- Command line interface: ๐ป Optional integration with Typer.
- Automated dependency updates: ๐ค Enabled by Dependabot.
- Coverage reports: ๐ Integrated with Codecov.
- Automated releases: ๐ข Push a new tag to trigger releases to PyPI and TestPyPI.
- GitHub community health files (optional):
- Code of Condunct ๐ค
- Contributing ๐
- Security ๐
- Code Owners ๐ฉโ๐ผ
- Funding ๐ฐ
- Citation ๐
Get started with your modern Python package in just a few steps:
If you haven't installed Cookiecutter yet, make sure to have version 1.4.0 or higher:
pip install -U cookiecutter
Run Cookiecutter using the latest release
cookiecutter gh:fedejaure/cookiecutter-modern-pypackage --checkout v3.0.1
Follow these steps to complete the setup:
-
Create a new GitHub repository and push your generated project there.
-
Install the development requirements into a virtual environment:
poetry install
-
Install pre-commit hooks:
poetry run inv install-hooks
-
Configure Codecov repository settings. (Codecov App,
CODECOV_TOKEN
) -
Add your repository to your Read the Docs account and enable the Read the Docs service hook.
-
Configure PyPI and TestPyPI tokens. (
PYPI_TOKEN
,TEST_PYPI_TOKEN
) -
Release your package by pushing a new tag.
Tip
For more details, see the tutorial.
This cookiecutter was built for learning purpose and inspired by:
- audreyr/cookiecutter-pypackage: Cookiecutter template for a Python package.
- briggySmalls/cookiecutter-pypackage: A fork from audreyr/cookiecutter-pypackage using Poetry for package management, with linting, formatting and more.
- hypermodern-python: Hypermodern Python article series.