Skip to content

Commit 1543a22

Browse files
Use CPU-only PyTorch index to speed up dev installation (#1967)
1 parent 9cfeec5 commit 1543a22

2 files changed

Lines changed: 140 additions & 244 deletions

File tree

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ optional-dependencies.dev = [
7474
"sphinx-pyproject==0.3.0",
7575
"sphinx-substitution-extensions==2026.1.12",
7676
"sphinxcontrib-spelling==8.0.2",
77+
# Listed explicitly (despite being transitive via vws-python-mock) so that
78+
# [tool.uv.sources] can redirect to the CPU-only PyTorch index.
79+
# See: https://vws-python.github.io/vws-python-mock/installation.html#faster-installation
80+
"torch>=2.5.1",
81+
"torchvision>=0.20.1",
7782
"ty==0.0.17",
7883
"types-pyyaml==6.0.12.20250915",
7984
"vulture==2.14",
@@ -106,6 +111,11 @@ packages.find.where = [
106111
# worrying about including the file in MANIFEST.in.
107112
version_file = "src/vws_cli/_setuptools_scm_version.py"
108113

114+
[tool.uv]
115+
sources.torch = { index = "pytorch-cpu" }
116+
sources.torchvision = { index = "pytorch-cpu" }
117+
index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ]
118+
109119
[tool.ruff]
110120
line-length = 79
111121
lint.select = [
@@ -278,6 +288,13 @@ pep621_dev_dependency_groups = [
278288
"packaging",
279289
"release",
280290
]
291+
# torch and torchvision are listed explicitly in dev deps to allow
292+
# [tool.uv.sources] to redirect them to the CPU-only PyTorch index,
293+
# but they are not directly imported in the vws-cli source code.
294+
per_rule_ignores.DEP002 = [
295+
"torch",
296+
"torchvision",
297+
]
281298

282299
[tool.pyproject-fmt]
283300
indent = 4

0 commit comments

Comments
 (0)