Skip to content

Commit a268b9a

Browse files
committed
build(pyproject): uv sync --extra={cpu,cu118}
1 parent 586c557 commit a268b9a

File tree

2 files changed

+415
-205
lines changed

2 files changed

+415
-205
lines changed

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ tutorials = [
6565
"ipywidgets",
6666
"jupyter",
6767
]
68+
cpu = [
69+
"torch>=2.0.0",
70+
"torchvision>=0.15.1",
71+
]
72+
cu118 = [
73+
"torch>=2.0.0",
74+
"torchvision>=0.15.1",
75+
]
6876
models-mmpose = [
6977
"openmim>=0.3.9",
7078
# mmpose/requirements/runtime.txt
@@ -151,12 +159,36 @@ skip_gitignore = true
151159
known_third_party = "PIL,torchvision,torch"
152160

153161
[tool.uv]
162+
conflicts = [
163+
[
164+
{ extra = "cpu" },
165+
{ extra = "cu118" },
166+
],
167+
]
154168
no-build-isolation-package = [
155169
"chumpy",
156170
]
157171

172+
[[tool.uv.index]]
173+
name = "pytorch-cpu"
174+
url = "https://download.pytorch.org/whl/cpu"
175+
explicit = true
176+
177+
[[tool.uv.index]]
178+
name = "pytorch-cu118"
179+
url = "https://download.pytorch.org/whl/cu118"
180+
explicit = true
181+
158182
[tool.uv.sources]
159183
compressai = { workspace = true }
184+
torch = [
185+
{ index = "pytorch-cpu", extra = "cpu" },
186+
{ index = "pytorch-cu118", extra = "cu118" },
187+
]
188+
torchvision = [
189+
{ index = "pytorch-cpu", extra = "cpu" },
190+
{ index = "pytorch-cu118", extra = "cu118" },
191+
]
160192

161193
[tool.uv.workspace]
162194
members = [

0 commit comments

Comments
 (0)