Skip to content

Commit abd7d0f

Browse files
authored
ci: decouple upstream dev-version testing from the pixi workspace (#997)
* ci: decouple upstream dev-version testing from the pixi workspace Move the 11 `git+https://…` dev-version sources out of pyproject.toml's `[dependency-groups].upstream` and into a standalone `ci/upstream-overrides.txt`. The Upstream CI job pip-overlays them on top of the regular `upstream` pixi env via `--no-deps --upgrade`. Why: pixi solves a single workspace-wide lockfile covering every defined environment. With git+https sources present, every solve (docs, minimum-versions, etc.) had to build a wheel for each git source for metadata extraction, and on memory-constrained CI runners these parallel builds intermittently SIGSEGV'd or hit ETXTBSY races — blocking docs and other unrelated environments. Keeping git sources out of pyproject keeps every other env's solve trivial. See #995. * ci: wrap the upstream overlay command in a pixi task
1 parent e213350 commit abd7d0f

4 files changed

Lines changed: 55 additions & 17 deletions

File tree

.github/workflows/upstream.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ jobs:
3838
pixi-version: v0.59.0
3939
environments: upstream
4040

41-
- name: List installed libraries
41+
- name: Install pixi upstream environment
4242
run: |
4343
pixi install --environment upstream
44+
45+
- name: Overlay dev versions of upstream libraries
46+
# See ci/upstream-overrides.txt for why these aren't in pyproject.toml.
47+
run: |
48+
pixi run -e upstream install-upstream-overrides
49+
50+
- name: List installed libraries
51+
run: |
4452
pixi list --environment upstream
4553
4654
- name: Cache tutorial data

ci/upstream-overrides.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Dev versions of upstream libraries used by the `Upstream` CI job to test
2+
# VirtualiZarr against bleeding-edge releases of its dependencies.
3+
#
4+
# Installed via `pip install --upgrade --no-deps -r ci/upstream-overrides.txt`
5+
# on top of an already-resolved pixi `upstream` env, so pip only swaps the
6+
# named packages and does not re-resolve the dependency graph.
7+
#
8+
# These deliberately do NOT live in pyproject.toml: keeping git+https sources
9+
# out of the pixi workspace prevents every other env's lockfile solve (docs,
10+
# minimum-versions, etc.) from having to build them. See issue #995.
11+
xarray @ git+https://github.com/pydata/xarray
12+
universal_pathlib @ git+https://github.com/fsspec/universal_pathlib
13+
numcodecs @ git+https://github.com/zarr-developers/numcodecs
14+
ujson @ git+https://github.com/ultrajson/ultrajson
15+
zarr @ git+https://github.com/zarr-developers/zarr-python
16+
obspec_utils @ git+https://github.com/virtual-zarr/obspec-utils
17+
astropy @ git+https://github.com/astropy/astropy
18+
s3fs @ git+https://github.com/fsspec/s3fs
19+
kerchunk @ git+https://github.com/fsspec/kerchunk
20+
icechunk @ git+https://github.com/earth-mover/icechunk#subdirectory=icechunk-python
21+
virtual_tiff @ git+https://github.com/virtual-zarr/virtual-tiff

docs/contributing.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,19 @@ You can also run tests in other environments:
2323

2424
```bash
2525
pixi run --environment min-deps run-tests # Test with the minimal set of dependencies installed
26-
pixi run --environment upstream run-tests # Test with unreleased versions of upstream libraries
2726
# List which versions are installed in the `min-deps` environment
2827
pixi list --environment min-deps
2928
```
3029

30+
To test against unreleased dev versions of upstream libraries (xarray, zarr, numcodecs, etc.),
31+
install the regular `upstream` env and then pip-overlay the dev versions on top:
32+
33+
```bash
34+
pixi install --environment upstream
35+
pixi run -e upstream install-upstream-overrides
36+
pixi run --environment upstream run-tests
37+
```
38+
3139
Further, the `pytest-cov` plugin is a test dependency, so you can generate a test
3240
coverage report locally, if you wish (CI will automatically do so). Here are some
3341
examples:

pyproject.toml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,13 @@ all_writers = [
9696

9797
# Dependency sets under dependencies-groups are NOT available via PyPI
9898
[dependency-groups]
99-
upstream = [
100-
'xarray @ git+https://github.com/pydata/xarray',
101-
'universal_pathlib @ git+https://github.com/fsspec/universal_pathlib',
102-
'numcodecs @ git+https://github.com/zarr-developers/numcodecs',
103-
'ujson @ git+https://github.com/ultrajson/ultrajson',
104-
'zarr @ git+https://github.com/zarr-developers/zarr-python',
105-
'obspec_utils @ git+https://github.com/virtual-zarr/obspec-utils',
106-
# optional dependencies
107-
'astropy @ git+https://github.com/astropy/astropy',
108-
's3fs @ git+https://github.com/fsspec/s3fs',
109-
'kerchunk @ git+https://github.com/fsspec/kerchunk',
110-
'icechunk @ git+https://github.com/earth-mover/icechunk#subdirectory=icechunk-python',
111-
'virtual_tiff @ git+https://github.com/virtual-zarr/virtual-tiff',
112-
]
99+
# Dev versions of upstream libraries are NOT defined here as a dependency-group.
100+
# Including git+https sources in a pixi-managed pyproject.toml forces every
101+
# `pixi install` (including the docs and minimum-versions envs) to perform a
102+
# fresh wheel build of each git source as part of the workspace-wide lockfile
103+
# solve, which is unreliable on memory-constrained CI runners. The upstream
104+
# canary job instead pip-overlays dev versions from ci/upstream-overrides.txt
105+
# on top of the regular `upstream` pixi env. See issue #995.
113106
docs = [
114107
"mkdocs-material[imaging]>=9.6.14",
115108
"mkdocs>=1.6.1",
@@ -182,6 +175,14 @@ h5netcdf = ">=1.5.0,<2"
182175
[tool.pixi.feature.icechunk-dev.dependencies]
183176
rust = "*"
184177

178+
# `pip` is needed by the Upstream CI job to overlay dev versions from
179+
# ci/upstream-overrides.txt on top of the pixi-resolved env. See issue #995.
180+
[tool.pixi.feature.upstream-overlay.dependencies]
181+
pip = "*"
182+
183+
[tool.pixi.feature.upstream-overlay.tasks]
184+
install-upstream-overrides = { cmd = "pip install --upgrade --no-deps -r ci/upstream-overrides.txt" }
185+
185186
[tool.pixi.feature.minimum-versions.dependencies]
186187
xarray = "==2025.6.0"
187188
numpy = "==2.1.0"
@@ -213,7 +214,7 @@ test-py313 = ["dev", "test", "remote", "hdf", "netcdf3", "fits", "icechunk", "ke
213214
test-py314 = ["dev", "test", "remote", "hdf", "netcdf3", "fits", "icechunk", "kerchunk", "kerchunk_parquet", "hdf5-lib", "zarr", "py314"] # test against python 3.14
214215
minio = ["dev", "remote", "hdf", "netcdf3", "fits", "icechunk", "kerchunk", "hdf5-lib", "py314", "zarr", "minio"]
215216
minimum-versions = ["dev", "test", "remote", "hdf", "netcdf3", "fits", "icechunk", "kerchunk", "kerchunk_parquet", "hdf5-lib", "tiff", "zarr","minimum-versions", "py312"]
216-
upstream = ["dev", "test", "hdf", "hdf5-lib", "netcdf3", "upstream", "icechunk-dev", "zarr", "py313"]
217+
upstream = ["dev", "test", "hdf", "hdf5-lib", "netcdf3", "icechunk-dev", "upstream-overlay", "zarr", "py313"]
217218
all = ["dev", "test", "remote", "hdf", "netcdf3", "fits", "icechunk", "kerchunk", "kerchunk_parquet", "hdf5-lib", "tiff", "zarr", "all_parsers", "all_writers", "py313"]
218219
docs = ["docs", "dev", "remote", "hdf", "netcdf3", "fits", "icechunk", "kerchunk", "kerchunk_parquet", "hdf5-lib", "tiff","zarr", "py313"]
219220

0 commit comments

Comments
 (0)