Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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=<your-api-token>
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.
Comment thread
sarudak marked this conversation as resolved.

Loading