Repository navigation
Adapt tests that use zarr to work on zarr < 3 and zarr > 3.2.0 - #8943
Conversation
"zarr_version" (zarr 3.2.0)
|
OK, so zarr > 3 requires python > 3.10, hence the test failure in the initial 3.10 test, so reconciling this will be a nuisance 😔 |
|
Instead of reconciling perhaps we skip these on 3.10? Path of least resistance given its just tests and the py3.10 zarr pin prevents grabbing anything that would break them anyways We could also just drop 3.10 😜 |
|
Maybe just have two copies of tests and run them depending on zarr version? What is compatibility of zarr 2.0 vs 3.0? Are there plugins depending on zarr 2.0? |
|
As we just made a change and use auto-milestone on merge, I remove the milestone from this PR. |
|
@psobolewskiPhD What did you think about my proposition? |
|
I don't know. I don't have any answers for you. |
We will not drop python 3.10 before 0.7.1 it is too big change for assumed release date. So what you suggest. Should I make my own PR? |
Push here or make a PR and we can move them through quickly. |
|
@Czaki what do you think of the solution i just pushed? works for me locally and it's simple enough I think with the docstring/comments? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8943 +/- ##
==========================================
+ Coverage 93.43% 93.44% +0.01%
==========================================
Files 706 706
Lines 65227 65233 +6
==========================================
+ Hits 60942 60955 +13
+ Misses 4285 4278 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| `create_array` is not part of zarr < 3 API. | ||
| Once napari drops py310, this can be removed in favor of just `create_array`. | ||
| """ | ||
| if hasattr(group, 'create_array'): |
There was a problem hiding this comment.
I usually prefer to check package version, but this excellent doc string should be enough to spot what code need to be updated.
create_array instead create_dataset in test for zarr 3+
|
@psobolewskiPhD I tried to update title, but maybe you will have better idea. It will be nice to update description too. |
create_array instead create_dataset in test for zarr 3+
brisvag
left a comment
There was a problem hiding this comment.
LGTM, this is pretty minimal and does not block releases and lets us take our time with dropping py310.
References and relevant issues
Closes: #8938
Description
In zarr 3.2.0 some things from zarr < 3 that were deprecated have been removed affecting the way we create test data. See:
zarr-developers/zarr-python#3901
and
zarr-developers/zarr-python#3902
In this PR I implement checks whether using zarr > 3 or not and based on that use the correct argument and method, because zarr 3.0.0 dropped support for py310 that we still test napari on.
Note: These changes are for the arrays we create in tests, not reading itself.
Once we drop py310 support we can switch to just the zarr > 3 API.