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. - Ready-to-run Typer CLI entrypoint, FastAPI app stub, logging/config modules, type hints, and a
py.typedmarker plus CLI/web 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), release drafter, release-please config, PR title linting, issue/PR templates, Renovate config, Commitizen, pre-commit (with pre-commit-uv), devcontainer, VS Code launch config, gitignore, FUNDING, and LICENSE.
- Extra tooling: Trunk config (hadolint/markdownlint/etc.), Pants config,
.dockerignore, and badge-rich README template for generated projects.
Copier will prompt for:
github_usergithub_repo_name(lowercase letters/digits/dashes, starts with a letter)author_full_nameauthor_emailshort_description
- 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:
uv run --locked <repo-name> version - Run the FastAPI app:
uv run --locked fastapi dev <repo-name>.app:app - Serve docs locally:
uv run --only-group docs mkdocs serve(deploys via GitHub Pages on release) - Optional tooling:
trunk checkfor aggregated linting;pants lint ::for Pants-based linting.
example/README.md shows the rendered README produced from .example-input.yml.
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.
- 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.
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.