Skip to content

Commit 9f484ea

Browse files
adamtheturtleclaude
andcommitted
Add torchvision as direct dependency for CPU index source to apply
tool.uv.sources only applies to direct dependencies; torchvision was only a transitive dependency via piq, so sources.torchvision was silently ignored and PyPI's torchvision was installed instead. PyPI's torchvision registers torchvision::nms operators that don't exist in CPU-only torch, causing RuntimeError on import. Making torchvision a direct dependency causes uv to route it through the CPU index. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1410e79 commit 9f484ea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies = [
4444
"responses>=0.25.3",
4545
"torch>=2.5.1",
4646
"torchmetrics>=1.5.1",
47+
"torchvision>=0.20.1",
4748
"tzdata; sys_platform=='win32'",
4849
"vws-auth-tools>=2024.7.12",
4950
"werkzeug>=3.1.2",
@@ -317,6 +318,9 @@ per_rule_ignores.DEP002 = [
317318
# tzdata is needed on Windows for zoneinfo to work.
318319
# See https://docs.python.org/3/library/zoneinfo.html#data-sources.
319320
"tzdata",
321+
# torchvision is used transitively via piq, but must be a direct dependency
322+
# so that tool.uv.sources can route it to the CPU-only PyTorch index.
323+
"torchvision",
320324
]
321325

322326
[tool.pyproject-fmt]

0 commit comments

Comments
 (0)