diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 7804c21..f3011f0 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -15,6 +15,10 @@ - [Adding examples](#adding-examples) - [Creating a Pull Request](#creating-a-pull-request) - [Working with Jupyter Notebooks](#working-with-jupyter-notebooks) + - [Releasing a New Version](#releasing-a-new-version) + - [Prerequisites](#prerequisites-1) + - [Versioning](#versioning) + - [Release Steps](#release-steps) ## Introduction @@ -125,3 +129,64 @@ This library is packaged with examples that can be downloaded via the doc websit make jupyter ``` +## Releasing a New Version + +### Prerequisites + +1. **PyPI maintainer access**: You must be added as a maintainer on the [biolearn PyPI project](https://pypi.org/project/biolearn/). Contact an existing maintainer to be added. +2. **PyPI API token**: Generate a project-scoped API token at [pypi.org/manage/account/token](https://pypi.org/manage/account/token/). Scope it to the `biolearn` project only. +3. **Hatch**: Install the build/publish tool globally: + ```bash + pipx install hatch + ``` + +### Versioning + +This project uses [Semantic Versioning](https://semver.org/) (`MAJOR.MINOR.PATCH`) with the `hatch-vcs` plugin, which derives the package version from git tags automatically. + +Biolearn is currently pre-1.0, meaning the library is not yet considered stable. In the `0.x` range: + +- **PATCH** (e.g., 0.9.0 → 0.9.1): Bug fixes and small additions +- **MINOR** (e.g., 0.9.1 → 0.10.0): New features, may include breaking changes +- **MAJOR** (e.g., 0.10.0 → 1.0.0): Major release, stable library with comprehensive clock and feature coverage + +Tags use the `v` prefix (e.g., `v0.9.0`). You **must** tag before building — otherwise hatch produces a dev version. + +### Release Steps + +1. **Ensure master is clean and tests pass** + ```bash + git checkout master + git pull origin master + make test + ``` + +2. **Tag the release** + ```bash + git tag v0.X.Y + git push origin v0.X.Y + ``` + +3. **Build** + ```bash + hatch build -c + ``` + Verify the filenames in `dist/` show the correct version with no `dev` suffix. + +4. **Publish to PyPI** + ```bash + export HATCH_INDEX_USER=__token__ + export HATCH_INDEX_AUTH= + hatch publish + ``` + +5. **Build and publish documentation** + ```bash + source .venv/bin/activate + cd doc + make html + ``` + Copy the contents of `doc/_build/html/` into the [bio-learn.github.io](https://github.com/bio-learn/bio-learn.github.io) repo and push. + +**Note:** The Makefile has a `publish` target (`make publish`) but it references `.venv/bin/hatch` which may not be available. Use a globally installed `hatch` as described above. +