You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- name: Verify the tag matches the package version
52
+
# The published version comes from src/coreai_opt/_about.py, not the tag.
53
+
# Fail early if they disagree so we never publish a mismatched/duplicate
54
+
# version (PyPI uploads are immutable and cannot be overwritten).
55
+
# `print_version.py --release` computes the version exactly as the
56
+
# `make build` step below does, so this guard can't drift from what
57
+
# actually gets published.
58
+
# Skipped on manual dry runs, where the ref is a branch, not a vX.Y.Z tag.
59
+
# Run via uv (installed above) so the interpreter satisfies
60
+
# requires-python whatever the runner image ships; see the Makefile's
61
+
# `version` target.
62
+
if: github.event_name == 'push'
63
+
run: |
64
+
tag="${GITHUB_REF_NAME}"
65
+
version="$(uv run --no-config --no-project --python '>=3.11' scripts/make/print_version.py --release)"
66
+
echo "tag=${tag} package version=${version}"
67
+
if [ "${tag}" != "v${version}" ]; then
68
+
echo "::error::Tag ${tag} does not match package version v${version} (src/coreai_opt/_about.py). Update latest_released_version so the release it implies matches the tag."
The OSS release process for Core AI Optimization is being defined. This page will document the workflow for publishing to PyPI once the public release infrastructure is finalized.
3
+
The OSS release process for Core AI Optimization is still being defined. This page will document the workflow for publishing to PyPI once the public release infrastructure is finalized.
4
4
5
-
Available locally:
5
+
The following commands are available locally:
6
6
7
7
```bash
8
-
make build # build the package wheel
9
-
make version # show current version
8
+
make build # build the canonical, publishable wheel + sdist (uv build --no-sources)
9
+
make build-dev # build a timestamped dev wheel (e.g. 0.2.2.dev202607231430+abc1234)
10
+
make version # show the development version carried on the tree (e.g. 0.2.2.dev0)
10
11
make clean # remove build artifacts
11
12
```
12
13
14
+
## Version scheme
15
+
16
+
`main` always carries the version planned for the _next_ release. This ensures that ongoing development is never mistaken for an already-published version, and that a release can be stabilized, tested, and published on its own branch, independently of later changes on `main`. (The release-branch workflow itself — branch naming, tagging, and backporting fixes to `main` — will be documented separately in the release schedule doc; this section covers only the version-string mechanics.)
17
+
18
+
`src/coreai_opt/_about.py` stores `latest_released_version` (the last tagged release, e.g. `"0.2.1"`) and computes `__version__` from it by incrementing its last number by one and adding a `.dev0` suffix (e.g. `"0.2.2.dev0"`). A pre-commit hook (`check-about-version`) verifies that `__version__` always follows this rule and that `latest_released_version` matches the repo's latest release tag. As a result, `__version__` can never look as though a release has shipped when it hasn't. The `.dev0` suffix is only a marker on the tree; it never appears in a built wheel.
19
+
20
+
-`make build` builds the release that `__version__` implies, e.g. `0.2.2`. A release is cut by tagging it (`v0.2.2`); `latest_released_version` is then hard-coded to `"0.2.2"`, which bumps `__version__` to the next candidate (`0.2.3.dev0`).
21
+
-`make build-dev` builds that same release but with a unique `.dev<UTC-timestamp>+<short-sha>` suffix instead. It is used by contributors, smoke tests, and the nightly pipeline. `DEV_VERSION=<version>` uses that version exactly instead.
22
+
23
+
Sorting is preserved: `0.2.2.dev0 < 0.2.2.dev202607231430+abc1234 < 0.2.2`.
24
+
25
+
### Extending the scheme downstream
26
+
27
+
A repo that uses this one as a submodule and includes this `Makefile` — building one combined wheel from both trees — can add its own 4th number. Set `COREAI_OPT_VERSION_EXTENSION` to the number it's about to release next (e.g. `"1"` for its first release off a given OSS release, then `"2"` for the one after that). Then call `make build`, `make build-dev`, or `make version` unchanged:
The extra number is used exactly as given (`scripts/release/release_utils.apply_version_extension`); `latest_released_version`'s own last number is only bumped for OSS's own `main`, when no extension is set.
34
+
35
+
There is still only one `_about.py` (this package's own); the extra number is a plain string handled entirely in `scripts/release/release_utils.next_release_base` — no other file or package is involved.
36
+
13
37
<!-- TODO: Document the chosen OSS release workflow (PyPI trusted publishing, twine upload, or uv publish). -->
0 commit comments