Repository navigation
Migrate development and CI to uv and remove Upstream checks - #1352
Conversation
Delete the Upstream workflow and its installation script, and remove the README badge and contributor documentation describing the workflow. Fixes sgkit-dev#1351.
Replace requirements files with dependency groups and a committed uv.lock. Use locked environments for standard CI and preserve existing runtime dependency ranges and Python support. Retain the documentation make target and use the shared .venv, with an explicit Dask override for documentation builds. Document local setup and restoration of locked dependencies, plus periodic reviewed lockfile updates. Limit Cubed upgrades to its experimental packages.
62b9776 to
2c28a71
Compare
| "aiohttp", | ||
| "requests", | ||
| "graphviz", | ||
| # Exercise both optional I/O formats with `uv run pytest`. |
There was a problem hiding this comment.
Can these duplicated deps be replaced with sgkit[plink,bgen] ?
|
Thanks @Billyzhang1229, I'm not an expert on uv but this looks great. A couple of minor questions from me:
|
|
Thanks for reviewing my PR! I checked all three points and agree with your suggestions. I also audited the current pyproject.toml and pushed the following changes:
|
|
Thanks @Billyzhang1229! If your happy then hit ready for review. It looks good to me but would be good to get a second opinion for this one. |
|
Thanks, Tim! I’ll mark it ready for review. @jeromekelleher would you mind taking a second look? |
jeromekelleher
left a comment
There was a problem hiding this comment.
This looks great, thanks @Billyzhang1229 ! I'd like to do one more pass of making things more "uv native" so that we don't bake in the old complexity, and we try to make all the different dependency combinations visible within pyproject.toml.
| python -m pip install --pre 'zarr${{ matrix.zarr }}' | ||
| python -m pip uninstall -y bio2zarr # TODO: remove when bio2zarr supports Zarr Python 3 | ||
| uv pip install --python .venv/bin/python --pre 'zarr${{ matrix.zarr }}' | ||
| uv pip uninstall --python .venv/bin/python bio2zarr # TODO: remove when bio2zarr supports Zarr Python 3 |
There was a problem hiding this comment.
bio2zarr supports Zarr v3 now
There was a problem hiding this comment.
You’re right that newer bio2zarr supports Zarr 3, but our locked version still has compatibility issues. Upgrading it involves changes across Zarr, xarray and rechunker, so I’ve restored the workaround; I think these are best addressed together in a broader dependency upgrade.
| uv sync --locked --all-extras --group docs --group lint --no-default-groups --python "${{ matrix.python-version }}" | ||
| # Use newer Dask for task-graph rendering with NumPy 2. | ||
| uv pip uninstall --python .venv/bin/python dask-expr | ||
| uv pip install --python .venv/bin/python 'dask==2026.8.0' |
There was a problem hiding this comment.
Why don't we pin this directly in the docs section of pyproject.toml? We should avoid this manual faffing where at all possible.
There was a problem hiding this comment.
Pinning Dask 2026.8.0 in the docs group conflicts with the core upper bound. It passes the docs build but breaks the Tajima’s D tests. We could fix that and relax the bound; otherwise, the docs environment still needs an explicit override. This is temporary, once we upgrade the core packages we could simply removing these two lines?
| python -m pip install -U git+https://github.com/cubed-dev/cubed.git -U git+https://github.com/cubed-dev/cubed-xarray.git -U git+https://github.com/pydata/xarray.git | ||
| uv sync --locked --all-extras --group test --no-default-groups --python "${{ matrix.python-version }}" | ||
| # Update the experimental packages without upgrading unrelated dependencies. | ||
| uv pip install --python .venv/bin/python \ |
There was a problem hiding this comment.
Likewise here, it would be better to declare an additional "cubed-test" dependency group which extends the tests one that declares these dependencies so that uv can resolve theml.
There was a problem hiding this comment.
same here, uv cannot resolve it because the current Cubed Git version requires zarr>3.1.2, while sgkit requires zarr<3, so we still need an explicit override until those constraints are resolved.
| pip install -r requirements.txt -r requirements-dev.txt -r requirements-doc.txt | ||
| pip install -U dask distributed # need latest versions to successully build docs | ||
| uv sync --locked --all-extras --group docs --no-default-groups --python "3.11" | ||
| # Use newer Dask for task-graph rendering with NumPy 2. |
| python sgkit-copy/.github/scripts/test_sgkit_plink.py | ||
| uv venv --python "${{ matrix.python-version }}" | ||
| uv pip install --python .venv/bin/python --only-binary scipy "${wheel}[bgen,plink]" | ||
| .venv/bin/python sgkit-copy/.github/scripts/test_sgkit.py |
There was a problem hiding this comment.
Wouldn't you use uv run python sgkit-copy/.github/scripts/test_sgkit.py or something?
| ] | ||
| packaging = [ | ||
| "twine", | ||
| ] |
There was a problem hiding this comment.
So, for things like cubed tests do
cubed-tests = [
{ include-group = "test" },
.. cubed deps
]```
|
Thanks, @jeromekelleher ! I’ve But moving the docs and Cubed dependencies into groups, would hit conflicts with the core constraints: Dask 2026.8.0 passes the strict docs build but breaks the Tajima’s D tests, while the current Cubed Git version requires zarr>3.1.2 and sgkit requires zarr<3. Could we keep those temporary overrides in this PR and move them into dependency groups once the compatibility issues are addressed? |
1854d8a to
a32ddff
Compare
a32ddff to
de63ad6
Compare
|
OK, let's merge this so. I think the next thing would be to move to Zarr >=3, and try to resolve some of these awkward dependencies automatically via uv. |
|
In terms of next steps, I've opened two issues which I think will help untangle some of the dependency issues @Billyzhang1229 - it would be great if you could look at those: #1355 and #1360 |
Fixes #1351.
This PR moves development and CI dependency management to uv and removes the Upstream dependency checks. These changes are split into two commits.
Changes included:
pyproject.tomland a committeduv.lock.test,docs,lint, andpackaginggroups, with an aggregatedevgroup for local development.uv syncanduv run.cd docs && make htmlusing the shared.venv. Docs workflows installdask==2026.8.0for task-graph rendering with NumPy 2, and the Makefile usesuv run --no-syncto preserve that override. Document local setup and restoring locked dependencies before testing.Existing runtime dependency ranges, optional extras, and Python support are preserved.
Left for follow-up PRs:
tajimas_Dissue.Validation: local tests passed with 100% coverage; strict documentation builds and package smoke tests passed. Build, Windows, Check docs, and Cubed CI passed. The upstream-only Wheels workflow and GPU workflow were not exercised.