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.
This is an upgraded, trimmed-down, modern alternative to cookiecutter built with Poetry, Tox, and Github Actions. No legacy files or tools.
Don’t make 55 commits trying to configure Travis, Docker, or readthedocs. Just use tyrannosaurus new
pip install tyrannosaurus
tyrannosaurus new projectname --user gituserororg --track
Tyrannosaurus will then list final manual steps like adding API keys.
(--track
will git track gituserororg/projectname.)
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
- Code quality and coverage badges with Coveralls, codecov, and CodeClimate 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 files 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 §
- Auto cleanup of useless files (on running tox);
tyrannosaurus clean
to clean all temp files tyrannosaurus update
that lists dependency versions to bumptyrannosaurus sync
to synchronize project metadata to pyproject.toml
† Currently, the Azure pipeline config only builds a Docker image. Azure Pipelines costs $$.
‡ Temporary issue 1
and Temporary issue 2
§ Dependabot is off by default; a configuration file is provided
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. As of 2020-12, the last update was in 2020-04.
- 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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aa141ab3a4c2cccf1b61a8ea4e2003c31d80e969a8c113cde06feb1561264f8 |
|
MD5 | 7950da6777c789861f72a2624ddd0872 |
|
BLAKE2b-256 | af6934e30d0bf08a64de6abc1dee97cffb2046c686188a7aefb1c3b19387c3d8 |