Skip to main content

Generate ready-to-go Python projects.

Project description

Tyrannosaurus Reqs

Build status Latest version on PyPi Supported Python versions Documentation status Travis License

An opinionated 2020 Python template. Just clone it and modify or run tyrannosaurus new.

⚠ Status: Under development. The template works, but the command-line tool doesn't.

Poetry is fantastic and assumed. New projects are configured for:

  • Build: Poetry, Tox, Conda, DepHell, wheels, sdist
  • Test: Travis, Tox, pytest, Coverage
  • Style: Black, Flake8, MyPy, pycodestyle, pydocstyle
  • Hooks: EditorConfig, pre-commit-hooks
  • Documentation: ReadTheDocs, Sphinx, sphinx-autoapi
  • Publish: Twine, Docker, Conda-Forge (with grayskull)

Synchronize repeated metadata

Provides tyrannosaurus sync to copy metadata from your pyproject.toml other config files. The information copied includes version, description, dependencies, maintainers, and style settings. You can configure these under [tool.tyrannosaurus.sources] and [tool.tyrannosaurus.targets]. Always generates backups before modifying.

Here are most of the available synchronization targets:

  • Copyright, status, and date in __init__.py
  • Development dependencies between tool.poetry.dev-dependencies, tool.poetry.extras, and tox.ini
  • An all optional dependency list with all optional non-dev packages
  • Dependencies for building docs in docs/conf.py
  • Code line length between isort, black, and pycodestyle
  • Python version in pyproject.toml, tox.ini, .travis.yml, black, and readthedocs.yml
  • Copyright in docs/conf.py
  • Poetry version in Dockerfile
  • Authors and year listed in the license file
  • Dev versions in .pre-commit-config.yaml
  • --maintainers arg for Grayskull in tox.ini
  • doc_url, dev_url, and license_file in meta.yaml
  • Most recent version in CHANGELOG.md assuming Keep a Changelog

Reference of commands

Here are some useful commands:

  • pre-commit install to configure pre-commit hooks
  • tox to sync metadata, build, install, build docs, and test
  • poetry install to install and nothing more
  • poetry build to build wheels and sdists and nothing more
  • poetry bump to bump dependency versions (major or minor)
  • poetry publish to upload to PyPi
  • grayskull ${yourprojectname} --maintainers $(git config user.email) --output recipes/ to generate a Conda recipe
  • tyrannosaurus sync to sync metadata and nothing else
  • tyrannosaurus clean --aggressive to remove lots of temp files

Other things to set up

  • More pre-commit-config options, such as check-yaml
  • GPG keys with git: git config --global user.signingkey
  • GPG keys with Twine: use twine -s
  • A certificate with Certbot if you need one
  • Github labels, such as Tyrannosaurus's labels

Uploading to Conda-Forge

To upload a package to Conda-Forge:

  1. Publish to PyPi, then run grayskull as above and then tyrannosaurus sync.
  2. Check over your new recipe in recipes/projectname/meta.yaml.
  3. Fork from staged-recipes.
  4. Copy your recipe from recipes/projectname/meta.yaml into the forked repo (keeping the directories).
  5. Make a pull request. If everything goes well, it will be on Conda-Forge soon!

Suggested standards to observe

Here are some potentially useful standards:

Building, extending, and contributing

New issues and pull requests are welcome.

Tyrannosaurus is licensed under the Apache License, version 2.0. The author wrote it after making 18 Git commits trying to configure readthedocs, PyPi, and Tox. This avoids that struggle for 99% of projects.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tyrannosaurus-0.0.3.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

tyrannosaurus-0.0.3-py3-none-any.whl (13.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page