-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
We have three dependencies, which all require PyTorch:
mace-torch, which requirestorch>=1.12in their tagged releasechgnet, which requirestorch>=2.4.1in their tagged releasematgl(labelledm3nget), which requires anytorchin their tagged release, but in most cases we need to requiretorch<=2.2.1(and"dgl==2.1")
A (relatively) minimal pyproject.toml for this, with the conflict between chgnet and m3gnet specified:
[project]
name = "test"
version = "0.0.1"
requires-python = ">=3.10"
dependencies = [
"mace-torch==0.3.9",
]
[project.optional-dependencies]
chgnet = [
"chgnet == 0.4.0",
]
m3gnet = [
"matgl == 1.1.3",
"torch == 2.2.1",
"torchdata == 0.7.1",
]
[tool.uv]
constraint-dependencies = [
"dgl==2.1",
"torch<2.6",
]
conflicts = [
[
{ extra = "chgnet" },
{ extra = "m3gnet" },
],
]
However, if I run uv sync -p 312 with this, followed by uv pip list, two versions of torch are installed:
torch 2.2.1
torch 2.5.1
Strangely, we swap out matgl for alignn (which only explicitly depends on torch>=2.0.0 in their tagged release):
[project]
name = "test"
version = "0.0.1"
requires-python = ">=3.10"
dependencies = [
"mace-torch==0.3.9",
]
[project.optional-dependencies]
chgnet = [
"chgnet == 0.4.0",
]
alignn = [
"alignn == 2024.5.27",
"torch == 2.2.1",
"torchdata == 0.7.1",
]
[tool.uv]
constraint-dependencies = [
"dgl==2.1",
"torch<2.6",
]
conflicts = [
[
{ extra = "chgnet" },
{ extra = "alignn" },
],
]
then, when running uv sync -p 312, only torch 2.5.1 is installed.
May be related to #10985.
Platform
macOS 15.2 arm64
Version
0.5.26
Python version
3.12.8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working