Skip to content
/ bolt-library-starter Public template

Starter template for a bolt library package with regression testing

License

Notifications You must be signed in to change notification settings

mcbeet/bolt-library-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bolt-library-starter

GitHub Actions Code style: black Discord

Starter template for a bolt library package with regression testing.

Features

Get started

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.

Conventional commits

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.

Type checking

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.

Publish on PyPI

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