Skip to content

Commit 2c40977

Browse files
committed
test: use davis branch
run plz run for real use true dev xarray get versions right for wacky dev version something
1 parent 52677e1 commit 2c40977

File tree

5 files changed

+64
-55
lines changed

5 files changed

+64
-55
lines changed

.github/workflows/upstream-dev-ci.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,8 @@ jobs:
3939
upstream-dev:
4040
name: upstream-dev
4141
runs-on: ubuntu-latest
42-
needs: detect-ci-trigger
4342
env:
4443
ZARR_V3_EXPERIMENTAL_API: 1
45-
if: |
46-
always()
47-
&& (
48-
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
49-
|| needs.detect-ci-trigger.outputs.triggered == 'true'
50-
|| contains( github.event.pull_request.labels.*.name, 'run-upstream')
51-
)
5244
defaults:
5345
run:
5446
shell: bash -l {0}
@@ -73,7 +65,7 @@ jobs:
7365
bash ci/install-upstream-wheels.sh
7466
- name: Install xarray
7567
run: |
76-
python -m pip install --no-deps -e .
68+
python -m pip install git+https://github.com/pydata/xarray
7769
- name: Version info
7870
run: |
7971
python xarray/util/print_versions.py

ci/install-upstream-wheels.sh

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22

33
if which micromamba >/dev/null; then
4-
conda=micromamba
4+
conda=micromamba
55
elif which mamba >/dev/null; then
6-
conda=mamba
6+
conda=mamba
77
else
8-
conda=conda
8+
conda=conda
99
fi
1010

1111
# temporarily (?) remove numbagg and numba
@@ -14,53 +14,53 @@ $conda remove -y numba numbagg sparse
1414
$conda remove -y numexpr
1515
# forcibly remove packages to avoid artifacts
1616
$conda remove -y --force \
17-
numpy \
18-
scipy \
19-
pandas \
20-
distributed \
21-
fsspec \
22-
zarr \
23-
cftime \
24-
packaging \
25-
bottleneck \
26-
flox
27-
# pint
17+
numpy \
18+
scipy \
19+
pandas \
20+
distributed \
21+
fsspec \
22+
zarr \
23+
cftime \
24+
packaging \
25+
bottleneck \
26+
flox
27+
# pint
2828

2929
# to limit the runtime of Upstream CI
3030
python -m pip install \
31-
-i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
32-
--no-deps \
33-
--pre \
34-
--upgrade \
35-
numpy \
36-
scipy \
37-
matplotlib \
38-
pandas
31+
-i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
32+
--no-deps \
33+
--pre \
34+
--upgrade \
35+
numpy \
36+
scipy \
37+
matplotlib \
38+
pandas
3939
# for some reason pandas depends on pyarrow already.
4040
# Remove once a `pyarrow` version compiled with `numpy>=2.0` is on `conda-forge`
4141
python -m pip install \
42-
-i https://pypi.fury.io/arrow-nightlies/ \
43-
--prefer-binary \
44-
--no-deps \
45-
--pre \
46-
--upgrade \
47-
pyarrow
42+
-i https://pypi.fury.io/arrow-nightlies/ \
43+
--prefer-binary \
44+
--no-deps \
45+
--pre \
46+
--upgrade \
47+
pyarrow
4848
# manually install `pint`, `donfig`, and `crc32c` to pull in new dependencies
4949
python -m pip install --upgrade pint donfig crc32c
5050
python -m pip install \
51-
--no-deps \
52-
--upgrade \
53-
git+https://github.com/dask/dask \
54-
git+https://github.com/dask/dask-expr \
55-
git+https://github.com/dask/distributed \
56-
git+https://github.com/zarr-developers/zarr-python \
57-
git+https://github.com/Unidata/cftime \
58-
git+https://github.com/pypa/packaging \
59-
git+https://github.com/hgrecco/pint \
60-
git+https://github.com/pydata/bottleneck \
61-
git+https://github.com/intake/filesystem_spec \
62-
git+https://github.com/SciTools/nc-time-axis \
63-
git+https://github.com/xarray-contrib/flox \
64-
git+https://github.com/h5netcdf/h5netcdf \
65-
git+https://github.com/dgasmith/opt_einsum
66-
# git+https://github.com/pydata/sparse
51+
--no-deps \
52+
--upgrade \
53+
git+https://github.com/dask/dask \
54+
git+https://github.com/dask/dask-expr \
55+
git+https://github.com/dask/distributed \
56+
git+https://github.com/d-v-b/zarr-python.git@feat/fixed-length-strings \
57+
git+https://github.com/Unidata/cftime \
58+
git+https://github.com/pypa/packaging \
59+
git+https://github.com/hgrecco/pint \
60+
git+https://github.com/pydata/bottleneck \
61+
git+https://github.com/intake/filesystem_spec \
62+
git+https://github.com/SciTools/nc-time-axis \
63+
git+https://github.com/xarray-contrib/flox \
64+
git+https://github.com/h5netcdf/h5netcdf \
65+
git+https://github.com/dgasmith/opt_einsum
66+
# git+https://github.com/pydata/sparse

xarray/backends/zarr.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ def _choose_default_mode(
106106

107107

108108
def _zarr_v3() -> bool:
109-
return module_available("zarr", minversion="3")
109+
# hack for this test only
110+
# version being pickd up as 3.0.0b which is apparently not greater than 3
111+
# return True
112+
return module_available("zarr", minversion="3.0.0a0")
110113

111114

112115
# need some special secret attributes to tell us the dimensions
@@ -1067,6 +1070,10 @@ def _create_new_array(
10671070
if c in encoding:
10681071
encoding["config"][c] = encoding.pop(c)
10691072

1073+
print(fill_value)
1074+
print(encoding)
1075+
print(dtype)
1076+
print(shape)
10701077
zarr_array = self.zarr_group.create(
10711078
name,
10721079
shape=shape,

xarray/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _importorskip(
129129
has_bottleneck, requires_bottleneck = _importorskip("bottleneck")
130130
has_rasterio, requires_rasterio = _importorskip("rasterio")
131131
has_zarr, requires_zarr = _importorskip("zarr")
132-
has_zarr_v3, requires_zarr_v3 = _importorskip("zarr", "3.0.0")
132+
has_zarr_v3, requires_zarr_v3 = _importorskip("zarr", "3.0.0a01")
133133
has_fsspec, requires_fsspec = _importorskip("fsspec")
134134
has_iris, requires_iris = _importorskip("iris")
135135
has_numbagg, requires_numbagg = _importorskip("numbagg")

xarray/tests/test_backends.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ def create_store(self):
369369
def roundtrip(
370370
self, data, save_kwargs=None, open_kwargs=None, allow_cleanup_failure=False
371371
):
372+
print(save_kwargs)
373+
print(open_kwargs)
372374
if save_kwargs is None:
373375
save_kwargs = {}
374376
if open_kwargs is None:
@@ -926,6 +928,9 @@ def test_roundtrip_bytes_with_fill_value(self) -> None:
926928
encoding = {"_FillValue": b"X", "dtype": "S1"}
927929
original = Dataset({"x": ("t", values, {}, encoding)})
928930
expected = original.copy(deep=True)
931+
zarr_format_3 = has_zarr_v3 and zarr.config.config["default_zarr_format"] == 3
932+
print(zarr_format_3)
933+
print(self.version_kwargs)
929934
with self.roundtrip(original) as actual:
930935
assert_identical(expected, actual)
931936

@@ -2363,6 +2368,7 @@ def create_store(self, cache_members: bool = False):
23632368
)
23642369

23652370
def save(self, dataset, store_target, **kwargs): # type: ignore[override]
2371+
print("ver kwargs", self.version_kwargs)
23662372
return dataset.to_zarr(store=store_target, **kwargs, **self.version_kwargs)
23672373

23682374
@contextlib.contextmanager
@@ -3832,6 +3838,10 @@ def roundtrip_dir(
38323838
if open_kwargs is None:
38333839
open_kwargs = {}
38343840

3841+
print("here?")
3842+
print(save_kwargs)
3843+
print(self.version_kwargs)
3844+
print(open_kwargs)
38353845
data.to_zarr(store, **save_kwargs, **self.version_kwargs)
38363846
with xr.open_dataset(
38373847
store, engine="zarr", **open_kwargs, **self.version_kwargs

0 commit comments

Comments
 (0)