A template for post-modern Python projects built with Hatch, mkdocs-material, Ruff, and GitHub actions.
Caution
:🚧 Status: The GitHub workflows and installable package under construction.
Autoformatting,
conventional commits and
autogenerated release notes,
deploying 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.
Don’t want to publish to PyPi? Omit the PYPI_API_TOKEN
secret.
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
and reference it:
- uses: actions/setup-python@v5
with:
# :tyranno: python-version: '${.python-version-in-cicd}'
python-version: "3.12"
Or, use a JMESPath expression to
find the highest value allowed by project.requires-python = ">=3.9.2,<3.14
:
- uses: actions/setup-python@v5
with:
# :tyranno: python-version: '${project.requires-python|vr_max(@)|vr_major(@)}'
python-version: "3.12"
Caution
:🚧 This section needs some work
- Clone this repo or click "Use this template".
- Edit
pyproject.toml
to fit your project, especially the[project]
and[tool.tyranno.data]
sections. - Look through the repo structure, and modify, add, or remove anything as you see fit.
For example, if you don't use Docker, delete
Dockerfile
andcompose.yaml
. - Add your code under
src/
andtests/
. - Run
pre-commit install
in your project root. - When committing code, follow the recommended workflow and conventions: 1 ticket = 1 branch = 1 PR = 1 squashed commit to master = 1 release notes entry.
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.