|
| 1 | +# Package versioning |
| 2 | + |
| 3 | +Semantic-version bumps of the `openpois` Python package + Vue site + Sphinx docs. **This is distinct from dataset versioning** (`versions:` block in `config.yaml`) — see [data-versioning.md](data-versioning.md) for that. |
| 4 | + |
| 5 | +## Files to update on every bump |
| 6 | + |
| 7 | +Five files declare the package version. All must move together. |
| 8 | + |
| 9 | +| File | Field | Notes | |
| 10 | +|---|---|---| |
| 11 | +| [src/openpois/__init__.py](../../src/openpois/__init__.py) | `__version__` | Canonical source for `import openpois; openpois.__version__`. | |
| 12 | +| [pyproject.toml](../../pyproject.toml) | `version` | Static string under `[project]`. We do **not** use `dynamic = ["version"]` — the prior setup had no resolver and would have failed a fresh build. | |
| 13 | +| [pyproject.toml](../../pyproject.toml) | `Development Status` classifier | Bump when crossing thresholds: `3 - Alpha` → `4 - Beta` → `5 - Production/Stable`. Don't bump on every release. | |
| 14 | +| [docs/conf.py](../../docs/conf.py) | `release` | Sphinx version surfaced in the rendered docs at openpois.org/docs/. | |
| 15 | +| [site/package.json](../../site/package.json) | `"version"` | Vue site at openpois.org. Largely cosmetic but keep in lock-step. | |
| 16 | +| [CITATION.cff](../../CITATION.cff) | `version`, `date-released` | GitHub renders both in the "Cite this repository" panel. `date-released` should match the tag date. | |
| 17 | + |
| 18 | +## Conventions |
| 19 | + |
| 20 | +- **Semver**: patch for bug fixes, minor for backwards-compatible features, major for breaking API changes. Crossing 1.0.0 signals a stable public API. |
| 21 | +- **Tag prefix**: `vX.Y.Z` (e.g., `v1.0.0`). |
| 22 | +- **Annotated tags only** (`git tag -a`, never lightweight). GitHub Releases requires a tag object; lightweight tags don't carry a message. |
| 23 | +- **Date format in CITATION.cff**: ISO `YYYY-MM-DD`, quoted. |
| 24 | + |
| 25 | +## Workflow |
| 26 | + |
| 27 | +```bash |
| 28 | +# 1. Edit the five files above. Sanity-check: |
| 29 | +git diff -- src/openpois/__init__.py pyproject.toml docs/conf.py \ |
| 30 | + site/package.json CITATION.cff |
| 31 | + |
| 32 | +# 2. Verify install + tests still pass. |
| 33 | +pytest -q |
| 34 | + |
| 35 | +# 3. Commit with a single-purpose message ("Bump to vX.Y.Z, …"). |
| 36 | + |
| 37 | +# 4. Tag annotated, then push commit + tag together. |
| 38 | +git tag -a vX.Y.Z -m "OpenPOIs X.Y.Z — <release theme>" |
| 39 | +git push origin main vX.Y.Z |
| 40 | + |
| 41 | +# 5. Verify the tag on remote. |
| 42 | +git ls-remote --tags origin vX.Y.Z |
| 43 | +``` |
| 44 | + |
| 45 | +## Verifying a tag is correctly placed |
| 46 | + |
| 47 | +```bash |
| 48 | +git for-each-ref --format='%(refname:short) %(objectname:short) -> %(*objectname:short) %(*subject)' refs/tags/vX.Y.Z |
| 49 | +``` |
| 50 | + |
| 51 | +The first SHA is the annotated-tag *object* (its own hash); the second is the *commit* it points to. Both differ on purpose — that's how annotated tags work. The tag object SHA is what `git ls-remote --tags` reports. |
| 52 | + |
| 53 | +## After tagging |
| 54 | + |
| 55 | +GitHub auto-renders the tag under **Releases** as a "tag-only" entry. To promote it to a full **Release** (release notes, asset attachments, RSS feed), open `https://github.com/henryspatialanalysis/openpois/releases/tag/vX.Y.Z` and click *Create release from tag*. This is manual and per-release. |
| 56 | + |
| 57 | +## What does NOT need to bump |
| 58 | + |
| 59 | +- `versions:` block in `config.yaml` — that's data versioning, on its own monthly cadence. |
| 60 | +- `cff-version: 1.2.0` in `CITATION.cff` — that's the CFF spec version, not the package version. Leave alone. |
| 61 | +- Conda env name in `environment.yml` — env name is `openpois`, not version-suffixed. |
| 62 | + |
| 63 | +## Triggers for a major bump (1.0 → 2.0) |
| 64 | + |
| 65 | +- Breaking API change in `openpois.*` public modules (rename, remove, signature change without back-compat shim). |
| 66 | +- Schema change in published Source Coop data that breaks existing readers. |
| 67 | +- Renaming or restructuring `config.yaml`'s top-level keys (scripts read these by name). |
| 68 | + |
| 69 | +Cosmetic changes, internal refactors, dependency bumps that don't change the public surface, and dataset refreshes are minor or patch. |
0 commit comments