Skip to content

santibreo/cookiecutter-pypackage

Repository files navigation

Python package boilerplate

There must be a thousand of these around, including the one that is used in the cookiecutter turorial, so this is just one more.

Why?

  • You are prompted just for 5 things.
  • This contains boilerplate for:
    • Testing your package using pytest
    • Analysing test coverage of your package using coverage
    • Documenting your package with Sphinx.
    • Publishing documentation as a static website with Github Pages
    • Publishing your package in PyPI when you push a tag to the main branch.
    • Using pre-commit hooks to ensure style alignment and code quality.
    • Using tox to be sure that everything works fine in multiple Python versions (and compile documentation)
    • Using make to make your life much simpler
    • Checking that your package name is not currently in use in PyPI.

How to use

This can be used normally with cookiecutter just run:

$ cookiecutter gh:santibreo/cookiecutter-pypackage

To make the Github Workflow work you need to:

  1. Create an environment in your remote repo called 'release'.
  2. Configure a trusted publishing for your PyPI project.

If this is your first time best follow this tutorial (this workflow does not contain the signing part).

To publish the documentation to Github Pages you have to go to remote repo Settings > Pages and there select a branch and docs folder.

About

My cookiecutter boilerplate for Python packages

Resources

Stars

Watchers

Forks

Packages

No packages published