A release publishes one version of hotmemory to PyPI and creates a GitHub Release. Use
./scripts/release.sh for each release. Do not change the version, push a tag, or create a
GitHub Release by hand.
- uv runs the scripts and updates
uv.lock. - The GitHub CLI,
gh, opens the release pull request. Log in withgh auth login. - You can push to
mainand push tags to this repository.
The publish uses PyPI trusted publishing. PyPI accepts the upload from the workflow
publish.yml in the GitHub environment pypi, and no API token exists. The section
One-time setup tells you how to configure it.
-
Make sure that
CHANGELOG.mdhas the notes of the release under## [Unreleased]. -
Prepare the release pull request. Give a bump kind, or the version itself:
./scripts/release.sh prepare minor # or patch, major, or 0.2.0The script starts from the latest
main. It sets the version inpyproject.toml, moves the Unreleased notes into a section for the version, updatesuv.lock, and runsmake verify. Then it pushes the branchrelease/vX.Y.Zand opens the pull request. -
Merge the pull request after CI passes.
-
Publish from a clean checkout:
./scripts/release.sh publish
The script tags the version on the latest
mainand pushes the tagvX.Y.Z.
The tag starts the workflow publish.yml. It runs three jobs in order:
buildmakes sure that the tagged commit is onmain, that the tag matches the version inpyproject.toml, and thatCHANGELOG.mdhas a section for the version. Then it builds the wheel and the sdist withuv buildand checks them withtwine check --strict.pypiuploads the wheel and the sdist to PyPI. It runs in the environmentpypi.github-releasecreates the GitHub Release. The release notes are the changelog section of the version, and the wheel and the sdist are attached.
If build or pypi fails, no GitHub Release is created. A version that PyPI accepted
cannot be uploaded again. To fix a bad release, release a new version.
- On a pull request that changes
pyproject.tomlorCHANGELOG.md, the workflowcheck-release.ymlrunsscripts/changelog.py check. If the version changed andCHANGELOG.mdhas no section for the new version, it fails. - If the Unreleased section is empty,
release.sh preparestops. - If the tag exists or the changelog section is missing,
release.sh publishstops. - If the tagged commit is not on
main, or the tag and the version differ, thebuildjob stops.
The wheel contains src/hotmemory only. The sdist contains src/hotmemory, README.md,
CHANGELOG.md, and LICENSE. The benchmark runner in bench/, the skill in
skills/hotmemory/, the tests, and the documents stay in the repository. To see the
contents, run uv build and list the archives in dist/.
The README is the project description on PyPI. A relative link does not work on PyPI, so
the README links to repository files with absolute GitHub links. make verify makes sure
that each of these links names a file that exists.
An owner of the GitHub repository and the PyPI project does these steps once, before the first release.
-
On GitHub, open Settings, then Environments, and create the environment
pypi. To require an approval before each upload, add required reviewers. -
On PyPI, open Your account, then Publishing, and add a pending trusted publisher with these values:
Field Value PyPI project name hotmemoryOwner hotdata-devRepository name hotmemoryWorkflow name publish.ymlEnvironment name pypiThe first upload creates the project and makes the publisher permanent.
-
After the first release, add the other maintainers to the PyPI project.