Skip to content

Cookiecutter template for a Python package using GitHub actions, poetry, pytest, and mkdocs.

License

Notifications You must be signed in to change notification settings

guiferviz/template-python

Repository files navigation

Template: Python package

This is a cookiecutter template for quickly creating a new Python package.

Getting started

To use this template, you will need to have cookiecutter installed. Once you have it, you can create a new Python package using this template by running the following command:

cookiecutter gh:guiferviz/template-python

Alternatively you can use cruft for creating your project. The advantage of using cruft over cookiecutter is that you can update your generated project if the template is also updated. To create the Python project files for the first time you can use:

cruft create https://github.com/guiferviz/template-python/

Once you have a new version of your template you can update your existing projects with:

cruft update

See the cruft docs for more info.

TODO after cloning.

  • Create PYPI_TOKEN secret. Generate a token in PYPI and add it as a secret in your repo configuration.
  • Give read and write permissions to the workflow. It is needed to deploy mkdocs in a gh-pages branch.
  • Active GitHub pages in the project settings. You need to select gh-pages as the branch with the docs.

Features

The generated template comes with the following features:

  • The template uses poetry for managing dependencies, creating virtual environments, packaging, and publishing to PyPI.
  • Testing is setup with pytest.
  • Documentation is generated using mkdocs.
  • The template includes GitHub Actions for:
    • Automatically releasing new versions to PyPI when you push a new tag to the master branch.
    • Deploying documentation to GitHub Pages.

About

Cookiecutter template for a Python package using GitHub actions, poetry, pytest, and mkdocs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published