karlicoss / pymplate

My Python project template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My (somewhat opinionated) Python project template

  • minimal configuration in setup.py, only setting the required fields

    No one cares about PyPi keywords, descriptions etc.

  • uses pytest and mypy (+coverage) for checks
  • uses ruff with some ignore directives to prevent it from being too annoying about the code style
  • relies on tox for running tests and checks in isolation
  • uses Github Actions for CI
    • make sure you can run CI against pull requests from other people (pull_request trigger) Note that people who fork it need to go to “Actions” tab on their fork and click “I understand my workflows, go ahead and enable them”.
    • build matrix for multiple python versions
    • trying to keep as little as possible in the CI configuration

      Because fuck yaml configs and learning yet another templating syntax

  • automatic PyPi deployments on new tags

CI

PyPi releases

Run scripts/release to deploy Python package onto PyPi and test PyPi.

The script expects TWINE_PASSWORD environment variable to contain the PyPi token (not the password!).

The script can be run manually. It’s also running as pypi job in Github Actions config. Packages are deployed on:

  • every master commit, onto test pypi
  • every new tag, onto production pypi

You’ll need to set TWINE_PASSWORD and TWINE_PASSWORD_TEST in secrets for Github Actions deployment to work.

About

My Python project template


Languages

Language:Python 90.7%Language:Shell 9.3%