Update the package¶
The release tools run through uv: uvx runs bumpver and twine without installing them, and uv build builds the package.
Release (direct bump on main)¶
Check that the
Python packageworkflow (test.yml) is enabled. It has a dailyscheduletrigger, and GitHub automatically disables scheduled workflows of a public repository after 60 days without repository activity. Thekeepalivejob oftest.ymlre-enables the workflow on every scheduled run to prevent that, so this step is a fallback for when it has been disabled anyway. While it is disabled, the PR checks and the daily run do not start. Re-enable it in the repository’s Actions tab (selectPython package, then “Enable workflow”), or rungh workflow enable test.yml --repo heremaps/here-search-demo.gh workflow list --all --repo heremaps/here-search-demoshows its state.Merge the code, doc and notebook changes of the release through regular PRs, without touching the version.
mainkeeps the previous version until the bump.Update your checkout:
git switch main && git pull.Preview the bump with
uvx bumpver update --set-version <version> --dry --no-fetch. It lists the changes topyproject.toml,src/here_search_demo/__init__.pyand the projectREADME.md.Optionally check the package locally:
rm -rf dist && uv build && uvx twine check dist/*. Removedist/first, because the build adds to the files already there. Do not upload from your machine: the release workflow publishes to PyPI.Run
uvx bumpver update --set-version <version>.bumpverupdates those files, creates the version commit onmain, tags it, and pushes the commit and the tag. This works only if you are allowed to push tomain(see the branch protection of the repository). If the push is rejected, undo the local changes withgit tag -d <version>andgit reset --hard origin/main, then follow “Release through a branch” below.Check that the
test.ymljobs for the version commit finish green and that Codecov still reports data for the repo (https://app.codecov.io/gh/heremaps/here-search-demo).Use “Draft a new release” in GitHub and select the tag created by bumpver.
Publishing the release triggers the PyPI workflow and uploads the
here-search-demo-notebooks.zipasset automatically.
Release through a branch (fallback)¶
Use this when main does not accept direct pushes. The version commit goes through a PR, and the tag is created on main after the merge.
Do steps 1 to 4 above. Then create a release branch:
git switch -c release/<version>.Run
uvx bumpver update --set-version <version> --no-tag-commit --no-push.bumpverupdates the files and creates the version commit, but creates no tag and pushes nothing. Then push the branch:git push origin release/<version>.The tag is created later, on
main. A tag made on the release branch would point to a commit that does not exist onmainafter a squash merge.Open a PR from the release branch. It contains only the version commit.
Ensure the PR’s
test.ymljobs finish green and that Codecov still reports data for the repo.Merge the PR into
main, then check thatmainis at the version commit (git fetch origin && git show origin/main:pyproject.toml | grep current_version).Use “Draft a new release” in GitHub. Choose “Create new tag on publish”, enter
<version>as the tag name, and set the target tomain. If other commits landed onmainafter the version commit, select the version commit as the target instead.Publishing the release creates the tag, triggers the PyPI workflow and uploads the
here-search-demo-notebooks.zipasset automatically.Run
git fetch --tags originin your checkout, so that the nextbumpverrun sees the new tag as the latest version.