Skip to content

fix(ci): restore green CI for zfpy post-releases and retired runners - #902

Merged
d-v-b merged 3 commits into
zarr-developers:mainfrom
d-v-b:fix/ci-green
Nov 20, 2026
Merged

d-v-b merged 3 commits into
zarr-developers:mainfrom
d-v-b:fix/ci-green

Conversation

@d-v-b

@d-v-b d-v-b commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

import numcodecs no longer fails when a zfpy post-release such as 1.0.1.post0 is installed. CI now runs on macos-15 and macos-15-intel in place of the retired macos-14 runner, and the i386 tests run in a 32-bit Alpine Docker container instead of through jirutka/setup-alpine.

What was failing and why

The agent found three causes of failure. Together they turn every PR red, as well as the scheduled Wheels run on main.

  1. zfpy 1.0.1.post0 (Importing numcodecs fails with zfpy 1.0.1.post0 installed #892). src/numcodecs/zfpy.py called int() on each version component, so "post0" raised ValueError, and numcodecs/__init__.py only suppresses ImportError. This breaks the tests on every platform that installs zfpy. It also causes the Read the Docs failure (docs/conf.py imports numcodecs) and the codecov/project failure.
  2. The macos-14 runner was retired. Every macos-14 job in ci.yaml and wheel.yaml fails or is cancelled. Open PR ci: macOS 14 runner image is closing down #878 only updates wheel.yaml.
  3. i386 on ubuntu-latest. ubuntu-latest now points to Ubuntu 26.04, which ships sudo-rs. jirutka/setup-alpine runs sudo -E, sudo-rs ignores -E, and the action dies with INPUT_APK_TOOLS_URL: unbound variable (Incompatibility with sudo of the Ubuntu 26.04 image of GitHub-hosted runners jirutka/setup-alpine#39). The workaround suggested there, pinning ubuntu-24.04, only lasts until that image is retired, so this PR drops the action instead.
Changes
  • src/numcodecs/zfpy.py: adds _zfpy_version_supported(), which parses the installed version with packaging.version.Version and compares it to 1.0.1. An unparseable version returns False, so the ZFPY codec is disabled with a warning instead of import numcodecs crashing. The old NumPy version probe is dropped, because numpy>=2.0 is already a hard dependency, so "zfpy >= 1.0.1" was the only real condition.
  • pyproject.toml: adds packaging to the runtime dependencies. It is pure Python and is already pulled in by pytest, setuptools-scm and others. The zfpy extra now requires zfpy>=1.0.1, to match the gate.
  • .github/workflows/ci.yaml and wheel.yaml: macos-14 → macos-15 (arm64), and macos-15-large → macos-15-intel (the standard Intel label), as in ci: macOS 14 runner image is closing down #878, applied to both workflows.
  • .github/workflows/ci-i386.yml and new .github/scripts/test-i386.sh: the job runs docker run --platform linux/386 alpine:3.24 sh .github/scripts/test-i386.sh on ubuntu-latest. An x86_64 kernel runs i386 binaries natively, so this needs no emulation, no sudo and no third-party action. The script keeps the old build steps: the same apk packages, a uv venv, zfpy built from LLNL/zfp source, then numcodecs and pytest. It also runs locally with the same docker run command.
  • .github/workflows/ci.yaml: the three Codecov upload steps now use fail_ci_if_error: ${{ github.repository == 'zarr-developers/numcodecs' }}. Forks have no CODECOV_TOKEN, so on d-v-b/numcodecs every job failed at the upload step even though pytest passed. On upstream, including PRs from forks (where github.repository is the base repository), upload errors still fail the job.
  • tests/test_zfpy_version.py: one parametrized test of _zfpy_version_supported covering release, post-release (the Importing numcodecs fails with zfpy 1.0.1.post0 installed #892 case), pre-release, local, dev, too-old and unparseable versions. It is a separate file because test_zfpy.py skips the whole module when zfpy is not importable, and this test does not need zfpy.
  • docs/release.md: Maintenance and Fixes entries.
Relation to #893 and #878

Closes #892.

This PR supersedes both and builds on their approach. Credit goes to the authors of #893 (packaging.version parsing and the new dependency) and #878 (the macos-15 / macos-15-intel runner labels). Differences:

Verification

The agent ran these checks locally on macOS arm64 with CPython 3.13, numpy 2.5.5, zfpy 1.0.1.post0 and pcodec 1.1.0:

  • It confirmed that the old parsing expression raises ValueError: invalid literal for int() with base 10: 'post0' with zfpy 1.0.1.post0 installed.
  • import numcodecs succeeds, and get_codec({'id': 'zfpy'}) returns a ZFPY codec.
  • pytest: 871 passed, 22 skipped (cupy).
  • pre-commit run --all-files passed with SKIP=mypy; the mypy hook can't build zfpy for the free-threaded interpreter pre-commit picks locally. mypy 1.16.0 was run separately in the 3.13 venv over src and tests: no issues.
  • The i386 container was smoke-tested locally (--platform linux/386 gives an i686 Alpine 3.24 environment). The agent did not run the full build there, because on an arm64 host it runs under emulation; on d-v-b/numcodecs, the Docker job then built zfpy 1.0.1 and numcodecs as i386-linux-musl extensions and passed (735 passed, 27 skipped).

🤖 Generated with Claude Code

- Parse the installed zfpy version with packaging.version, so that
  post-releases such as zfpy 1.0.1.post0 no longer make
  `import numcodecs` raise ValueError (zarr-developersgh-892). Unparseable versions
  disable the ZFPY codec instead of breaking the import. `packaging`
  becomes a runtime dependency, and the zfpy extra now requires
  zfpy>=1.0.1, matching the version gate.
- Replace the retired macos-14 runner with macos-15 and macos-15-large
  with macos-15-intel in the Tests and Wheels workflows, following
  zarr-developersgh-878.
- Pin the i386 job to ubuntu-24.04: setup-alpine relies on `sudo -E`,
  which the sudo-rs in the Ubuntu 26.04 ubuntu-latest image ignores.

Assisted-by: ClaudeCode:claude-opus-5.5
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4afa628) to head (45dbf6e).

Additional details and impacted files
@@             Coverage Diff              @@
##             main      #902       +/-   ##
============================================
+ Coverage   89.71%   100.00%   +10.28%     
============================================
  Files          27        27               
  Lines         914       921        +7     
============================================
+ Hits          820       921      +101     
+ Misses         94         0       -94     
Files with missing lines Coverage Δ
src/numcodecs/zfpy.py 100.00% <100.00%> (+78.72%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Replace jirutka/setup-alpine with `docker run --platform linux/386
alpine:3.24` on ubuntu-latest. The action runs `sudo -E`, which the
sudo-rs in Ubuntu 26.04 ignores, so pinning ubuntu-24.04 only lasted
until that image is retired. An x86_64 kernel runs i386 binaries
natively, so the container needs no emulation, no sudo and no
third-party action. The build steps move into
.github/scripts/test-i386.sh, which also runs locally.

Assisted-by: ClaudeCode:claude-opus-5.5
Forks have no CODECOV_TOKEN, so every Tests job on a fork failed at the
Codecov upload step even when pytest passed. Set fail_ci_if_error only
when github.repository is zarr-developers/numcodecs, which also holds
for pull requests opened against upstream from forks.

Assisted-by: ClaudeCode:claude-opus-5.5
@d-v-b
d-v-b merged commit e190573 into zarr-developers:main Nov 20, 2026
53 checks passed
d-v-b added a commit to d-v-b/numcodecs that referenced this pull request Nov 20, 2026
Take upstream's zfpy version check from zarr-developers#902, which fixes the same
post-release parsing crash, and drop this branch's duplicate fix.

Assisted-by: ClaudeCode:claude-opus-5-5
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.

Importing numcodecs fails with zfpy 1.0.1.post0 installed

1 participant