Problem
Installing lintrunner with uv fails with the following error:
× Failed to download and build `lintrunner==0.12.11`
├─▶ Failed to parse:
│ `/root/.cache/uv/sdists-v9/pypi/lintrunner/0.12.11/.../pyproject.toml`
╰─▶ TOML parse error at line 5, column 1
|
5 | [project]
| ^^^^^^^^^
`pyproject.toml` is using the `[project]` table, but the required
`project.version` field is neither set nor present in the
`project.dynamic` list
Root Cause
The current pyproject.toml has a [project] table but doesn't declare the version field:
[project]
name = "lintrunner"
requires-python = ">=3.6"
classifiers = [...]
Per PEP 621, when using the [project] table, the version field is required unless it's listed in dynamic. Since maturin gets the version from Cargo.toml, this works at build time, but uv validates the pyproject.toml strictly before invoking the build backend.
Suggested Fix
Add dynamic = ["version"] to the [project] table to indicate that the version is provided dynamically by the build backend:
[project]
name = "lintrunner"
requires-python = ">=3.6"
dynamic = ["version"] # <-- add this line
classifiers = [...]
This is the standard way to declare that maturin will provide the version from Cargo.toml.
Context
This issue affects users trying to build PyTorch from source using uv, as PyTorch's requirements.txt includes lintrunner. The workaround is to filter out lintrunner or use pip instead of uv.
Environment
- uv version: 0.9.x+
- Python: 3.12
- Platform: Linux (ppc64le, but affects all platforms)
Problem
Installing lintrunner with uv fails with the following error:
Root Cause
The current
pyproject.tomlhas a[project]table but doesn't declare theversionfield:Per PEP 621, when using the
[project]table, theversionfield is required unless it's listed indynamic. Since maturin gets the version fromCargo.toml, this works at build time, but uv validates the pyproject.toml strictly before invoking the build backend.Suggested Fix
Add
dynamic = ["version"]to the[project]table to indicate that the version is provided dynamically by the build backend:This is the standard way to declare that maturin will provide the version from Cargo.toml.
Context
This issue affects users trying to build PyTorch from source using uv, as PyTorch's
requirements.txtincludes lintrunner. The workaround is to filter out lintrunner or use pip instead of uv.Environment