From 2ef7867ff872b3eec09b62bfa648a4dfc114427b Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Mon, 30 Nov 2026 18:12:44 +0300 Subject: [PATCH 1/5] Allow maintainers to add GitHub release notes for existing tags Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b961ef6-c3a0-493f-b36e-1e118425b7d7 --- RELEASE_POLICY.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index 171e49e..ddd7a30 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -1,7 +1,7 @@ # Release Policy `duroxide` is published to PyPI by Microsoft's internal open-source release -infrastructure. Publishing credentials and release execution remain outside +infrastructure. Publishing credentials and package builds for PyPI remain outside this repository. ## Contributor Workflow @@ -18,10 +18,19 @@ the release pull request's exact merge commit with explicit approval. A Microsoft maintainer then uses that tag with the internal release pipeline to build and publish the package to PyPI. +## GitHub Release Notes + +Maintainers may create a notes-only GitHub Release for an existing release +tag. Use the matching version's entry in `CHANGELOG.md` at that tag as the +release notes. Tags are immutable: select the existing tag on GitHub; do not +create, move, or replace a tag to add notes. + +A GitHub Release documents the version. Do not attach package artifacts or +use the GitHub Release to trigger PyPI publishing. + ## Publishing Boundary -- Do not publish directly to PyPI for the Microsoft release. -- Do not create a GitHub Release manually. +- Publish to PyPI only through Microsoft's internal release pipeline. - Do not request or store Microsoft publishing credentials in this repository. For release questions, open a GitHub issue without including credentials or From 2c1591c8a8c08d525b8263427968d5596eafb316 Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:16:02 +0300 Subject: [PATCH 2/5] Document the 0.4.0 Python minimum and verify wheel metadata Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b961ef6-c3a0-493f-b36e-1e118425b7d7 --- .agents/skills/release-preparation/SKILL.md | 3 ++ .github/workflows/build.yml | 38 ++++++++++++--------- CHANGELOG.md | 6 ++-- README.md | 4 +++ RELEASE_POLICY.md | 9 +++++ ci/smoke/README.md | 5 +++ docs/user-guide.md | 4 +++ 7 files changed, 50 insertions(+), 19 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index d30bac3..3b57713 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -15,6 +15,9 @@ pipeline, or request publishing credentials. ## Prepare the Release 1. Confirm the target semantic version with the user if it was not provided. + For a 0.x SDK, a change to the minimum supported CPython version requires + at least the next minor version. For a patch on an older line, branch from + the original release tag and keep its runtime minimum. 2. Set the same version in: - `pyproject.toml` under `[project]` - `Cargo.toml` under `[package]` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a631142..2197c00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,6 +69,7 @@ jobs: with: name: wheels-macos-${{ matrix.target }} path: dist/*.whl + if-no-files-found: error # ── Linux (x86_64 + aarch64, manylinux) ─────────────────── linux: @@ -109,6 +110,7 @@ jobs: with: name: wheels-linux-${{ matrix.target }} path: dist/*.whl + if-no-files-found: error # ── Windows (x86_64) ───────────────────────────────────────── windows: @@ -134,6 +136,7 @@ jobs: with: name: wheels-windows-${{ matrix.target }} path: dist/*.whl + if-no-files-found: error # ── Source distribution ───────────────────────────────────── sdist: @@ -151,11 +154,12 @@ jobs: with: name: wheels-sdist path: dist/*.tar.gz + if-no-files-found: error # ── Packaging smoke: install wheel into fresh venv on real OSes ── smoke-local: name: Smoke (local) ${{ matrix.os }} py${{ matrix.python }} - needs: [macos, linux, windows] + needs: [macos, linux, windows, sdist] env: PIP_ONLY_BINARY: duroxide strategy: @@ -180,22 +184,24 @@ jobs: pattern: wheels-* merge-multiple: true path: wheels - - name: List wheels - shell: bash + - name: Check wheel tags and metadata + shell: python run: | - ls -lh wheels/ - shopt -s nullglob - wheels=(wheels/*.whl) - if (( ${#wheels[@]} == 0 )); then - echo "::error::No wheel artifacts found" - exit 1 - fi - for wheel in "${wheels[@]}"; do - [[ "$wheel" == *-cp311-abi3-*.whl ]] || { - echo "::error file=$wheel::Expected a cp311-abi3 wheel" - exit 1 - } - done + from email.parser import BytesParser + from pathlib import Path + from zipfile import ZipFile + + wheels = sorted(Path("wheels").glob("*.whl")) + if not wheels: + raise SystemExit("No wheel artifacts found") + for wheel in wheels: + if wheel.stem.rsplit("-", 3)[-3:-1] != ["cp311", "abi3"]: + raise SystemExit(f"{wheel}: expected a cp311-abi3 wheel") + with ZipFile(wheel) as archive: + metadata, = (p for p in archive.namelist() if p.endswith(".dist-info/METADATA")) + requires = BytesParser().parsebytes(archive.read(metadata), headersonly=True)["Requires-Python"] + if requires != ">=3.11": + raise SystemExit(f"{wheel}: expected Requires-Python >=3.11, got {requires!r}") - name: Run smoke (local wheel) if: runner.os != 'Windows' env: diff --git a/CHANGELOG.md b/CHANGELOG.md index f549f36..6af8db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- The SDK now requires CPython 3.11 or newer; Python 3.9 and 3.10 are no - longer supported. Wheels use the `cp311-abi3` tag, and the CI smoke test - matrix covers standard CPython 3.11 through 3.15. +- The next minor release (0.4.0) requires CPython 3.11 or newer. The minimum + for 0.3.0 remains CPython 3.9. Starting with 0.4.0, wheels use the + `cp311-abi3` tag, and CI smoke-tests standard CPython 3.11 through 3.15. ## [0.3.0] - 2026-11-30 diff --git a/README.md b/README.md index 45fa6f4..8041a0f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ Write durable workflows as Python generators. The Rust runtime handles replay, p pip install duroxide ``` +The next minor release (0.4.0) requires CPython 3.11 or newer. On CPython +3.9 or 3.10, `pip install -U duroxide` may leave 0.3.0 installed rather than +report an error. Upgrade Python before installing 0.4.0. + Prebuilt wheels are published for macOS arm64/x64, Linux manylinux x86_64 and aarch64, and Windows x86_64. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index ddd7a30..f6886a1 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -18,6 +18,15 @@ the release pull request's exact merge commit with explicit approval. A Microsoft maintainer then uses that tag with the internal release pipeline to build and publish the package to PyPI. +## CPython support + +Review the minimum supported CPython version when an interpreter reaches +[upstream end of life](https://devguide.python.org/versions/). Dropping +support is a release decision, not an automatic change on the EOL date. +While the SDK is at 0.x, changing the minimum requires at least the next +minor release. Prepare patches for an older line from its release tag and +preserve that line's minimum. + ## GitHub Release Notes Maintainers may create a notes-only GitHub Release for an existing release diff --git a/ci/smoke/README.md b/ci/smoke/README.md index 678c407..e73226c 100644 --- a/ci/smoke/README.md +++ b/ci/smoke/README.md @@ -4,6 +4,11 @@ Cross-platform smoke tests that exercise the **distributable** `duroxide` Python wheel — not the source tree. Installs into a fresh venv, resolves platform tags, runs a minimal SQLite-backed orchestration. +For the upcoming 0.4.0 release, CI checks that the wheels are tagged +`cp311-abi3`, declare `Requires-Python: >=3.11`, and install on standard +CPython 3.11 through 3.15. On 3.9 and 3.10 a registry upgrade may still +select 0.3.0; it does not validate the new wheels. + Kept in lockstep with `sdks/duroxide-node/ci/smoke/`. The duroxide-update-manager agent owns parity. See its instructions for the full checklist. diff --git a/docs/user-guide.md b/docs/user-guide.md index 921d91f..b9a91ac 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -8,6 +8,10 @@ This guide covers how to build workflows with duroxide-python. For architecture pip install duroxide ``` +Use CPython 3.11 or newer for the upcoming 0.4.0 release. Version 0.3.0 +still supports CPython 3.9 and 3.10. On those interpreters, pip skips +incompatible releases, so `pip install -U duroxide` may stay on 0.3.0. + ## Core Concepts | Concept | What It Is | From 48bd290736ab15aaa225f4e77ef586841a90d485 Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:44:54 +0300 Subject: [PATCH 3/5] Require a notes-only GitHub Release for every release tag Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b961ef6-c3a0-493f-b36e-1e118425b7d7 --- .agents/skills/release-preparation/SKILL.md | 21 ++++++++++++++++----- RELEASE_POLICY.md | 14 +++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index 3b57713..87a077a 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -5,12 +5,12 @@ description: Preparing duroxide-python release pull requests. Use when bumping t # Release Preparation -This skill prepares the repository changes for a release. Publishing is handled -by Microsoft's internal release infrastructure as described in -`RELEASE_POLICY.md`. +This skill covers release preparation, tagging, and GitHub release notes. +Only Microsoft's internal release pipeline publishes to PyPI, as described +in `RELEASE_POLICY.md`. -Do not publish to PyPI, create a GitHub Release, start the internal release -pipeline, or request publishing credentials. +Do not publish directly to PyPI, start the internal release pipeline, or +request publishing credentials. ## Prepare the Release @@ -62,3 +62,14 @@ After the pull request is merged: For example, package version `0.1.29` uses tag `v0.1.29`. Treat release tags as immutable; never move or reuse an existing tag. Never substitute the current `origin/main` or `HEAD` tip for the release pull request's merge SHA. + +## Publish GitHub Release Notes + +Every release tag must have a notes-only GitHub Release. Follow the +developer's requested timing: publish the notes before or after PyPI +publication. If timing is unspecified, ask which order to use. + +Once the approved tag exists on `origin`, check whether it already has a +GitHub Release. If not, publish one against that exact tag using its version +entry from the tagged `CHANGELOG.md`. Do not create or move a tag to publish +notes, upload package assets, or trigger PyPI publication. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index f6886a1..74bb890 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -1,8 +1,7 @@ # Release Policy -`duroxide` is published to PyPI by Microsoft's internal open-source release -infrastructure. Publishing credentials and package builds for PyPI remain outside -this repository. +Microsoft's internal release pipeline publishes `duroxide` to PyPI. Publishing +credentials and package builds for PyPI remain outside this repository. ## Contributor Workflow @@ -29,10 +28,11 @@ preserve that line's minimum. ## GitHub Release Notes -Maintainers may create a notes-only GitHub Release for an existing release -tag. Use the matching version's entry in `CHANGELOG.md` at that tag as the -release notes. Tags are immutable: select the existing tag on GitHub; do not -create, move, or replace a tag to add notes. +Every release tag must have a notes-only GitHub Release. The developer chooses +whether maintainers publish the notes before or after PyPI publication. +Use the matching version's entry in `CHANGELOG.md` at that tag as the release +notes. Tags are immutable: select the existing tag on GitHub; do not create, +move, or replace a tag to add notes. A GitHub Release documents the version. Do not attach package artifacts or use the GitHub Release to trigger PyPI publishing. From 27d4d1b19876b50af38763cba112a0d9f02b2a36 Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:10:07 +0300 Subject: [PATCH 4/5] Verify distribution metadata before smoke and clarify release operations Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b961ef6-c3a0-493f-b36e-1e118425b7d7 --- .agents/skills/release-preparation/SKILL.md | 45 ++++++++++--- .github/workflows/build.yml | 41 ++++++------ CHANGELOG.md | 7 +- README.md | 5 +- RELEASE_POLICY.md | 27 +++++--- ci/smoke/README.md | 10 +-- ci/validate_artifacts.py | 56 ++++++++++++++++ docs/user-guide.md | 4 +- pyproject.toml | 1 + tests/test_artifact_metadata.py | 72 +++++++++++++++++++++ 10 files changed, 219 insertions(+), 49 deletions(-) create mode 100644 ci/validate_artifacts.py create mode 100644 tests/test_artifact_metadata.py diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index 87a077a..f1ac2e8 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -16,8 +16,9 @@ request publishing credentials. 1. Confirm the target semantic version with the user if it was not provided. For a 0.x SDK, a change to the minimum supported CPython version requires - at least the next minor version. For a patch on an older line, branch from - the original release tag and keep its runtime minimum. + at least the next minor version. The 3.11 floor starts in 0.4.0, not + `v0.3.0`. No further 0.3.x releases are planned from the current release + pipeline; users needing fixes must move to CPython 3.11+ and 0.4.x. 2. Set the same version in: - `pyproject.toml` under `[project]` - `Cargo.toml` under `[package]` @@ -37,6 +38,11 @@ preparation. Before presenting the changes: - Confirm the versions in `pyproject.toml` and `Cargo.toml` match. +- When changing the CPython minimum, align `pyproject.toml` (`requires-python` + and classifiers), `Cargo.toml` (PyO3 `abi3-py311` for 0.4.0), the matrix in + `.github/workflows/build.yml`, `ci/validate_artifacts.py` and its tests in + `tests/test_artifact_metadata.py`. Update `README.md`, `docs/user-guide.md`, + `ci/smoke/README.md` and the upgrade guidance in `CHANGELOG.md`. - Confirm the changelog version and date are correct. - Confirm the diff contains only the intended release preparation. @@ -65,11 +71,30 @@ immutable; never move or reuse an existing tag. Never substitute the current ## Publish GitHub Release Notes -Every release tag must have a notes-only GitHub Release. Follow the -developer's requested timing: publish the notes before or after PyPI -publication. If timing is unspecified, ask which order to use. - -Once the approved tag exists on `origin`, check whether it already has a -GitHub Release. If not, publish one against that exact tag using its version -entry from the tagged `CHANGELOG.md`. Do not create or move a tag to publish -notes, upload package assets, or trigger PyPI publication. +The maintainer operating the release publishes notes for every new release +tag. `v0.3.0` already has notes. Do not backfill or modify historic releases. + +1. Prepare the notes from the matching changelog and upgrade notes in the + tagged `CHANGELOG.md`. A draft is not a published release. Publish only + when explicitly authorized by the developer: a request to publish the + notes is sufficient, but approval to tag is not. Ask if timing is unclear. +2. If publishing before PyPI, include “PyPI publication pending”. Update the + line once the files are available; if publication is abandoned, say so in + the notes and leave the tag intact. If publishing after PyPI, verify that + PyPI lists the expected wheels and sdist for the version first. +3. Before publishing, verify that the tag on `origin` resolves to the release + PR's approved merge SHA (peel annotated tags to their commit). Stop on a + missing tag or mismatch. Never create or move a tag in this step. +4. Inspect any existing release before creating one. If it is already public + and matches the expected notes, status and empty asset list, do not + duplicate it. For a draft or any discrepancy, confirm the intended action + rather than overwriting notes or deleting assets. +5. To create the authorized public release, use + `gh release create "$tag" --verify-tag --notes-file "$notes" --latest="$latest"`. + Set `latest=true` only for the highest stable version; otherwise use `false`. + For a prerelease, add `--prerelease` and use `latest=false`. Do not attach + packages or trigger PyPI publishing. +6. Verify `gh release view "$tag" --json tagName,isDraft,isPrerelease,body,assets`: + the tag must match, the release must be public (not draft), the prerelease + status and notes must match, and there must be no uploaded assets. Verify + GitHub's Latest label matches the intended stable version. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2197c00..c3d1cfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" + check-latest: true - name: Install configured Rust toolchain run: | test -f rust-toolchain.toml @@ -57,6 +58,7 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" + check-latest: true - name: Require Rust toolchain configuration run: test -f rust-toolchain.toml - name: Build wheel @@ -86,6 +88,7 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" + check-latest: true - name: Require Rust toolchain configuration run: test -f rust-toolchain.toml - name: Build wheel @@ -123,6 +126,7 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" + check-latest: true - name: Require Rust toolchain configuration shell: bash run: test -f rust-toolchain.toml @@ -156,10 +160,26 @@ jobs: path: dist/*.tar.gz if-no-files-found: error + validate-artifacts: + runs-on: ubuntu-latest + needs: [macos, linux, windows, sdist] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: "3.12" + check-latest: true + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + pattern: wheels-* + merge-multiple: true + path: dist + - run: python ci/validate_artifacts.py dist + # ── Packaging smoke: install wheel into fresh venv on real OSes ── smoke-local: name: Smoke (local) ${{ matrix.os }} py${{ matrix.python }} - needs: [macos, linux, windows, sdist] + needs: validate-artifacts env: PIP_ONLY_BINARY: duroxide strategy: @@ -178,30 +198,13 @@ jobs: - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python }} + check-latest: true - name: Download wheels uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: wheels-* merge-multiple: true path: wheels - - name: Check wheel tags and metadata - shell: python - run: | - from email.parser import BytesParser - from pathlib import Path - from zipfile import ZipFile - - wheels = sorted(Path("wheels").glob("*.whl")) - if not wheels: - raise SystemExit("No wheel artifacts found") - for wheel in wheels: - if wheel.stem.rsplit("-", 3)[-3:-1] != ["cp311", "abi3"]: - raise SystemExit(f"{wheel}: expected a cp311-abi3 wheel") - with ZipFile(wheel) as archive: - metadata, = (p for p in archive.namelist() if p.endswith(".dist-info/METADATA")) - requires = BytesParser().parsebytes(archive.read(metadata), headersonly=True)["Requires-Python"] - if requires != ">=3.11": - raise SystemExit(f"{wheel}: expected Requires-Python >=3.11, got {requires!r}") - name: Run smoke (local wheel) if: runner.os != 'Windows' env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6af8db5..2ade6cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- The next minor release (0.4.0) requires CPython 3.11 or newer. The minimum - for 0.3.0 remains CPython 3.9. Starting with 0.4.0, wheels use the - `cp311-abi3` tag, and CI smoke-tests standard CPython 3.11 through 3.15. +- Starting with 0.4.0, duroxide requires CPython 3.11 or newer and ships + `cp311-abi3` wheels. The minimum for 0.3.0 remains CPython 3.9. Upgrade + Python before upgrading duroxide: on 3.9 or 3.10, `pip install -U duroxide` + may stay on 0.3.0 without an error. ## [0.3.0] - 2026-11-30 diff --git a/README.md b/README.md index 8041a0f..6e3f2ce 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ Write durable workflows as Python generators. The Rust runtime handles replay, p pip install duroxide ``` -The next minor release (0.4.0) requires CPython 3.11 or newer. On CPython +Starting with 0.4.0, duroxide requires CPython 3.11 or newer. The minimum +for 0.3.0 is CPython 3.9. On CPython 3.9 or 3.10, `pip install -U duroxide` may leave 0.3.0 installed rather than report an error. Upgrade Python before installing 0.4.0. @@ -257,6 +258,8 @@ reply = json.loads(status.custom_status) ## Development +Requires CPython 3.11 or newer. + Install Rust through [rustup](https://rustup.rs/). The root `rust-toolchain.toml` selects the compiler for local builds and GitHub Actions, including wheel builds inside manylinux containers. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index 74bb890..45aaab2 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -23,19 +23,26 @@ Review the minimum supported CPython version when an interpreter reaches [upstream end of life](https://devguide.python.org/versions/). Dropping support is a release decision, not an automatic change on the EOL date. While the SDK is at 0.x, changing the minimum requires at least the next -minor release. Prepare patches for an older line from its release tag and -preserve that line's minimum. +minor release. No further 0.3.x releases are planned from the current release +pipeline. For fixes, move to CPython 3.11 or newer and duroxide 0.4.x. ## GitHub Release Notes -Every release tag must have a notes-only GitHub Release. The developer chooses -whether maintainers publish the notes before or after PyPI publication. -Use the matching version's entry in `CHANGELOG.md` at that tag as the release -notes. Tags are immutable: select the existing tag on GitHub; do not create, -move, or replace a tag to add notes. - -A GitHub Release documents the version. Do not attach package artifacts or -use the GitHub Release to trigger PyPI publishing. +Every new release tag must have a published, notes-only GitHub Release. +`v0.3.0` already has one; do not backfill older tags or change historical +releases or assets. The maintainer operating the release publishes the tagged +version's changelog and upgrade notes. Tag approval alone does not authorize +public notes. The developer's explicit request to publish the notes is +sufficient; follow their choice of before or after PyPI, and ask if timing is +unspecified. + +Verify that the remote tag points to the approved merge commit and use +`--verify-tag`; never create, move, or replace a tag while publishing notes. +Mark only the highest stable release Latest, and mark prereleases accordingly. +For early notes, include “PyPI publication pending” and update that line when +publication completes or is abandoned. For after-PyPI notes, first verify the +expected files are on PyPI. Check the published notes, tag, status and empty +asset list. A GitHub Release must not trigger PyPI publication. ## Publishing Boundary diff --git a/ci/smoke/README.md b/ci/smoke/README.md index e73226c..dbe166e 100644 --- a/ci/smoke/README.md +++ b/ci/smoke/README.md @@ -4,10 +4,12 @@ Cross-platform smoke tests that exercise the **distributable** `duroxide` Python wheel — not the source tree. Installs into a fresh venv, resolves platform tags, runs a minimal SQLite-backed orchestration. -For the upcoming 0.4.0 release, CI checks that the wheels are tagged -`cp311-abi3`, declare `Requires-Python: >=3.11`, and install on standard -CPython 3.11 through 3.15. On 3.9 and 3.10 a registry upgrade may still -select 0.3.0; it does not validate the new wheels. +Starting with 0.4.0, duroxide requires CPython 3.11 or newer. CI checks the +wheels built by this repository's GitHub workflow for `cp311-abi3` tags and +checks the wheels and sdist for `Requires-Python: >=3.11`. The smoke matrix +installs those wheels on standard CPython 3.11 through 3.15. Version 0.3.0 +requires only CPython 3.9; a registry upgrade on 3.9 or 3.10 may select it +instead of the newer release. Kept in lockstep with `sdks/duroxide-node/ci/smoke/`. The duroxide-update-manager agent owns parity. See its instructions for the full checklist. diff --git a/ci/validate_artifacts.py b/ci/validate_artifacts.py new file mode 100644 index 0000000..e65d901 --- /dev/null +++ b/ci/validate_artifacts.py @@ -0,0 +1,56 @@ +"""Check the wheels and sdist built by the GitHub workflow before smoke testing.""" + +import re +import sys +import tarfile +import tomllib +from email.parser import BytesParser +from pathlib import Path +from zipfile import BadZipFile, ZipFile + + +def check_floor(metadata: bytes, path: Path) -> None: + headers = BytesParser().parsebytes(metadata, headersonly=True) + floors = headers.get_all("Requires-Python", []) + if floors != [">=3.11"]: + raise ValueError(f"{path.name}: expected one Requires-Python: >=3.11, got {floors!r}") + + +def validate(directory: Path, version: str) -> None: + stem = f"duroxide-{version}" + wheels = sorted(directory.glob("*.whl")) + if len(wheels) != 5: # Two macOS, two Linux, one Windows. + raise ValueError(f"{directory}: expected five wheels, found {[p.name for p in wheels]}") + for path in wheels: + if not re.fullmatch(rf"{re.escape(stem)}-cp311-abi3-[a-z0-9_]+(?:\.[a-z0-9_]+)*\.whl", path.name): + raise ValueError(f"{path.name}: expected {stem}-cp311-abi3-.whl") + try: + with ZipFile(path) as wheel: + entries = [p for p in wheel.namelist() if re.fullmatch(r"[^/]+\.dist-info/METADATA", p)] + if entries != [f"{stem}.dist-info/METADATA"]: + raise ValueError(f"{path.name}: expected one top-level {stem}.dist-info/METADATA, got {entries!r}") + check_floor(wheel.read(entries[0]), path) + except BadZipFile as exc: + raise ValueError(f"{path.name}: {exc}") from exc + + path = directory / f"{stem}.tar.gz" + sdists = list(directory.glob("*.tar.gz")) + if sdists != [path]: + raise ValueError(f"{directory}: expected only {path.name}, found {[p.name for p in sdists]}") + try: + with tarfile.open(path, "r:gz") as sdist: + entries = [m for m in sdist if m.name == f"{stem}/PKG-INFO"] + if len(entries) != 1 or not entries[0].isfile(): + raise ValueError(f"{path.name}: expected one regular {stem}/PKG-INFO") + check_floor(sdist.extractfile(entries[0]).read(), path) + except (tarfile.TarError, EOFError) as exc: + raise ValueError(f"{path.name}: {exc}") from exc + + +if __name__ == "__main__": + with Path(__file__).resolve().parents[1].joinpath("pyproject.toml").open("rb") as manifest: + version = tomllib.load(manifest)["project"]["version"] + try: + validate(Path(sys.argv[1]), version) + except ValueError as exc: + sys.exit(str(exc)) diff --git a/docs/user-guide.md b/docs/user-guide.md index b9a91ac..4da1847 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -8,8 +8,8 @@ This guide covers how to build workflows with duroxide-python. For architecture pip install duroxide ``` -Use CPython 3.11 or newer for the upcoming 0.4.0 release. Version 0.3.0 -still supports CPython 3.9 and 3.10. On those interpreters, pip skips +Starting with 0.4.0, duroxide requires CPython 3.11 or newer. The minimum +for 0.3.0 is CPython 3.9. On 3.9 or 3.10, pip skips incompatible releases, so `pip install -U duroxide` may stay on 0.3.0. ## Core Concepts diff --git a/pyproject.toml b/pyproject.toml index d7c07b2..a029ba8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,4 +29,5 @@ python-source = "python" module-name = "duroxide._duroxide" [tool.pytest.ini_options] +pythonpath = ["."] testpaths = ["tests"] diff --git a/tests/test_artifact_metadata.py b/tests/test_artifact_metadata.py new file mode 100644 index 0000000..e6ae49d --- /dev/null +++ b/tests/test_artifact_metadata.py @@ -0,0 +1,72 @@ +import io +import re +import tarfile +from zipfile import ZipFile + +import pytest + +from ci.validate_artifacts import validate + + +VERSION = "0.4.0" +STEM = f"duroxide-{VERSION}" +METADATA = f"{STEM}.dist-info/METADATA" +FLOOR = b"Requires-Python: >=3.11\n" +OLD = b"Requires-Python: >=3.9\n" + + +def write_wheel(path, headers=FLOOR, entries=(METADATA,)): + with ZipFile(path, "w") as archive: + for name in entries: + archive.writestr(name, headers) + + +def write_sdist(path, headers): + with tarfile.open(path, "w:gz") as archive: + member = tarfile.TarInfo(f"{STEM}/PKG-INFO") + member.size = len(headers) + archive.addfile(member, io.BytesIO(headers)) + + +@pytest.fixture +def inventory(tmp_path): + for platform in ("macosx_11_0_arm64", "macosx_11_0_x86_64", "manylinux_2_28_aarch64", + "manylinux_2_28_x86_64", "win_amd64"): + write_wheel(tmp_path / f"{STEM}-cp311-abi3-{platform}.whl") + write_sdist(tmp_path / f"{STEM}.tar.gz", FLOOR) + return tmp_path + + +def test_valid_inventory(inventory): + validate(inventory, VERSION) + + +@pytest.mark.parametrize("headers", [OLD, b"", FLOOR + OLD, OLD + FLOOR]) +def test_second_wheel_floor(inventory, headers): + path = sorted(inventory.glob("*.whl"))[1] + write_wheel(path, headers) + with pytest.raises(ValueError, match=re.escape(path.name) + ".*Requires-Python"): + validate(inventory, VERSION) + + +@pytest.mark.parametrize("entries", [(), ("nested/" + METADATA,), (METADATA, "other.dist-info/METADATA")]) +def test_wheel_metadata_count(inventory, entries): + path = sorted(inventory.glob("*.whl"))[1] + write_wheel(path, entries=entries) + with pytest.raises(ValueError, match=re.escape(path.name) + ".*one top-level"): + validate(inventory, VERSION) + + +@pytest.mark.parametrize("name", [f"{STEM}-cp39-abi3-win_amd64.whl", "cp311-abi3-win_amd64.whl", + f"{STEM}-cp311-abi3-.whl"]) +def test_wheel_filename(inventory, name): + next(inventory.glob("*.whl")).rename(inventory / name) + with pytest.raises(ValueError, match=re.escape(name)): + validate(inventory, VERSION) + + +def test_sdist_floor(inventory): + path, = inventory.glob("*.tar.gz") + write_sdist(path, OLD) + with pytest.raises(ValueError, match=re.escape(path.name) + ".*Requires-Python"): + validate(inventory, VERSION) From c08a7490ad0abbf80a7f4913cad8ad0b01e8a516 Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:22:42 +0300 Subject: [PATCH 5/5] Keep release policy independent of SDK versions Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5b961ef6-c3a0-493f-b36e-1e118425b7d7 --- .agents/skills/release-preparation/SKILL.md | 56 +++++++-------------- RELEASE_POLICY.md | 33 ++++-------- docs/user-guide.md | 1 + 3 files changed, 29 insertions(+), 61 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index f1ac2e8..f76cf16 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -15,10 +15,7 @@ request publishing credentials. ## Prepare the Release 1. Confirm the target semantic version with the user if it was not provided. - For a 0.x SDK, a change to the minimum supported CPython version requires - at least the next minor version. The 3.11 floor starts in 0.4.0, not - `v0.3.0`. No further 0.3.x releases are planned from the current release - pipeline; users needing fixes must move to CPython 3.11+ and 0.4.x. + Check runtime-floor and maintenance-line decisions against `RELEASE_POLICY.md`. 2. Set the same version in: - `pyproject.toml` under `[project]` - `Cargo.toml` under `[package]` @@ -38,11 +35,9 @@ preparation. Before presenting the changes: - Confirm the versions in `pyproject.toml` and `Cargo.toml` match. -- When changing the CPython minimum, align `pyproject.toml` (`requires-python` - and classifiers), `Cargo.toml` (PyO3 `abi3-py311` for 0.4.0), the matrix in - `.github/workflows/build.yml`, `ci/validate_artifacts.py` and its tests in - `tests/test_artifact_metadata.py`. Update `README.md`, `docs/user-guide.md`, - `ci/smoke/README.md` and the upgrade guidance in `CHANGELOG.md`. +- For a runtime-floor change, check `requires-python` and the classifiers + against the PyO3 `abi3-py*` feature. Align `.github/workflows/build.yml`, + `ci/validate_artifacts.py`, its tests, and the install, smoke and upgrade docs. - Confirm the changelog version and date are correct. - Confirm the diff contains only the intended release preparation. @@ -65,36 +60,21 @@ After the pull request is merged: 4. Confirm the `v`-prefixed tag does not already exist locally or on `origin`. 5. Create the tag on the recorded merge SHA and push it to `origin`. -For example, package version `0.1.29` uses tag `v0.1.29`. Treat release tags as -immutable; never move or reuse an existing tag. Never substitute the current +Use `vX.Y.Z` for package version `X.Y.Z`. Never move or reuse a tag or substitute the current `origin/main` or `HEAD` tip for the release pull request's merge SHA. ## Publish GitHub Release Notes -The maintainer operating the release publishes notes for every new release -tag. `v0.3.0` already has notes. Do not backfill or modify historic releases. - -1. Prepare the notes from the matching changelog and upgrade notes in the - tagged `CHANGELOG.md`. A draft is not a published release. Publish only - when explicitly authorized by the developer: a request to publish the - notes is sufficient, but approval to tag is not. Ask if timing is unclear. -2. If publishing before PyPI, include “PyPI publication pending”. Update the - line once the files are available; if publication is abandoned, say so in - the notes and leave the tag intact. If publishing after PyPI, verify that - PyPI lists the expected wheels and sdist for the version first. -3. Before publishing, verify that the tag on `origin` resolves to the release - PR's approved merge SHA (peel annotated tags to their commit). Stop on a - missing tag or mismatch. Never create or move a tag in this step. -4. Inspect any existing release before creating one. If it is already public - and matches the expected notes, status and empty asset list, do not - duplicate it. For a draft or any discrepancy, confirm the intended action - rather than overwriting notes or deleting assets. -5. To create the authorized public release, use - `gh release create "$tag" --verify-tag --notes-file "$notes" --latest="$latest"`. - Set `latest=true` only for the highest stable version; otherwise use `false`. - For a prerelease, add `--prerelease` and use `latest=false`. Do not attach - packages or trigger PyPI publishing. -6. Verify `gh release view "$tag" --json tagName,isDraft,isPrerelease,body,assets`: - the tag must match, the release must be public (not draft), the prerelease - status and notes must match, and there must be no uploaded assets. Verify - GitHub's Latest label matches the intended stable version. +1. Use the tagged `CHANGELOG.md` entry, including upgrade notes. The developer's + request to publish authorizes the notes; ask if before/after PyPI timing is + unclear. For early notes, add “PyPI publication pending” and update that + line on publication or abandonment. Otherwise verify the expected files on PyPI first. +2. Verify the tag on `origin` resolves to the approved merge SHA, peeling + annotated tags. Stop on a missing or mismatched tag; never create or move + one here. If a release exists, verify it instead of creating another. +3. Run `gh release create "$tag" --verify-tag --notes-file "$notes" --latest="$latest"` + without assets. Set `latest=true` only for the highest stable version; for + prereleases use `--prerelease --latest=false`. +4. Check `gh release view "$tag" --json tagName,isDraft,isPrerelease,body,assets` + for the expected tag, public notes, prerelease status and empty assets; + verify Latest separately. Stop on discrepancies rather than overwriting a release. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index 45aaab2..9236a19 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -9,8 +9,7 @@ Contributors can prepare a release through a pull request: 1. Update the version in `pyproject.toml` and `Cargo.toml`. 2. Update `CHANGELOG.md` and relevant documentation. -3. Confirm the pull request's `Build & Smoke` workflow passes. -4. Open a pull request for review. +3. Open a pull request for review and confirm `Build & Smoke` passes. After the release change is merged, the matching release tag is created from the release pull request's exact merge commit with explicit approval. A @@ -19,30 +18,18 @@ build and publish the package to PyPI. ## CPython support -Review the minimum supported CPython version when an interpreter reaches -[upstream end of life](https://devguide.python.org/versions/). Dropping -support is a release decision, not an automatic change on the EOL date. -While the SDK is at 0.x, changing the minimum requires at least the next -minor release. No further 0.3.x releases are planned from the current release -pipeline. For fixes, move to CPython 3.11 or newer and duroxide 0.4.x. +The minimum CPython version in `pyproject.toml` must match the PyO3 ABI +minimum in `Cargo.toml`. While the SDK is at 0.x, changing that minimum +requires at least a minor release. The current flow does not support +maintenance releases from older lines; those require a separately approved plan. ## GitHub Release Notes -Every new release tag must have a published, notes-only GitHub Release. -`v0.3.0` already has one; do not backfill older tags or change historical -releases or assets. The maintainer operating the release publishes the tagged -version's changelog and upgrade notes. Tag approval alone does not authorize -public notes. The developer's explicit request to publish the notes is -sufficient; follow their choice of before or after PyPI, and ask if timing is -unspecified. - -Verify that the remote tag points to the approved merge commit and use -`--verify-tag`; never create, move, or replace a tag while publishing notes. -Mark only the highest stable release Latest, and mark prereleases accordingly. -For early notes, include “PyPI publication pending” and update that line when -publication completes or is abandoned. For after-PyPI notes, first verify the -expected files are on PyPI. Check the published notes, tag, status and empty -asset list. A GitHub Release must not trigger PyPI publication. +Every new SDK version tag requires a notes-only GitHub Release. Existing tags +and releases remain unchanged. The release maintainer publishes the tagged +changelog and upgrade notes before or after PyPI publication, as requested by +the developer. Publishing notes requires explicit authorization separate from +tag approval. Do not upload package assets or trigger PyPI publication. ## Publishing Boundary diff --git a/docs/user-guide.md b/docs/user-guide.md index 4da1847..76d1950 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -11,6 +11,7 @@ pip install duroxide Starting with 0.4.0, duroxide requires CPython 3.11 or newer. The minimum for 0.3.0 is CPython 3.9. On 3.9 or 3.10, pip skips incompatible releases, so `pip install -U duroxide` may stay on 0.3.0. +No further 0.3.x releases are planned through the current release pipeline. ## Core Concepts