Update dependencies and CI configuration#59
Open
will-rice wants to merge 16 commits into
Open
Conversation
- Run uv lock --upgrade to update all dependencies to latest compatible versions - Remove invalid torch-backend field from [tool.uv] in pyproject.toml (CLI-only option) - Upgrade actions/checkout@v3 -> v4 and actions/setup-python@v3 -> v5 in CI workflows https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
The torch-backend field is valid in recent uv versions. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
Replace manual curl install with the official setup-uv action, which provides caching and always installs the latest version. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
Move the env var from the step level to the workflow level so it applies to all uv resolution and installation, not just the pre-commit run step. This ensures torch CPU variants are used throughout CI. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
The torch-backend setting in [tool.uv] requires uv 0.11+. Adding required-version ensures users and CI get a compatible version. Combined with UV_TORCH_BACKEND=cpu in CI and astral-sh/setup-uv@v6 (which installs the latest uv), this ensures CPU torch is installed in CI while allowing auto-detection locally. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
- Set torch-backend = "cpu" in pyproject.toml so uv fetches CPU torch wheels from the PyTorch index - Remove required-version constraint that may block older uv versions - Add debug step to log uv version in CI - Pin setup-uv version to >=0.11.0 https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
The uv.lock contains CUDA torch wheel URLs from PyPI which take precedence over torch-backend settings at install time. By removing the lock in CI, uv resolves fresh with UV_TORCH_BACKEND=cpu, fetching CPU wheels from the PyTorch index. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
Add uv --version to debug CI, and use --no-cache to ensure no stale CUDA torch wheels are used from cache. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
Use UV_EXTRA_INDEX_URL to explicitly point at the PyTorch CPU wheel index. This works regardless of uv version and ensures torch, torchcodec, torchaudio, and torchvision all resolve to CPU builds. Split dependency install into its own step for better debugging. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
The torch-backend setting in [tool.uv] may not be supported by the uv version on CI and could cause parse errors. Instead: - Remove torch-backend from pyproject.toml entirely - Use UV_TORCH_BACKEND=cpu as step-level env vars in CI - Pass --extra-index-url for PyTorch CPU index during uv sync - Delete uv.lock in CI to force fresh CPU resolution - Separate install step with torch version verification https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
Go back to the working CI pattern from main: curl-based uv install, UV_TORCH_BACKEND=cpu on the pre-commit step, and keep uv.lock. The only changes from main are updated action versions (v3->v4/v5) and restored torch-backend=auto in pyproject.toml. The setup-uv action and lock file deletion were causing fast failures. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
The uv.lock resolves CUDA torch from PyPI and UV_TORCH_BACKEND=cpu doesn't override this. Fix by running uv sync first, then replacing torch ecosystem packages with CPU builds from the PyTorch CPU index using uv pip install --index-url --reinstall. This was already broken on main (PR #56 CI also failed). https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
torchcodec may not be on the PyTorch CPU index. Only reinstall torch, torchaudio, torchvision from the CPU index. torchcodec from PyPI should work once torch is the CPU variant since it dynamically links to the installed torch. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
After installing CPU torch via uv pip install, nested uv run calls from pre-commit hooks would re-sync against the lockfile and reinstall CUDA torch. Setting UV_FROZEN=1 prevents uv run from syncing, preserving the CPU torch packages we installed. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
UV_FROZEN requires a matching lock file. UV_NO_SYNC is simpler - it just skips syncing entirely. This env var propagates to all nested uv run calls from pre-commit hooks (ruff, mypy, pytest), preventing them from re-installing CUDA torch from the lock file. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
Separate install, CPU torch swap, and verification into individual steps so we can see exactly which step fails. Added assertions to verify CPU torch and torchcodec load correctly. https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://claude.ai/code/session_01VCUDiHXTrirQYn79UD2Nhj