Repository navigation
Skip test_pyzstd when pyzstd cannot be imported - #845
Merged
Merged
Conversation
On i386 (Alpine, Python 3.14), pyzstd 0.17+ delegates to the stdlib compression.zstd module, which requires the _zstd C extension that is not built on that platform. The hard top-level `import pyzstd` turned this into a collection error, failing the entire test run. Guard the import with pytest.importorskip so the module is skipped instead of erroring when pyzstd is unavailable. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #845 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 901 901
=========================================
Hits 901 901 🚀 New features to boost your workflow:
|
4 tasks done
d-v-b
added a commit
to d-v-b/numcodecs
that referenced
this pull request
Oct 5, 2026
On Python 3.14, pyzstd imports the standard library's compression.zstd, which needs the _zstd extension module. Alpine's i386 Python does not ship it, so importing pyzstd raised ModuleNotFoundError and aborted test collection. Use pytest.importorskip, as main does (zarr-developers#845). Assisted-by: ClaudeCode:claude-fable-5.1
d-v-b
added a commit
that referenced
this pull request
Oct 20, 2026
* test(checksum32): wrap parametrize itertools.product in tuple pytest 9 raises PytestRemovedIn10Warning for non-Collection iterables passed to parametrize, which becomes an error under filterwarnings=error and aborts test collection. Same change as 15803df on backport-0.15-zstd-fixes. Assisted-by: ClaudeCode:claude-fable-5.1 * ci: stop testing the 0.16.x line against zarr-python main zarr-python main now requires Python >=3.12, while this line supports Python >=3.11. uv resolves all dependency groups together, so the test-zarr-main group made every uv invocation fail with an unsatisfiable resolution (seen in the i386 workflow). A maintenance line does not need to track zarr-python main, so remove the group, its pixi tasks, and its CI matrix entry. Assisted-by: ClaudeCode:claude-fable-5.1 * ci: replace the macos-13 runner with macos-15-large macos-13 runners are no longer available. macos-15-large is still an Intel runner, so x86 coverage is preserved. macOS 15's dyld rejects the duplicate LC_RPATH entries that the conda-forge compilers produce, so add the same deduplication step used on backport-0.15-zstd-fixes (64eade5, 7ae0f4b). Assisted-by: ClaudeCode:claude-fable-5.1 * ci(docs): build on ubuntu-24.04 on Read the Docs Read the Docs removed the ubuntu-20.04 build image. Assisted-by: ClaudeCode:claude-fable-5.1 * ci: stop pinning clang below 17 on the Intel macOS runner The pin downgraded the conda-forge compiler to clang 14, which cannot parse the macOS 15 SDK headers on macos-15-large (math.h: '_Float16 is not supported on this target'), so every extension build failed. Use the clang that the conda-forge c-compiler package installs instead. Assisted-by: ClaudeCode:claude-fable-5.1 * ci(i386): install zfpy with uv pip instead of uv add zfp's pyproject.toml has no [project] table, so 'uv add "zfpy @ ./zfp"' fails with 'No project table found'. Install the locally built zfpy into the environment with 'uv pip install ./zfp', as main does. Because zfpy is no longer recorded in pyproject.toml, keep the same virtual environment for the numcodecs install and run pytest with --no-sync so uv does not re-resolve the environment. Assisted-by: ClaudeCode:claude-fable-5.1 * ci(i386): stop installing pcodec in the i386 job This workflow has no matrix, so the python-version conditional always took the branch that installs pcodec. pcodec has no i386 wheel and its source build produces a wheel tagged linux_x86_64, which uv refuses to install in the i386 Alpine environment. Install without pcodec, as main does; the pcodec tests are skipped when it is missing. Assisted-by: ClaudeCode:claude-fable-5.1 * test(pyzstd): skip test_pyzstd when pyzstd cannot be imported On Python 3.14, pyzstd imports the standard library's compression.zstd, which needs the _zstd extension module. Alpine's i386 Python does not ship it, so importing pyzstd raised ModuleNotFoundError and aborted test collection. Use pytest.importorskip, as main does (#845). Assisted-by: ClaudeCode:claude-fable-5.1 * ci(codecov): compare project coverage against the base commit codecov/project has failed on every recent commit of this line, including the 0.16.5 release, at 98.68% against a 100% target. The uncovered lines are in numcodecs/zarr3.py and the crc32c fallback paths, which the coverage-uploading jobs do not exercise. Set the project target to auto so the check fails only when a change lowers coverage. The patch target stays at 100%. Assisted-by: ClaudeCode:claude-fable-5.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On i386 (Alpine, Python 3.14), pyzstd 0.17+ delegates to the stdlib
compression.zstd module, which requires the _zstd C extension that is
not built on that platform. The hard top-level
import pyzstdturnedthis into a collection error, failing the entire test run.
Guard the import with pytest.importorskip so the module is skipped
instead of erroring when pyzstd is unavailable.
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
[Description of PR]
TODO: