SSB PyPI Template¶
Cookiecutter template for a Python package based on the Hypermodern Python article series, and adopted for use in Statistics Norway.
Usage¶
Use Cruft to create and update an instance of this template.
cruft create https://github.com/statisticsnorway/ssb-pypitemplate.git --checkout=2024.11.27
To check if there are there are template updates and update your instance with the new updates, run the following commands from the root directory:
cruft check
cruft update
Features¶
Packaging and dependency management with Poetry
Test automation with Nox
Linting with pre-commit and ruff
Continuous integration with GitHub Actions
Documentation with Sphinx, MyST, and GitHub Pages using the furo theme
Automated release notes with Release Drafter
Automated dependency updates with Dependabot
Import sorting with ruff
Testing with pytest
Code coverage with Coverage.py
Coverage reporting with SonarCloud
Command-line interface with Click
Static type-checking with mypy
Runtime type-checking with Typeguard
Automated Python syntax upgrades with ruff
Security audit with ruff
Check documentation examples with xdoctest
Generate command-line reference with sphinx-click
Manage project labels with GitHub Labeler
The template supports Python 3.10, 3.10 and 3.12.
FAQ¶
What is this project about?¶
The mission of this project is to enable current best practices through modern Python tooling.
What makes this project different from other Python templates?¶
This is a general-purpose template for Python libraries and applications.
Our goals are:
Focus on simplicity and minimalism
Promote code quality through automation
Provide reliable and repeatable processes
The project template is centered around the following tools:
Poetry for packaging and dependency management
Nox for automation of checks and other development tasks
GitHub Actions for continuous integration and delivery