An opinionated Copier template for Python projects managed by uv.
Generated projects require Python 3.11 or newer (3.15 by default).
- CLI and autocompletion with Typer.
- Rust extensions with maturin.
- Pre-configured tools for code formatting, quality analysis, documentation and testing:
- ruff
- ty
- pytest
- sphinx (furo theme)
- uv audit
- Task automation with just.
- Nix flake.
- Support for GitHub actions and GitHub pages.
Then, to create a new project based on this template, run the following command and fill in the form:
copier copy 'https://github.com/vivienm/copier-python' path/to/your/projectGo to the project directory and initialize a Git repository:
cd path/to/your/project
git initIf you enabled nix_flake, use Nix with flakes enabled. Track the generated files and enter the development shell, which provides Python, uv and the development tools (including Rust tools for maturin):
git add .
nix developOtherwise, if you chose maturin, install Rust using rustup, then install the required components and development tools:
rustup component add rustfmt clippy
cargo install --locked cargo-auditUpgrade the dependencies and update their minimum versions in pyproject.toml:
uv lock
uvx uv-bump
uv syncIf you chose the uv build backend, also update the uv_build requirement in pyproject.toml for your uv version (uv --version), following the upstream recommendation.
Format the generated Python files, then run the checks:
uv run ruff format
uv run just ciFor applications with nix_flake enabled, nix flake check builds the application and, if you selected pytest, runs its tests using the dependencies from uv.lock.
If you enabled github_pages, configure your GitHub repository before the first push to its default branch: in Settings → Pages → Build and deployment, set Source to GitHub Actions. The generated workflow will then publish the project documentation.
You are now ready to start coding!
Later, to update your project as this template evolves, run:
copier update --skip-answered