Skip to content

Commit f0559e9

Browse files
committed
Add package versioning notes for maintainer.
1 parent 2a6b33a commit f0559e9

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Style: Black (format-on-save in VSCode). Lint: flake8 + pylint, configured in `p
5151
- [docs/data-sources.md](docs/data-sources.md) — URLs, auth, schema quirks for every source
5252
- [docs/taxonomy-setup.md](docs/taxonomy-setup.md) — crosswalk CSVs, build_taxonomy.py, frontend sync
5353
- [docs/data-versioning.md](docs/data-versioning.md)`versions:` block, path resolution, external references
54+
- [docs/package-versioning.md](docs/package-versioning.md) — semver bumps for the Python package + Vue site + Sphinx docs (distinct from data versioning)
5455
- [docs/partitioning-strategy.md](docs/partitioning-strategy.md) — Hive layout of the partitioned Parquet (`shared_label` for conflated, `primary_tag` for OSM), query patterns, when each layout applies
5556
- [docs/turnover-model-methodology.md](docs/turnover-model-methodology.md) — statistical derivation of the POI turnover model with ZIE extension
5657

.claude/docs/package-versioning.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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

Comments
 (0)