Skip to content

Overview

python-versions pypi codecov release license style downloads

A minimal working example of a packaged Python project built with uv.

Key integrations include:

Component Tool
Dev Environment Manager mise
Build System uv
Test Framework pytest
Multi-Environment Testing tox
Documentation as Code zensical
Git Hooks prek
Local Automation task
CI/CD GitHub Actions

This document explains how to use and extend this template.

Tip

The automated website for this repository is generated directly from source code and docstrings.

Getting Started

%%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart TD
  create-a-repository["`Create a repository`"]
    --> installation["Installation"]
    --> package-setup["`Package setup`"]
    --> ci-setup["`CI setup`"]
    --> add-code["`Add code`"]

click create-a-repository href "#create-a-repository"
click installation href "#installation"
click package-setup href "#package-setup"
click ci-setup href "#ci-setup"
click add-code href "#add-code"

Create a Repository

  • Generate a new repository from this template.
  • Rename the package directory from jambazid/demo to ${namespace}/${component}.
    • ${namespace} typically represents your GitHub username or organization (use lower_snake_case).
    • ${component} is the name of your specific project or package.
    • See the Namespace guide for more details.

Installation

Important

A Unix-like environment (e.g., Linux or macOS) is recommended for development.

Install mise:

curl https://mise.run | sh

Navigate to the project root directory and run:

mise install
mise up

Package Setup

CI Setup

Configure the following parameters in release.yaml.

  • Parameters:
    • python-version
    • init-script (for custom setup steps)
  • PyPI publishing (optional):
    • Set create-release: true.
    • Create a deployment environment named release in GitHub Actions:
      • Add a TEST_PYPI_API_TOKEN environment variable containing your test.pypi.org API token.
      • Add a PYPI_API_TOKEN environment variable containing your upload.pypi.org API token.

Tip

Support for publishing packages to private registries is planned.

OIDC authentication support for PyPI will be integrated after the resolution of this issue.

See the release workflow documentation for more information.

Add Code

  • Develop your project under the python/src directory.
    • Ensure your code replaces the placeholder ${namespace}/${component} structure.
    • Update test cases in python/tests to target the new ${namespace}/${component} package.
  • Run task update to synchronize dependencies.
  • Run task test to execute the test suite.