Skip to main content

A python package template with tox testing environments.

Project description

Tests PyPI Code of conduct License: MIT

Using this template

  1. Create a new repository using Github's template interface, or run the following commands:
    git clone https://github.com/pcsagan/tethys <your_package_name>
    cd <your_package_name>
    rm -rf .git
    git init .
    
  2. Find and replace all instances of tethys and tethys-template with your package name
    • Your project name can match your package name. The name tethys-template was required becausetethys already exists on PyPI
  3. Update pyproject.toml to reflect its new author and requirements
  4. Update tox.ini to build the desired testing environments
  5. Update cli.py to customize the command line interface
    • Documentation for click
    • The entry point is defined in the project.scripts table in the pyproject.toml file
  6. Update .git/workflows/tests.yaml to specify the various operating systems and python versions used for testing
  7. Install your package dependencies into your development environment
    • Install the package locally in editable mode using the command:
      pip install -e .
      
    • Install the package locally along with all testing libraries used by tox with the command:
      pip install -r requirements.txt
      
  8. Add your code to the package while regularly committing your changes to your Github repository
  9. Add your tests to the tests directory
  10. Test your package using tox
    • Run all tests in their own environments using the command:
      tox
      
    • Run specific tests using tox with the -e flag:
      tox -e pytest
      tox -e flake8
      ...
      
    • If you installed the requirements.txt file then you can run testing modules without tox in your local environment:
      pytest <my_package_name>
      flake8 <my_package_name> tests
      ...
      
  11. Register on PyPI (and TestPyPI) and generate API tokens
  12. Add your tokens as a secret variable named pypi_api_token and testpypi_api_token to your Github repository
  13. Manually run the Publish Test action to verify that your token and package version are accepted using TestPyPI
  14. Manually run the Publish action to publish your package on PyPI

Help

Usage: tethys [OPTIONS] COMMAND [ARGS]...

  Tethys is a moon of Saturn.

Options:
  --version  Show the version and exit.
  --debug    Run the command in debug mode.
  --help     Show this message and exit.

Commands:
  data  Print the shared context data to the screen.
  foo   Print the result of calling the foo function to the screen.

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

tethys-template-1.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tethys_template-1.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file tethys-template-1.0.1.tar.gz.

File metadata

  • Download URL: tethys-template-1.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for tethys-template-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2f8196ed3f0fd027ff85b295bf8db0de936b60d5e610b87d1c3ca874ba103feb
MD5 36ba16e981def9cbc8a18e5e9300609b
BLAKE2b-256 63a877a22040e07c791b4dc9acfd2e76fafc7da5e3086e8f4f43a0f9855ab6d3

See more details on using hashes here.

File details

Details for the file tethys_template-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tethys_template-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e87c12b2e8aae6b4681f120ea72d6ce8fd637a13a3714b765c902cd1bbfa0b
MD5 efc6f41e04c92140ac7eab317f18acf0
BLAKE2b-256 4f6bae028e16685afdff0b193b7686de8f57a681f14a4f144199ade885a203f6

See more details on using hashes here.

Supported by

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