Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ optional-dependencies.dev = [
"sphinx-substitution-extensions==2026.1.12",
"sphinxcontrib-spelling==8.0.2",
"sybil==9.3.0",
# Listed explicitly (despite being transitive via vws-python-mock) so that
# [tool.uv.sources] can redirect to the CPU-only PyTorch index.
# See: https://vws-python.github.io/vws-python-mock/installation.html#faster-installation
"torch>=2.5.1",
"torchvision>=0.20.1",
"ty==0.0.17",
"types-requests==2.32.4.20260107",
"vulture==2.14",
Expand Down Expand Up @@ -106,6 +111,11 @@ bdist_wheel.universal = true
# Code to match this is in ``conf.py``.
version_scheme = "post-release"

[tool.uv]
sources.torch = { index = "pytorch-cpu" }
sources.torchvision = { index = "pytorch-cpu" }
Copy link

Choose a reason for hiding this comment

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

PyTorch source redirect breaks macOS dev installation

Medium Severity

The sources.torch and sources.torchvision unconditionally redirect resolution to the pytorch-cpu index (download.pytorch.org/whl/cpu), which only hosts Linux and Windows wheels — not macOS. Since uv does not fall back to PyPI when a wheel is missing from an explicit index, dependency resolution will fail for any macOS developer. The project classifies as supporting Operating System :: POSIX (which includes macOS). Adding platform markers (e.g., marker = "sys_platform != 'darwin'") to the source entries would restrict the redirect to platforms where CPU-only wheels exist.

Additional Locations (1)

Fix in Cursor Fix in Web

index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ]

[tool.ruff]
line-length = 79
lint.select = [
Expand Down Expand Up @@ -277,6 +287,13 @@ pep621_dev_dependency_groups = [
"dev",
"release",
]
# torch and torchvision are listed explicitly in dev deps to allow
# [tool.uv.sources] to redirect them to the CPU-only PyTorch index,
# but they are not directly imported in the vws-python source code.
per_rule_ignores.DEP002 = [
"torch",
"torchvision",
]

[tool.pyproject-fmt]
indent = 4
Expand Down