ably-python uses Poetry for packaging and dependency management. Please refer to the Poetry documentation for up to date instructions on how to install Poetry.
Perform the following operations after cloning the repository contents:
git submodule init
git submodule update
# Install the crypto extra if you wish to be able to run all of the tests
poetry install -E crypto
poetry run pytest
Releases should always be made through a release pull request (PR), which needs to bump the version number and add to the change log.
The release process must include the following steps:
- Ensure that all work intended for this release has landed to
main
- Create a release branch named like
release/2.0.1
- Add a commit to bump the version number, updating
pyproject.toml
andably/__init__.py
- Run
github_changelog_generator
to automate the update of the CHANGELOG. This may require some manual intervention, both in terms of how the command is run and how the change log file is modified. Your mileage may vary:- The command you will need to run will look something like this:
github_changelog_generator -u ably -p ably-python --since-tag v2.0.0 --output delta.md --token $GITHUB_TOKEN_WITH_REPO_ACCESS
. Generate token here. - Using the command above,
--output delta.md
writes changes made after--since-tag
to a new file - The contents of that new file (
delta.md
) then need to be manually inserted at the top of theCHANGELOG.md
, changing the "Unreleased" heading and linking with the current version numbers - Also ensure that the "Full Changelog" link points to the new version tag instead of the
HEAD
- The command you will need to run will look something like this:
- Commit this change:
git add CHANGELOG.md && git commit -m "Update change log."
- Push the release branch to GitHub
- Create a release PR (ensure you include an SDK Team Engineering Lead and the SDK Team Product Manager as reviewers) and gain approvals for it, then merge that to
main
- Build the synchronous REST client by running
poetry run unasync
- From the
main
branch, runpoetry build && poetry publish
(will require you to have a PyPi API token, see guide) to build and upload this new package to PyPi - Create a tag named like
v2.0.1
and push it to GitHub - e.g.git tag v2.0.1 && git push origin v2.0.1
- Create the release on GitHub including populating the release notes
- Update the Ably Changelog (via headwayapp) with these changes
We tend to use github_changelog_generator to collate the information required for a change log update.
Your mileage may vary, but it seems the most reliable method to invoke the generator is something like:
github_changelog_generator -u ably -p ably-python --since-tag v1.0.0 --output delta.md
and then manually merge the delta contents in to the main change log (where v1.0.0
in this case is the tag for the previous release).