This template repository provides the boilerplate to create a python package. It is configured with all the following features:
Use this template button)bootstrap_python_package directorybootstrap-python-package and bootstrap_python_packagebootstrap-python-package)febus982)bootstrap-python-package)release.ymlCODECLIMATE_REPORTER_ID (at URL https://github.com/GITHUB_NAME_OR_ORGANIZATION/GITHUB_REPOSITORY/settings/secrets/actions)
containing the codeclimate reporter id (you can find it at https://codeclimate.com/repos/YOUR_REPO_ID/settings/test_reporter).
If you don't want to use CodeClimate just delete workflows/python-quality.yml.README.md! (check shields.io for extra badges)pip install poetrymake dev-dependenciespre-commit install so that formatting and linting are automatically executed during git commit.poetry run mike deploy dev latest --update-aliases --pushgh-pages branch (at URL https://github.com/GITHUB_NAME_OR_ORGANIZATION/GITHUB_REPOSITORY/settings/pages)main branch and the v*.*.* tag rules to the "deployment branches and tags" list in the gh-pages environment (at URL https://github.com/GITHUB_NAME_OR_ORGANIZATION/GITHUB_REPOSITORY/settings/environments)IMPORTANT: The repository is configured to deploy on the test PyPI repository.
It's strongly recommended to create the project in the test PyPI repository and test
the deployment pipeline. When you're happy with the result, create the project on the official PyPI repository
and remove the marked lines in workflows/release.yml.
This setup uses poetry-dynamic-versioning. This means it's not necessary to commit the version in the code but the CI pipeline will infer it from the git tag.
To release a new version, just create a new release and tag in the GitHub repository, to:
IMPORTANT: The default configuration requires the release name and the tag to follow
the convention vX.X.X (semantic versioning preceded by lowercase v). It will publish
the correct version on Pypi, omitting the v (ie. v1.0.0 will publish 1.0.0).
This format can be customized, refer to poetry-dynamic-versioning docs
All the common commands used during development can be run using make targets:
make dev-dependencies: Install dev requirementsmake update-dependencies: Update dev requirementsmake fix: Run code style and lint automatic fixes (where possible)make test: Run test suite against system python versionmake check: Run tests against all available python versions, code style and lint checksmake type, make format, make lint, make bandit: Run the relevant checkmake docs: Render the mkdocs website locally