This is the prototype next-gen tyrannosaurus. When ready, that repository will be updated.
Caution
:🚧 Status: The GitHub workflows and installable CLI package under construction.
A template for post-modern Python projects built with Hatch, uv, mkdocs-material, Ruff, and GitHub actions.
Autoformatting,
conventional commits and
autogenerated release notes,
publishing to PyPi + container registries + GH Releases + GH Pages,
reports to Coveralls + Codecov + etc.,
and some advanced CI/CD workflows.
It’s also an installable package that finds :tyranno:
comments in yaml, toml, Python, etc.
Want to use your pyproject.toml project.description
in your readme?
Use <!-- :tyranno: ${project.description} -->
Everything is optional.
Not using Docker? Delete Dockerfile
. The workflows will skip it.
Hate all the GitHub workflows? Delete them.
There’s no magic anywhere.
Only standard tools are used, and they’re used in transparent ways.
Just clone this repo and start modifying as you see fit.
Tip
:Making a repo supporting a scientific publication? Tyrannosaurus has a little sister, science-notebook-template 🧪.
Maybe you want your GitHub workflows to use your pyproject.toml
Python version.
Set default-python-version
in [tool.tyranno.data]
and reference it:
- uses: astral-sh/setup-uv@v5
with:
# :tyranno: python-version: "${.default-python-version|vr_minor(@)}"
python-version: "3.13"
If you wanted, you could define default-python-version
dynamically, too.
Use JMESPath to find the max version compatible with requires-python
:
[project]
requires-python = ">=3.11,<4.0"
[tool.tyranno.data]
# uses two custom functions that Tyranno provides: vrspec_filter and vr_max
# :tyranno: default-python-version = "${project.requires-python|vrspec_filter('python',@)|vr_max(@)}"
default-python-version = "3.13.1"
First, install uv. (I also recommend the GitHub CLI.)
- Clone this repo with
git clone
or "Use this template". - Edit
pyproject.toml
as needed, mainly the[project]
and[tool.tyranno.data]
sections. - Add or remove any files as you see fit.
For example, if you don’t use Docker, delete
Dockerfile
andcompose.yaml
. - Add your code to
src/
andtests/
. (Consider keeping the_about.py
.) - Run
uv lock --upgrade
,uv sync
,uvx pre-commit install
, anduvx pre-commit --all-files
.
Do whatever after that.
I recommend a PR-only workflow, and using
conventional commits
with the commit types listed in release.yaml
(full labels in project.yaml
).
This enables beautiful
autogenerated release notes.
Release Drafter
is a popular alternative to GitHub’s feature.
New issues and pull requests are welcome. Please refer to the contributing guide and security policy.
__
/ _)
_.----._/ / _ ,
.___/ / / = = ,
:----- | ) - ( |
: : : :
It’s a turtle with arms. dog. misshapen mango? T-rex.