Repository navigation
Conversation
Each example's PEP 723 header defines its environment, so running tests/test_examples.py in every pytest matrix job repeated the same work. Its header-rewriting helper also depended on the test environment's packaging and tomlkit, which broke the min_deps job on Python 3.12.3. A new `just examples` recipe uses `uv add --script` to point each header at the local checkout, and one CI job runs it. `uv add` resolves the header, and that showed two examples declaring requires-python >=3.11 although zarr requires 3.12. Those headers now say >=3.12. tomlkit was only used by the removed test, so it is dropped from the test dependency group. Assisted-by: ClaudeCode:claude-opus-5-5
The previous commit ran the examples from a bash loop, which stops at the first failing script, so one broken example hid the others. The examples now run from tests/test_examples.py again, one test per script. The tests are marked `examples` and skipped unless pytest gets --run-examples, as slow_hypothesis tests are with --run-slow-hypothesis, so the matrix jobs skip them. `just examples` passes the option, and the CI job runs it in the test.py3.13-minimal hatch environment. Assisted-by: ClaudeCode:claude-opus-5-5
`just examples` could mean listing or building the examples. `test-examples` says what the recipe does, and follows the `<group>-<variant>` naming of recipes like `coverage-html` and `docs-build`. Assisted-by: ClaudeCode:claude-opus-5-5
Owner
Author
|
🤖 AI text below 🤖 Superseded by zarr-developers#4586, which merged this branch upstream. |
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.
🤖 AI text below 🤖
Example scripts now run once, in a new
Example scriptsCI job, instead of in every pytest matrix job.tests/test_examples.pyusesuv add --scriptto point each script's PEP 723 header at the local checkout, and runs the script withuv run.Why
tomlkitandpackaging, which run in the test environment. In zarr-python PR 4544 this broke themin_depsjob: withpackaging==22.*on Python 3.12.3, the URLzarr @ file:////home/...(four slashes) is rejected as invalid.uv addresolves the header. That showed thatsharding_coalescing.pyandcodec_pipeline_performance.pydeclaredrequires-python = ">=3.11", although zarr requires 3.12. Both headers now say>=3.12.Changes
tests/test_examples.py: one test per example, markedexamples. The test copies the script, runsuv add --script <copy> <checkout>, then runsuv run --reinstall-package zarr <copy>. The regex,tomlkitandpackagingcode is gone. The checkout path now comes from__file__instead of the working directory. The Windows skip is removed, because no Windows job runs these tests.tests/conftest.py: new--run-examplesoption. Tests markedexamplesare skipped without it, in the same way thatslow_hypothesistests are skipped without--run-slow-hypothesis. The matrix jobs therefore skip them without any change to their commands.pyproject.toml: registers theexamplesmarker, and removestomlkitfrom thetestdependency group, which had no other users.uvstays, becausetests/test_regression/test_v2_dtype_regression.pyuses it.Justfile: newtest-examplesrecipe, which runspytest --run-examples tests/test_examples.py..github/workflows/test.yml: newexamplesjob, which runsjust test-examplesin thetest.py3.13-minimalhatch environment. It is added totest-complete.examples/README.md: says that an example needs a PEP 723 header, and how examples are run.Testing
HATCH_ENV=test.py3.13-minimal just test-examplespasses locally: the path check and all three examples.--run-examples, the three example tests are skipped.slow_hypothesistests are still skipped without--run-slow-hypothesis.>=3.11header), both tests fail with their own message, and the third example still runs.prek run --all-filespasses.Notes
Justfile. The second commit replaces it with pytest, because the loop stopped at the first failing example and hid the others.ci/big-endian/Dockerfilestill installspython3-tomlkit. The big-endian job does not run this test, so the package is unused there. The agent left the image unchanged because it could not build the s390x image locally.🤖 Generated with Claude Code