Skip to content

Migrate development and CI to uv and remove Upstream checks - #1352

Merged
jeromekelleher merged 13 commits into
sgkit-dev:mainfrom
Billyzhang1229:uv-upgrade
Oct 15, 2026
Merged

jeromekelleher merged 13 commits into
sgkit-dev:mainfrom
Billyzhang1229:uv-upgrade

Conversation

@Billyzhang1229

@Billyzhang1229 Billyzhang1229 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Remove the Upstream workflow, its installation script, the README badge, and related contributor documentation.
  • Replace the requirements files with dependency groups in pyproject.toml and a committed uv.lock.
  • Provide test, docs, lint, and packaging groups, with an aggregate dev group for local development.
  • Update contributor instructions to use uv sync and uv run.
  • Use locked dependencies in standard CI, including scheduled runs, and document periodic, reviewed lockfile updates.
  • Keep cd docs && make html using the shared .venv. Docs workflows install dask==2026.8.0 for task-graph rendering with NumPy 2, and the Makefile uses uv run --no-sync to preserve that override. Document local setup and restoring locked dependencies before testing.
  • Migrate package builds and wheel installation checks to uv.
  • Retain Cubed and Zarr compatibility testing. Limit Cubed upgrades to the experimental packages and any necessary dependency changes.

Existing runtime dependency ranges, optional extras, and Python support are preserved.

Left for follow-up PRs:

  • Runtime dependency upgrades and relaxed version bounds, including newer Dask, xarray, numba and SciPy versions.
  • Address any compatibility changes those upgrades require, including a previously identified tajimas_D issue.
  • Remove the temporary documentation Dask override once a common version passes both tests and documentation builds.
  • Upgrading the bio2zarr/Zarr stack and broader Zarr 3 support.
  • Revisit the disabled GPU workflow.

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.

Delete the Upstream workflow and its installation script, and remove
the README badge and contributor documentation describing the workflow.

Fixes sgkit-dev#1351.
@Billyzhang1229 Billyzhang1229 changed the title Uv upgrade Migrate development and CI to uv and remove Upstream checks Sep 27, 2026
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.
Comment thread pyproject.toml Outdated
"aiohttp",
"requests",
"graphviz",
# Exercise both optional I/O formats with `uv run pytest`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these duplicated deps be replaced with sgkit[plink,bgen] ?

@timothymillar

Copy link
Copy Markdown
Member

Thanks @Billyzhang1229, I'm not an expert on uv but this looks great. A couple of minor questions from me:

  • I think sgkit/_version.py needs to be added to .gitignore
  • We can probably remove setuptools from the core dependencies with this PR?

@Billyzhang1229

Copy link
Copy Markdown
Contributor Author

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:

@timothymillar

Copy link
Copy Markdown
Member

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.

@Billyzhang1229
Billyzhang1229 marked this pull request as ready for review October 14, 2026 12:11
@Billyzhang1229

Copy link
Copy Markdown
Contributor Author

Thanks, Tim! I’ll mark it ready for review. @jeromekelleher would you mind taking a second look?

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/build.yml Outdated
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bio2zarr supports Zarr v3 now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/check-docs.yml Outdated
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'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we pin this directly in the docs section of pyproject.toml? We should avoid this manual faffing where at all possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread .github/workflows/cubed.yml Outdated
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 \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same point as above.

Comment thread .github/workflows/wheels.yml Outdated
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't you use uv run python sgkit-copy/.github/scripts/test_sgkit.py or something?

Comment thread pyproject.toml
]
packaging = [
"twine",
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, for things like cubed tests do

cubed-tests = [
    { include-group = "test" },
    .. cubed deps
]```

@Billyzhang1229

Billyzhang1229 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, @jeromekelleher ! I’ve removed the bio2zarr uninstall step and update the wheel tests

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?

@Billyzhang1229
Billyzhang1229 force-pushed the uv-upgrade branch 4 times, most recently from 1854d8a to a32ddff Compare October 15, 2026 08:32
@jeromekelleher

Copy link
Copy Markdown
Member

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.

@jeromekelleher
jeromekelleher merged commit b73c37b into sgkit-dev:main Oct 15, 2026
14 checks passed
@jeromekelleher

Copy link
Copy Markdown
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delete upstream workflow

3 participants