Skip to content

A template for creating a Python library deployed to PyPI

License

Notifications You must be signed in to change notification settings

k2bd/poetry-library-template

Repository files navigation

Python + Poetry Library Template

This template will get you ready to deploy a library to PyPI.

Getting started from the template

  1. Rename the src/poetry_library_template package.
  2. Globally replace instances of poetry-library-template and poetry_library_template with your project and package name.
  3. Set your repo up on CodeCov and add a codecov token to your repo under the CODECOV_TOKEN action secret.
  4. Create a new repo-scoped personal access token and add it as the RELEASE_TOKEN action secret. This is so we can trigger further workflows on release.
  5. Create a PyPI token with write access for this package, and add it as the PYPI_PASSWORD action secret.
  6. Create and test your library.
  7. Update the distribution information such as classifiers and repo location in pyproject.toml.
  8. Write docs in docs/, including updating the project information in docs/conf.py
  9. When you're ready to release the first version, run the release GitHub action with the "major", "minor", or "patch" option.
  10. Remove this section from README.md.
  11. Happy hacking!

Like this template?

"Buy Me A Coffee"

Developing

Install Poetry and poetry install the project

Useful Commands

Note: if Poetry is managing a virtual environment for you, you may need to use poetry run poe instead of poe

  • poe autoformat - Autoformat code
  • poe lint - Linting
  • poe test - Run Tests
  • poe docs - Build docs

Release

Release a new version by manually running the release action on GitHub with a 'major', 'minor', or 'patch' version bump selected. This will create an push a new semver tag of the format v1.2.3.

Pushing this tag will trigger an action to release a new version of your library to PyPI.

Optionally create a release from this new tag to let users know what changed.

About

A template for creating a Python library deployed to PyPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages