Skip to content

build: lock ci dependencies with uv and install from the lock file - #6

Open
maxg0811 wants to merge 1 commit into
task/update-for-torch-213-compatibilityfrom
build/lock-ci-dependencies-with-uv
Open

maxg0811 wants to merge 1 commit into
task/update-for-torch-213-compatibilityfrom
build/lock-ci-dependencies-with-uv

Conversation

@maxg0811

Copy link
Copy Markdown

Merge after #3. This PR is based on the branch of #3. After #3 is merged, change the base to main.

What

  • Add uv.lock and exclude-newer = "5 days", the same cooldown as Renovate.
  • New ci dependency group with torch 2.0.0 (CPU index), torch-scatter 2.1.2 and pyg-lib 0.4.0, for linux x86_64 and Python 3.10 only. These are not package dependencies, so users still install the build for their CUDA version.
  • The PyG wheel index publishes no hashes. torch-scatter and pyg-lib are direct wheel URLs, so uv hashes them in the lock file. Every wheel in the lock has a hash.
  • numpy<2 in the ci group, because torch 2.0.0 cannot convert arrays with NumPy 2 ("Failed to initialize NumPy"). The current pip setup installs NumPy 2.
  • New build group with hatchling and twine. Build and release run uv build --no-build-isolation with the locked backend.
  • Test, build and release jobs install with uv sync --locked. setup-uv is pinned by SHA, and uv to 0.13.7 with a Renovate annotation.
  • Remove .github/actions/setup, which installed torch and the PyG packages with pip.

Why

Supply chain rules CI installs from the lock file and Pin every dependency. pyproject.toml keeps version ranges, as the rule for libraries asks.

Testing

In a python:3.10-slim linux/amd64 container with uv 0.13.7, I ran the same commands as the workflows:

  • uv sync --locked --extra dev --extra tests --group ci, then pytest: 9 passed, 1 skipped.
  • uv build --no-build-isolation and twine check --strict: passed.
  • uv lock --check passes. No locked release is younger than 5 days.

Note: the Test workflow is disabled on this fork (disabled_fork), so CI does not run these tests until it is enabled.

🤖 Generated with Claude Code

Add uv.lock with a 5-day cooldown. Torch, torch-scatter and pyg-lib move to a
ci dependency group, and hatchling and twine to a build group, so that test,
build and release jobs install only locked versions with hashes. Remove the
setup action that installed them with pip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant