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

Tyrannosaurus (soon to be v2)

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.

🎁 Features

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

🎨 Another sync example

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"

✏️ How to start

Caution

:🚧 This section needs some work

  1. Clone this repo or click "Use this template".
  2. Edit pyproject.toml to fit your project, especially the [project] and [tool.tyranno.data] sections.
  3. 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 and compose.yaml.
  4. Add your code under src/ and tests/.
  5. Run pre-commit install in your project root.
  6. When committing code, follow the recommended workflow and conventions: 1 ticket = 1 branch = 1 PR = 1 squashed commit to master = 1 release notes entry.

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