Skip to content

Commit 6041890

Browse files
authored
feat: working uv pyproject.toml (#3597)
1 parent db61100 commit 6041890

File tree

2 files changed

+1654
-1678
lines changed

2 files changed

+1654
-1678
lines changed

pyproject.toml

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ requires = [
88
"cffi>=1.15.1",
99
"typing-extensions>=4.7.0",
1010
"future>=0.18.3",
11-
"tensorrt-cu12>=10.11.0,<10.12.0; 'tegra' not in platform_release",
12-
"tensorrt>=10.3.0,<10.4.0; 'tegra' in platform_release",
13-
"torch>=2.8.0.dev,<2.9.0; 'tegra' not in platform_release",
14-
"torch>=2.7.0,<2.8.0; 'tegra' in platform_release",
11+
"tensorrt-cu12>=10.11.0,<10.12.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
12+
"tensorrt-cu12>=10.3.0,<10.4.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
13+
"torch>=2.8.0.dev,<2.9.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
14+
"torch>=2.7.0,<2.8.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
1515
"pybind11==2.6.2",
16-
"numpy; 'tegra' not in platform_release",
17-
"numpy<2.0.0; 'tegra' in platform_release",
16+
"numpy; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
17+
"numpy<2.0.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
1818
"sympy",
1919
"dllist",
2020
]
@@ -59,20 +59,23 @@ keywords = [
5959
"inference",
6060
]
6161
dependencies = [
62-
"torch>=2.8.0.dev,<2.9.0; 'tegra' not in platform_release",
63-
"torch>=2.7.0,<2.8.0; 'tegra' in platform_release",
62+
"torch>=2.8.0.dev,<2.9.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
63+
"torch>=2.7.0,<2.8.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
6464

65-
"tensorrt>=10.11.0,<10.12.0; 'tegra' not in platform_release",
66-
"tensorrt>=10.3.0,<10.4.0; 'tegra' in platform_release",
65+
"tensorrt>=10.11.0,<10.12.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
66+
"tensorrt-cu12>=10.11.0,<10.12.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
67+
"tensorrt-cu12-bindings>=10.11.0,<10.12.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
68+
"tensorrt-cu12-libs>=10.11.0,<10.12.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
6769

68-
"tensorrt-cu12>=10.11.0,<10.12.0; 'tegra' not in platform_release",
69-
"tensorrt-cu12-bindings>=10.11.0,<10.12.0; 'tegra' not in platform_release",
70-
"tensorrt-cu12-libs>=10.11.0,<10.12.0; 'tegra' not in platform_release",
70+
"tensorrt>=10.3.0,<10.4.0;platform_machine == 'aarch64' and 'tegra' in platform_release",
71+
"tensorrt-cu12>=10.3.0,<10.4.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
72+
"tensorrt-cu12-bindings>=10.3.0,<10.4.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
73+
"tensorrt-cu12-libs>=10.3.0,<10.4.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
7174

7275
"packaging>=23",
7376

74-
"numpy; 'tegra' not in platform_release",
75-
"numpy<2.0.0; 'tegra' in platform_release",
77+
"numpy; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
78+
"numpy<2.0.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
7679

7780
"typing-extensions>=4.7.0",
7881
"dllist",
@@ -89,10 +92,6 @@ dev = [
8992
"mypy",
9093
"isort",
9194
"ruff",
92-
"pytest",
93-
"pytest-xdist",
94-
"parameterized>=0.2.0",
95-
"expecttest==0.1.6",
9695
"pyyaml",
9796
]
9897

@@ -102,13 +101,21 @@ debug = [
102101
"graphviz >= 0.20.3"
103102
]
104103

104+
test = [
105+
"pytest",
106+
"pytest-xdist",
107+
"parameterized>=0.2.0",
108+
"expecttest==0.1.6",
109+
"timm>=1.0.3",
110+
"transformers>=4.49.0",
111+
]
112+
105113
[project.optional-dependencies]
106114
torchvision = [
107-
"torchvision",
108-
] #Leaving torchvisions dependency unconstrained so uv can just install something that should work for the torch we have. TV's on PyT makes it hard to put version constrains in
115+
"torchvision>=0.23.0.dev,<0.24.0; platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)",
116+
"torchvision>=0.22.0,<0.23.0; platform_machine == 'aarch64' and 'tegra' in platform_release",
117+
]
109118
quantization = ["nvidia-modelopt[all]>=0.27.1"]
110-
monitoring-tools = ["rich>=13.7.1"]
111-
jupyter = ["rich[jupyter]>=13.7.1"]
112119

113120
[project.urls]
114121
Homepage = "https://pytorch.org/tensorrt"
@@ -124,17 +131,28 @@ include-package-data = false
124131
package = true
125132
environments = ["sys_platform == 'linux'", "sys_platform == 'windows'"]
126133
prerelease = "if-necessary-or-explicit"
127-
index-strategy = "unsafe-best-match" # Needed for TRT-LLM
134+
index-strategy = "unsafe-best-match"
128135

129136
[tool.uv.sources]
130-
torch = [{ index = "pytorch-nightly-cu128" }]
131-
torchvision = [{ index = "pytorch-nightly-cu128" }]
137+
torch = [
138+
{ index = "pytorch-nightly-cu128", marker = "platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)" },
139+
{ index = "jetson-containers", marker = "platform_machine == 'aarch64' and 'tegra' in platform_release" },
140+
]
141+
torchvision = [
142+
{ index = "pytorch-nightly-cu128", marker = "platform_machine != 'aarch64' or (platform_machine == 'aarch64' and 'tegra' not in platform_release)" },
143+
{ index = "jetson-containers", marker = "platform_machine == 'aarch64' and 'tegra' in platform_release" },
144+
]
132145

133146
[[tool.uv.index]]
134147
name = "pytorch-nightly-cu128"
135148
url = "https://download.pytorch.org/whl/nightly/cu128"
136149
explicit = false
137150

151+
[[tool.uv.index]]
152+
name = "jetson-containers"
153+
url = "https://pypi.jetson-ai-lab.dev/jp6/cu126/+simple"
154+
explicit = false
155+
138156
[[tool.uv.index]]
139157
name = "nvidia"
140158
url = "https://pypi.nvidia.com"

0 commit comments

Comments
 (0)