-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I can confirm that #9533 is fixed with uv 0.5.6, this is a follow-up for packages with dependencies in conflicting extras:
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.10.0"
dependencies = []
[project.optional-dependencies]
cpu = ["torch>=2.0"]
cu118 = ["torch>=2.0"]
[tool.uv]
conflicts = [
[
{ extra = "cpu" },
{ extra = "cu118" },
],
]
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" },
{ index = "pytorch-cu118", extra = "cu118" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu118"
url = "https://download.pytorch.org/whl/cu118"
explicit = true
To reproduce:
- Ensure lock file and venv are not present:
rm .venv/ uv.lock -rdf
- On the first run only torch itself is installed:
$ uv run --extra cpu python -c "import torch; print(torch.__version__)"
Using CPython 3.13.0
Creating virtual environment at: .venv
Installed 1 package in 88ms
Traceback (most recent call last):
File "<string>", line 1, in <module>
import torch; print(torch.__version__)
^^^^^^^^^^^^
File ".../.venv/lib/python3.13/site-packages/torch/__init__.py", line 37, in <module>
from typing_extensions import ParamSpec as _ParamSpec, TypeGuard as _TypeGuard
ModuleNotFoundError: No module named 'typing_extensions'
- The dependencies only get installed on the second run:
$ uv run --extra cpu python -c "import torch; print(torch.__version__)"
Installed 9 packages in 16ms
2.5.1+cpu
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working