Skip to content

PyTorch nightly index makes uv download all torch versions in a loop #9651

@ViRb3

Description

@ViRb3

I copied the full PyTorch example from https://docs.astral.sh/uv/guides/integration/pytorch/#using-a-pytorch-index:

[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12.0"
dependencies = [
  "torch>=2.5.1",
  "torchvision>=0.20.1",
]

[tool.uv.sources]
torch = [
    { index = "pytorch-cpu", marker = "platform_system != 'Darwin'" },
]
torchvision = [
    { index = "pytorch-cpu", marker = "platform_system != 'Darwin'" },
]

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

Only difference is I swapped the index url to https://download.pytorch.org/whl/nightly/cpu

When I run uv sync, it downloads all versions of torch in reverse order. It doesn't really stop until I Ctrl + C it. Without nightly, it works fine.

$ uv version
uv 0.5.6 (Homebrew 2024-12-03)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions