python-base-flake
is an opinionated Python package template based on
poetry2nix. It aims to provide an instant feedback loop during development
while staying reproducible and interoperable with the Nix ecosystem.
- Reproducible builds with Nix and poetry2nix
- Shell environment management with direnv
- Python dependency management with Poetry and poetry-plugin-up
- Dependency management for anything else with nixpkgs
- Unit testing with pytest
- Type checking with mypy
- Code formatting with Black, isort, Prettier, and nixpkgs-fmt
- Code coverage with Coverage.py
- Documentation with Sphinx and MyST
- Automatic API documentation with Sphinx AutoAPI and napoleon
- Linting enforcement with pre-commit and pre-commit-hooks.nix
- Template updates with cruft
- Package updates with Dependabot
- Continuous integration with GitHub Actions
- Common tasks preconfigured with Visual Studio Code
- No opinionation on the package's runtime code
You must have the following already installed to use this:
- Nix with flakes enabled
- direnv integrated into your shell
- cookiecutter or cruft
- git with name and email configured globally
$ cookiecutter https://github.com/schlarpc/python-base-flake --checkout template
# or
$ cruft create https://github.com/schlarpc/python-base-flake --checkout template