Copier template for a modern, typed Python package/CLI with uv, hatch, tox, and GitHub automation baked in.
- uv-first workflow with dependency groups (dev, style, test, docs, tool, pre-commit) and tox-uv runners across Python 3.10–3.14; builds via
hatchling/hatch-vcswith versions from Git tags. - Optional components: Typer CLI entrypoint, FastAPI web app, Textual TUI, Tkinter GUI, C extensions via Cython with multi-platform wheel building, profiling tools (py-spy, scalene, cProfile), logging/config modules, type hints, and a
py.typedmarker plus corresponding tests; container-readyDockerfile. - QA stack: pytest with coverage/xdist/reruns (and
.codecov.yml), ruff, mypy, pyright, ty, pyrefly, vulture, slotscheck, taplo, validate-pyproject, typos, actionlint. - Docs and site: MkDocs scaffold (
docs/index.md) with GitHub Pages deploy workflow. - Automation and hygiene: CI/CD workflows (matrix tests, trusted-publishing to PyPI, gh-pages), configurable release automation (release-please/release-it/release-drafter), PR title linting, issue/PR templates, dependency management (Renovate/Dependabot), optional Commitizen, pre-commit (with pre-commit-uv), devcontainer, VS Code launch config, gitignore, FUNDING, and LICENSE.
- Extra tooling: Optional Trunk config (hadolint/markdownlint/etc.), Pants config,
.dockerignore, badge-rich README template, and enhanced VS Code launch.json for debugging (current file, tests, attach, entry points).
Copier will prompt for:
github_usergithub_repo_name(lowercase letters/digits/dashes, starts with a letter)author_full_nameauthor_emailshort_descriptioninclude_cli(include Typer CLI)include_web(include web API)web_framework(fastapi/litestar - wheninclude_webis enabled)include_gui(include Tkinter GUI)include_tui(include Textual TUI)include_mcp(include MCP server support)include_worker(include message queue worker using FastStream)worker_broker(kafka/nats/rabbitmq/redis - wheninclude_workeris enabled)include_c_extensions(include C extensions support using Cython)include_profiling(include profiling and performance tools)include_pycrucible(include PyCrucible for standalone executables)include_pydantic_settings(use pydantic-settings for configuration)release_automation(none/release-please/release-it/release-drafter)dependency_management(none/renovate/dependabot)include_changelog(include CHANGELOG.md)include_citation(include CITATION.cff)include_pants(include Pants build system)include_codecov(include Codecov configuration)include_mise(include mise for tool version management and task running)include_trunk(include Trunk linting/formatting)include_commitizen(include Commitizen)include_precommit(use pre-commit hooks)include_dbeaver(include CloudBeaver database UI in devcontainer)include_vpn(include OpenVPN sidecar in devcontainer)
- Install Copier and uv (e.g.,
uvx copier). - Run
copier copy gh:hasansezertasan/copier-pyproject <destination>(orcopier copy . <destination>from a local clone). - Optionally seed answers with
.example-input.ymlusing--data-file .example-input.yml --defaults. - Open the generated README (rendered from
template/README.md.jinja) and clear theTODO @...markers inREADME.md,pyproject.toml, docs, and workflows.
- Install dependencies:
uv sync - Style gate:
uv run --locked tox run -e style - Full test suite:
uv run --locked tox run - Run the CLI (if included):
uv run --locked <repo-name> version - Run the FastAPI app (if included):
uv run --locked fastapi dev <repo-name>.web:app - Serve docs locally:
uv run --only-group docs mkdocs serve(deploys via GitHub Pages on release) - Optional tooling:
trunk checkfor aggregated linting (if configured);pants lint ::for Pants-based linting (if configured).
.example-input.yml provides default values for all template options.
Publishing a GitHub release triggers .github/workflows/cd.yml.jinja to build with uv and push to PyPI using trusted publishing. Docs deploy from releases via .github/workflows/gh-pages.yml, and CI runs on macOS/Linux/Windows via .github/workflows/ci.yml.jinja.
If you prefer release PRs or manual bumping, release-please-config.json and .release-it.json are provided alongside release-drafter.
Enable PyPI once per project for .github/workflows/cd.yml:
- Open Trusted Publisher Management.
- Under "Add a new pending publisher", pick "GitHub".
- Set
PyPI Project Nameto your package name. - Set
Ownerto your GitHub username. - Set
Repository nameto your repo name. - Set
Workflow nametocd.yml(or your workflow filename). - Set
Environment nametopublish(or your chosen env). - Save.
Enable Docker Hub publishing (integrated in .github/workflows/cd.yml):
- Create a Docker Hub Access Token.
- In your GitHub repository, go to Settings → Secrets and variables → Actions.
- Add two repository secrets:
DOCKERHUB_USERNAME: Your Docker Hub usernameDOCKERHUB_TOKEN: Your Docker Hub access token
- On release, the workflow will build and push multi-arch images (amd64/arm64) to Docker Hub.
- Draft a GitHub Release (tag = version).
- Update
CHANGELOG.mdwith the new version details. - Publish the release.
cd.ymlwill build the wheel/sdist with uv, publish to PyPI via trusted publishing, and upload artifacts to the GitHub Release.- If
include_webis enabled,cd.ymlalso builds and pushes Docker images to Docker Hub. - If
include_pycrucibleis enabled,cd.ymlalso builds standalone executables for Windows, macOS, and Linux.
The unified cd.yml orchestrates all release jobs:
build ─────┬──► pypi-publish ──────────────────────┐
│ │
├──► build-executables (if pycrucible) ─┼──► attach-github-release
│ (parallel: ubuntu/windows/macos) │
│ │
└──► docker-publish (if web) ───────────┘
(pushes to Docker Hub independently)
- build: Builds the Python wheel/sdist with uv
- pypi-publish: Publishes to PyPI via trusted publishing
- build-executables: Builds standalone executables for 3 platforms (conditional)
- docker-publish: Builds and pushes multi-arch Docker images (conditional)
- attach-github-release: Attaches all artifacts to the GitHub Release
This project is maintained by Hasan Sezer Taşan, It's me 👋
This template is not intended to be used for malicious purposes. The author is not responsible for any damage caused by this template. Use at your own risk.
This project is licensed under the MIT License - see the LICENSE file for details.