Skip to content

dmyersturnbull/cicd

Repository files navigation

Version status Version on PyPi Version on GitHub Version on Docker Hub Build (Actions) Coverage (coveralls) Coverage (codecov)
Maintainability (Code Climate) Scrutinizer Code Quality CodeFactor
License DOI Created with Tyrannosaurus

Sandbox for Tyrannosaurus

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.

🎁 Features

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 🧪.

🎨 Another sync example

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"

✏️ How to start

First, install uv. (I also recommend the GitHub CLI.)

  1. Clone this repo with git clone or "Use this template".
  2. Edit pyproject.toml as needed, mainly the [project] and [tool.tyranno.data] sections.
  3. Add or remove any files as you see fit. For example, if you don’t use Docker, delete Dockerfile and compose.yaml.
  4. Add your code to src/ and tests/. (Consider keeping the _about.py.)
  5. Run uv lock --upgrade, uv sync, uvx pre-commit install, and uvx 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.

🍁 Contributing

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.