From 117428a5bdbcc79bd3131cfd1f4962275d354aa4 Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Wed, 16 Sep 2026 11:35:33 -1000 Subject: [PATCH] Build the release with uv instead of hatch `create-release.yml` was the only workflow not going through `uv`: it set up a Python, `pip install hatch`, then `hatch clean && hatch build`. Every other job -- tests, docs, canary -- installs `astral-sh/setup-uv` and runs `uv`, and so does every developer. `uv build` drives the same `hatchling` backend `[build-system]` declares, so the sdist and wheel are the artifacts `uv build` already produces locally. It also resolves an interpreter matching `requires-python` on its own, so the `actions/setup-python` step goes with it. `hatch clean` goes too: the runner checks out fresh, so there is no stale `dist/` for the release upload to pick up. This is the same objection as the retired hatch envs and `docs/requirements.txt` -- a second way to reach the same thing is a second thing to keep in step. Co-Authored-By: Claude Opus 5 --- .github/workflows/create-release.yml | 20 ++++++++------------ CHANGELOG.md | 7 +++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 2e279f8..0f4082a 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -44,19 +44,15 @@ jobs: exit 1 fi - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install build tool (Hatch) - run: | - python -m pip install --upgrade pip - pip install hatch - - name: Build package with Hatch + - name: Install uv + uses: astral-sh/setup-uv@v5 + # `uv build` drives the `hatchling` backend `[build-system]` declares, so + # this is the same sdist and wheel `uv build` produces locally. `uv` + # resolves an interpreter matching `requires-python` on its own, so there + # is no separate Python to set up. + - name: Build package id: build - run: | - hatch clean - hatch build + run: uv build - name: Publish package # No user/password: an explicit password disables Trusted Publishing, # and with it the build attestations this action produces by default. diff --git a/CHANGELOG.md b/CHANGELOG.md index 85cf008..503aee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +### Changed + +- The release workflow builds with `uv build` instead of installing `hatch` + with `pip`. It was the only workflow not going through `uv`, and the second + way to reach the same `hatchling` backend was a way for the release build to + drift from the one every other job and every developer runs. + ### Fixed - The GitHub release no longer depends on the PyPI upload succeeding. It was