-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I found the problem by trying to reproduce the problem on a new repo. The problem is with package torchmetrics. When it is in the workspace package/dependency this case exists. I have yet not inspect what can be wrong with that package configuration.
Minimal example:
Child:
[project] name = "child-surface" version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.12" dependencies = [ "torchmetrics>=1.1.0", ] [project.optional-dependencies] cpu = [ "torch==2.4.1", "torchvision==0.19.1" ] gpu = [ "torch==2.4.1", "torchvision==0.19.1", "nvidia-dali-cuda120==1.30.0", ] [tool.uv] conflicts = [ [ { extra = "cpu" }, { extra = "gpu" }, ], ] [tool.uv.sources] torch = [ { index = "pytorch-cpu", extra = "cpu" }, { index = "pytorch-cu124", extra = "gpu" }, ] torchvision = [ { index = "pytorch-cpu", extra = "cpu" }, { index = "pytorch-cu124", extra = "gpu" }, ] [[tool.uv.index]] name = "pytorch-cpu" url = "https://download.pytorch.org/whl/cpu" explicit = true [[tool.uv.index]] name = "pytorch-cu124" url = "https://download.pytorch.org/whl/cu124" explicit = trueParent:
[project] name = "parent-surface" version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.12" dependencies = [] [tool.uv.sources] child-surface = [{ workspace = true },] [tool.uv.workspace] members = ["child-surface"] [project.optional-dependencies] cpu = [ "child-surface[cpu]>=0.0.1", ] gpu = [ "child-surface[gpu]>=0.0.1", ] [tool.uv] conflicts = [ [ { extra = "cpu" }, { extra = "gpu" }, ], ]Full zipped example with lock file:
parent-surface.zip
Edit: Looking at their repo and build system in setup.py I see that they define base requirements which is just
torch >=2.0.0, <2.7.0So uv resolver has installed
torch==2.4.1+cu124and then installstorch==2.4.1which is strange having two different versions of the same packageThis behavior changed after introducing this change
Originally posted by @mchalecki in #10590
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working