A simple template for Python projects, with CI/CD configured through GitHub Actions.
- Create a new repository, using this one as a template.
- Install and open Gemini CLI, then run the
/templatizecommand:gemini run /templatize
Note: For simplicity, I assume you are using uv, but this project is compatible with any virtual environment or package manager (
pip,venv,poetry,pipenv,conda).
# Create and activate a new virtual environment
uv venv --python 3.12
source .venv/bin/activate
# Install development dependencies and pre-commit hoooks
uv sync --all-extras
pre-commit install| Tool | Description | Runs on |
|---|---|---|
| ruff | Code linter | - git commit (through pre-commit) - git push - pull requests |
| ty | Static type checker | - git commit - pull requests |
| pytest | Unit testing framework | - git push - pull requests |
|
twine |
PyPI package uploader | - New release (git tag) |
$\dagger$ Requires enabling thepublish.yamlworkflow. To activate, move the file from.github/disabled-workflows/publish.yaml.disabledto.github/workflows/publish.yaml, and set a valid PyPI token asPYPI_API_TOKENin the repo secrets.Then tag a new release of this repo, and GHA will automatically build and publish a Python wheel (
.whl) to PyPI.