Skip to main content
Michael Ellis
← Back to open source projects

Python · Open source

pypkgkit

Production-ready Python package template with uv, ruff, pyright, and GitHub Actions CI/CD

#ci-cd#cookiecutter#github-actions#python#ruff#template#ty#uv

A Cookiecutter template for Python packages. A fully configured project with linting, type checking, testing, CI/CD, documentation, and automated releases to PyPI.

Quick start

# Install cookiecutter if you haven't already
uv tool install cookiecutter

# Generate a new project
cookiecutter gh:michaelellis003/pypkgkit

To pin a specific template version, pass the --checkout flag with a release tag:

cookiecutter gh:michaelellis003/pypkgkit --checkout v2.1.2

You will be prompted for a few values:

VariableDefaultDescription
project_namemy-python-packageName of the project (used in PyPI, GitHub, etc.)
project_slugautoPython-importable name (derived from project name)
project_descriptionA Python packageOne-line description
author_nameYour NameAuthor name for pyproject.toml and LICENSE
author_emailyou@example.comAuthor email
github_usernameyour-github-usernameGitHub username (used in URLs, badges, CODEOWNERS)
python_version3.12Minimum Python version
initial_version0.1.0Starting version

After generation, the template automatically:

  1. Initializes a git repository
  2. Installs dependencies with uv sync
  3. Installs pre-commit hooks
  4. Creates an initial commit

What is included

Every generated project comes with:

ConcernTool
Package managementuv
Linting & formattingRuff
Type checkingty
Testingpytest
DocumentationProperDocs (MkDocs Material + mkdocstrings)
Versioning & releasespython-semantic-release with Conventional Commits
CI/CDGitHub Actions (lint, type check, test across 3.10 – 3.13, build, release to PyPI, deploy docs)
Dependency updatesDependabot (weekly, for both Actions and pip)
Pre-commit hooksRuff, ty, license headers, conventional commit validation

After generating your project

  1. Create a GitHub repo and push:

    git remote add origin https://github.com/<username>/<project-name>.git
    git push -u origin main
  2. Configure GitHub settings:

    • GitHub Pages: Settings > Pages > Source: gh-pages
    • RELEASE_TOKEN: Settings > Secrets — a PAT with contents: write
    • PyPI trusted publishing: add the repo on pypi.org
    • CODECOV_TOKEN: Settings > Secrets (optional)

Requirements

Contributing

To work on the template itself:

git clone https://github.com/michaelellis003/pypkgkit.git
cd pypkgkit
uv sync
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg
uv run pre-commit install --hook-type pre-push

Test the template locally:

cookiecutter . --no-input

License

Apache 2.0. See LICENSE for the full text.