Generate elegant, bleeding-edge, ready-to-use Python projects with seamless CI/CD, fit for 2021+.
Project description
Tyrannosaurus Reqs
An opinionated, forwards-looking Python template for 2021.
Generate elegant, ready-to-use Python projects that have excellent continuous integration and deployment (CI/CD). Integrated with Docker Hub, Github Packages, Azure, Conda-Forge, and an array of linting, static analysis, security testing, documentation, dependency management, and CI/CD tools, including a custom tool to keep all duplicate project metadata synchronized to pyproject.toml.
This is a modern alternative to
cookiecutter built with Poetry,
Github Actions, and no legacy files or tools.
Don’t make 55 commits trying to configure CI/CD workflows. Use tyrannosaurus new
:
pip install tyrannosaurus
tyrannosaurus new projectname --track
After initializing your project, Tyrannosaurus will list some manual steps, such as adding API keys.
Main behavior / features:
Generated projects are integrated with various tools (from PyPi) and external CI/CD/code-quality systems. Github Actions are used by default, but config files for Travis and Azure Pipelines are also provided. You can swap out, modify, or disable anything as you see fit. See the docs 📚 for more information.
By default, here’s how your new project will behave:
- Commit ⇒ Files are linted and verified for integrity
- Make a pull request ⇒ Code is built and tested
- Push to the main branch ⇒ Code is built and tested; code quality, coverage, and security badges are updated
- Make a Github release ⇒ Artifacts are sent to Github, PyPi, DockerHub, Github Packages, and readthedocs
tox
⇒ Tests are run locallytyrannosaurus sync
⇒ Project metadata is synced to pyproject.tomltyrannosaurus update
⇒ New dependency versions from PyPi and/or Conda are listed
Full features / integrations:
- Packaging and dependency management with Poetry
- Python 3.8, 3.9, and 3.10 (3.6 and 3.7 with a small change)
- Only modern files: no manifest file, setup.py, requirements.txt, setup.cfg, or eggs
- Continuous integration with Github Actions, Travis, or Azure Pipelines
- Continuous deployment to PyPi, Dockerhub, and Github Packages.
- Automatic attachment of sdits and wheels to Github Releases
- Documentation sent to readthedocs
- Nice documentation defaults with Sphinx extensions
- Test automation with Tox
- Shields with Coveralls, codecov, CodeClimate, and Scrutinizer that reflect the main branch
- Code linting with pre-commit, Black, and Prettifier
- Security analysis with Bandit, CodeQL, and safety †
- Static type analysis with mypy
- Conda-Forge recipes and environment YML with Grayskull and Tyrannosaurus
- IDE hints via EditorConfig with good defaults for most languages
- Fancy issue labels
- Fancy Github-recognized readme, license, contributing guide, issue templates, and pull request templates
- Nice gitignore, dockerignore, ChangeLog, and other misc files
- CodeMeta and CITATION.cff
- Dependency updating with Dependabot
tyrannosaurus clean
to clean temp filestyrannosaurus update
that lists dependency versions to bumptyrannosaurus sync
to synchronize project metadata to pyproject.toml
Syncing to pyproject.toml:
Note: This feature is only partly complete.
Tyrannosaurus has an optional sync
command that synchronizes metadata from pyproject.toml
to other files,
so that all of your metadata is in pyproject.toml.
There are 16 available target files, including docs/conf.py
, tox.ini
, .pre-commit-config.yaml
, readthedocs.yml
,
.travis.yml
, and __init__.py
.
Settings like dev dependencies, project version, license headers, and preferred line length can be listed exactly once,
in pyproject.toml.
Tyrannosaurus itself can be included as a dependency (but is not by default).
Running tyrannosaurus build
will run poetry lock, synchronize project metadata (via sync
), build, run tests,
install, and clean up.
Target files can be disabled in [tool.tyrannosaurus.targets]
.
Building your project locally:
To run locally, install Poetry
and Tox (pip install tox
).
Then just type tox
to build artifacts and run tests.
To create an initial Anaconda recipe or environment file, run tyrannosaurus recipe
or tyrannosaurus env
.
Similar tools:
- hypermodern-python, a Python template that is similarly modern. It looks solid but has fewer integrations. A few choices were different, such as the use of Nox. Nox has less traction and <500 Github stars, and was not updated since 2020-04 as of 2020-12.
- cookiecutter-hypermodern-python
- cookiecutter, which still uses setup.py
- python-blueprint, which is useful to look through but still uses setup.py
Contributing:
New issues and pull requests are welcome.
Please refer to the contributing guide
and security policy.
Generated with tyrannosaurus: tyrannosaurus new tyrannosaurus
.++++++++++++.
.++HHHHHHH^^HHH+.
.HHHHHHHHHH++-+-++.
.HHHHHHHHHHH:t~~~~~
.+HHHHHHHHHHjjjjjjjj.
.+NNNNNNNNN/++/:--..
........+NNNNNNNNNN.
.++++BBBBBBBBBBBBBBB.
.tttttttt:.. .++BBBBBBBBBBBBBBBBBBB.
+tt+. `` .+BBBBBBBBBBBBBBBBBBBBB+++cccc.
ttt. .-++BBBBBBBBBBBBBBBBBBBBBB++.ccc.
+ttt++++:::::++++++BBBBBBBBBBBBBBBBBBBBBBB+..++.
.+TTTTTTTTTTTTTBBBBBBBBBBBBBBBBBBBBBBBBB+. .ccc.
.++TTTTTTTTTTBBBBBBBBBBBBBBBBBBBBBBBB+. .cc.
..:++++++++++++++++++BBBBBB++++BBBB.
....... -LLLLL+. -LLLLL.
-LLLL+. -LLLL+.
+LLL+ +LLL+
+LL+ +ff+
+ff++ +++:
++++:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tyrannosaurus-0.8.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8903bb6d271c910ea21f4ac48f07fd303a90359d5618765d291f3d6a1f56a053 |
|
MD5 | 673b6cb7f3fb3b5cd7af63112df9b705 |
|
BLAKE2b-256 | 1374e5a23e641ed95f949cbcb961919252ad7a6e6860a7fcc42b61c60f60e01a |