Starter template for a bolt library package with regression testing.
- Packaging and dependency management with
poetry
- Default
beet
plugin that mounts a library ofbolt
modules - Regression testing with
pytest
,pytest-insta
, andlectern
- Continuous integration and automatic releases with
python-semantic-release
- Smart template initialization using a one-off workflow
Create a new repository from this template by clicking the "Use this template" button above. The one-off workflow should kick in and your new repository will be initialized with the correct name and details.
You can also clone or download this repository manually, and rename the package and substitute all the fixme
by hand. Don't forget to reset the version number and remove the one-off workflow in .github/workflows/template.yml
.
The main workflow in .github/workflows/main.yml
will take care of version bumps and releases automatically based on the conventional commits specification. This means that all commit messages must be prefixed with a type, such as feat:
, fix:
, docs:
, etc. The type determines the version bump that will be applied to the package.
This will save you hours of fiddling with version numbers and changelogs.
To disable this feature, remove the "Release" step at the end of the main workflow. Then uninstall python-semantic-release
with poetry remove -Gdev python-semantic-release
and remove the [tool.semantic_release]
section in pyproject.toml
.
This template doesn't include a local static type checker, but if you use Visual Studio Code the editor will directly report strong diagnostics thanks to the typeCheckingMode = "strict"
option in pyproject.toml
.
If you're more familiar with static typing in Python, you're encouraged to install Pyright in the project to pin it to a specific version and run it after pytest
in the main workflow.
To enable automatic releases on PyPI, create a PyPI API token and add it to your repository secrets as PYPI_TOKEN
. Next, add the token as an environment variable at the end of the main workflow in .github/workflows/main.yml
.
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Finally, activate PyPI upload in the python-semantic-release
configuration in pyproject.toml
by removing or setting the upload_to_repository
option to true
.
License - MIT