Cookiecutter Modern PyPackage¶
GitHub release (latest SemVer) Python Version License Tests Read the Docs Black pre-commit
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
Features¶
Dependency tracking using Poetry
Testing setup with Pytest
Github Actions ready for Continuous Integration testing
Docstring linting provided by Darglint using the Google Python Style Guide
Static type checking by Mypy
Checks dependencies for known security vulnerabilities with Safety
Git hooks managed by pre-commit.
All development tasks (lint, format, test, etc) wrapped up in a python CLI by invoke
Multiple Python environments testing provided by Nox
Documentation provided by Sphinx ready for generation with, for example, Read the Docs
Command line interface using Click (optional)
Automated dependency updates with Dependabot
Quickstart¶
Install the latest Cookiecutter if you haven’t installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install -U cookiecutter
Generate a Python package project:
cookiecutter https://github.com/fedejaure/cookiecutter-modern-pypackage.git
Then:
Create a repo and put it there.
Install the dev requirements into a virtualenv. (
poetry install
)Install pre-commit hooks. (
poetry run inv install_hooks
)Add the repo to your Read the Docs account + turn on the Read the Docs service hook.
Release your package by pushing a new tag to master.
For more details, see the tutorial.
Credits¶
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.