Skip to content

release.yml and ci.yml: build once, check and install the wheel before publishing - #105

Merged
yannrichet merged 3 commits into
mainfrom
claude/release-workflow-matrix
Nov 6, 2026
Merged

yannrichet merged 3 commits into
mainfrom
claude/release-workflow-matrix

Conversation

@yannrichet

@yannrichet yannrichet commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Description

fz is pure Python: one build produces the single funz_fz-<v>-py3-none-any.whl. Yet:

  • release.yml built 16 identical wheels on an OS × Python matrix that excluded 3.14 on Windows and macOS, even though ci.yml tests those, and it published without ever installing a built wheel;
  • ci.yml built the same wheel on 3 OSes and the sdist in a separate job, and never installed either.

This PR builds once, checks the distributions with a shared script, and installs the wheel outside the checkout: on the ci.yml OS × Python matrix before publishing (release.yml), and in a fresh venv on every push and pull request (ci.yml).

Originally stacked on #103; retargeted to main after #103 and #104 were merged, and main merged into the branch (24b16eb).

Related Issues

Fixes #102

Type of Change

  • Code refactoring (release and CI workflows)
  • Test addition/modification
  • Documentation update (NEWS, CLAUDE.md, scripts/README.md)

Changes Made

  • scripts/check_dist.py (new, shared by both workflows):
    • exactly one wheel, pure Python (py3-none-any), and exactly one sdist;
    • twine check --strict on both;
    • with --tag, the release tag (a leading v is allowed) must equal the built version, fz.__version__;
    • written in Python because .gitignore ignores *.sh.
  • release.yml:
    • build (ubuntu, 3.11) replaces build-wheels (16 jobs) and build-sdist: stamp_version.py, python -m build, check_dist.py --tag <release tag>, one dist artifact.
    • verify (needs build): same matrix as ci.yml (Linux/macOS/Windows × 3.9–3.14, Windows 3.9 excluded). It runs pip install dist/*.whl with no source checkout, then a smoke test:
      • fz --version must print fz <version>;
      • import fz, fz.runners, fzi, fzc;
      • fzr with sh://bash run.sh on 2 cases, except on Windows: bash comes from MSYS2 there, which only ci.yml installs, and fzr on Windows stays covered by ci.yml.
    • publish-to-pypi and publish-to-github now need [build, verify]; their if: release published condition is unchanged.
  • ci.yml:
    • build-wheels (3 jobs) and build-sdist are replaced by one build job, named "Build and check distributions" (ubuntu, needs test): python -m build, check_dist.py, then the wheel is installed in a fresh venv outside the checkout (fz --version, import fz, fz.runners).
    • This catches a module or package data missing from the wheel, which the editable install of the test job cannot see.
  • tests/test_check_dist.py (7 tests): the rejection cases always run (platform wheel, missing sdist, two wheels); the real-build cases are skipped when build or twine are not installed.
  • NEWS (2.0 "Release tooling" section), CLAUDE.md, scripts/README.md.

Testing Performed

Additional Notes

  • Required checks: if main branch protection requires the old check names ("Build wheels on …", "Build source distribution"), they no longer exist. Replace them with "Build and check distributions" in the repository settings.
  • softprops/action-gh-release@v1 and the actions/*@v4/v5 actions are unchanged (Node 20 deprecation warning); they can be updated in a separate PR.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01RjXvVRjM6aMvKvvSFoxpZ6

…lishing (#102)

fz is pure Python, yet release.yml built 16 identical py3-none-any wheels
on an OS x Python matrix (excluding 3.14 on Windows/macOS, which ci.yml
tests) and published without installing any of them.

- build (ubuntu, Python 3.11): stamp fz/_version.py, python -m build
  (wheel + sdist), twine check --strict, exactly one py3-none-any wheel,
  release tag (leading "v" stripped) equal to the built version.
- verify (needs build): same OS x Python matrix as ci.yml; installs that
  wheel and runs a smoke test: fz --version, fzi/fzc, and fzr with
  sh:// except on Windows (bash is MSYS2 there, set up only in ci.yml).
- publish-to-pypi / publish-to-github need [build, verify] and download
  the single "dist" artifact.
- NEWS (2.0 release tooling) and CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjXvVRjM6aMvKvvSFoxpZ6
…k_dist.py (#102)

ci.yml built the same py3-none-any wheel on 3 OSes and the sdist in a
separate job, and never installed either.

- ci.yml: build-wheels (3 jobs) + build-sdist -> one "build" job (ubuntu,
  needs test): python -m build, scripts/check_dist.py, then the wheel is
  installed in a fresh venv outside the checkout (fz --version, import fz,
  fz.runners), catching modules or package data missing from the wheel,
  which the editable install of the test job cannot see. Single "dist"
  artifact.
- scripts/check_dist.py: one wheel, pure Python (py3-none-any), one sdist,
  twine check --strict, optional --tag equal to the built version. Used by
  ci.yml and release.yml (replaces the inline shell check there).
  (Python rather than .sh: .gitignore ignores *.sh.)
- tests/test_check_dist.py: rejection cases always run; the real-build
  cases skip when build/twine are not installed.
- NEWS, scripts/README.md, CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjXvVRjM6aMvKvvSFoxpZ6
@yannrichet
yannrichet changed the base branch from claude/version-1-3-opportunity-68uuh8 to main November 6, 2026 14:05

Copy link
Copy Markdown
Member Author

CLI Integration Tests on windows-latest failed on 24b16eb before any test ran. Its MSYS2 setup step could not download bash, grep, sed, gawk and coreutils: every mirror returned an error (HTTP 416, timeouts, expired certificates; error: failed to commit transaction (failed to retrieve some files)). The failure comes from those package mirrors, not from this PR, which does not touch cli-tests.yml and passes the same job on Ubuntu and macOS. The failed job was re-run once.


Generated by Claude Code

@yannrichet yannrichet changed the title release.yml: build once, verify the wheel on the CI matrix before publishing release.yml and ci.yml: build once, check and install the wheel before publishing Nov 6, 2026
@yannrichet
yannrichet merged commit ec97161 into main Nov 6, 2026
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release.yml: build matrix redundant for a pure-Python wheel and inconsistent with CI's Python 3.14 support

2 participants