Skip to content

Update tensorrt-cu12-libs Package to Use Metadata 2.2 or Later for Improved Dependency Resolution #4352

Open
@validatedev

Description

@validatedev

Description

I am experiencing an issue with the tensorrt-cu12-libs package available on PyPI. Specifically, the package does not publish any wheels (as seen here), and the source distribution uses Metadata 2.1. This older metadata version lacks essential information that modern package management tools rely on for dependency resolution.

When I use tools like uv to manage dependencies, they attempt to build the tensorrt-cu12-libs package because they cannot read the required metadata without building the package. This leads to build failures unfortunately.

Updating the tensorrt-cu12-libs package to use Metadata 2.2 or later by employing the latest version of setuptools during package creation would allow tools to read the metadata without building the package. This change would improve dependency resolution and prevent build attempts on unsupported platforms.

Environment

TensorRT Version: 10.8.0.43

NVIDIA GPU: Not applicable (issue occurs on systems without NVIDIA GPUs)

NVIDIA Driver Version: Not applicable

CUDA Version: 12.x

CUDNN Version: Not applicable

Operating System:

  • Darwin 24.3.0 arm64 (macOS Sequoia 15.3 24D60)
  • Docker Container based on python:3.12-slim-bookworm

Python Version: Python 3.12.9

TensorFlow Version: Not applicable

PyTorch Version: 2.6.0

Bare Metal or Container: Both bare metal and Docker containers

Relevant Files

A minimal reproducible example (MRE) is available here:

These repositories contain pyproject.toml files that specify tensorrt-cu12-libs as an optional dependency.

Steps To Reproduce

Using Optional Dependencies (Extras)

  1. Clone the MRE repository:

    git clone https://github.com/validatedev/uv-tensorrt-extradep-issue-mre.git
    cd uv-tensorrt-extradep-issue-mre
  2. Attempt to synchronize dependencies for an extra that does not include tensorrt-cu12-libs (e.g., macos):

    uv sync --extra macos
  3. Observe that uv tries to build tensorrt-cu12-libs even though it's not part of the macos extra. The build fails with an error similar to:

    × Failed to build `tensorrt-cu12-libs==10.8.0.43`
    ├─▶ The build backend returned an error
    ╰─▶ Call to `wheel_stub.buildapi.build_wheel` failed (exit status: 1)
    
  4. Observe that uv tries to build tensorrt-cu12-libs even though it is not requested.

docker build -f linux-cpu.Dockerfile -t uv-test-extra .

[+] Building 12.2s (11/12) 
 => [internal] load build definition from linux-cpu.Dockerfile                                                                                                            0.1s
 => => transferring dockerfile: 571B                                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/python:3.12-slim-bookworm                                                                                              2.0s
 => [internal] load .dockerignore                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                           0.0s
 => [1/7] FROM docker.io/library/python:3.12-slim-bookworm@sha256:34656cd90456349040784165b9decccbcee4de66f3ead0a1168ba893455afd1e                                        0.0s
 => [3/7] ADD https://astral.sh/uv/0.5.29/install.sh /uv-installer.sh                                                                                                     1.6s
 => [internal] load build context                                                                                                                                         0.0s
 => => transferring context: 1.36kB                                                                                                                                       0.0s
 => CACHED [2/7] RUN apt-get update && apt-get upgrade -y     && apt-get install -y curl                                                                                  0.0s
 => CACHED [3/7] ADD https://astral.sh/uv/0.5.29/install.sh /uv-installer.sh                                                                                              0.0s
 => CACHED [4/7] RUN sh /uv-installer.sh && rm /uv-installer.sh                                                                                                           0.0s
 => CACHED [5/7] WORKDIR /app                                                                                                                                             0.0s
 => [6/7] COPY pyproject.toml hello.py /app/                                                                                                                              0.1s
 => [7/7] RUN uv --version     && uv sync --extra linux --extra linux-cpu                                                                                                 8.3s
 => => # uv 0.5.29                                                                                                                                                            
 => => # Using CPython 3.12.9 interpreter at: /usr/local/bin/python3                                                                                                          
 => => # Creating virtual environment at: .venv                                                                                                                               
 => => #    Building tensorrt-cu12-libs==10.8.0.43  

Using Dependency Groups

  1. Clone the MRE repository:

    git clone https://github.com/validatedev/uv-tensorrt-groupdep-issue-mre.git
    cd uv-tensorrt-groupdep-issue-mre
  2. Attempt to synchronize dependencies for a group that does not include tensorrt-cu12-libs (e.g., macos):

    uv sync --group macos
  3. Observe that uv tries to build tensorrt-cu12-libs. The build fails with an error.

Error Output

× Failed to build `tensorrt-cu12-libs==10.8.0.43`
├─▶ The build backend returned an error
╰─▶ Call to `wheel_stub.buildapi.build_wheel` failed (exit status: 1)

[stderr]
...
RuntimeError: Didn't find wheel for tensorrt-cu12-libs 10.8.0.43

...
  1. Observe that uv tries to build tensorrt-cu12-libs even though it is not requested.
docker build -f linux-cpu.Dockerfile -t uv-test-group .

[+] Building 8.2s (11/12)                                                                                                                                      docker:orbstack
 => [internal] load build definition from linux-cpu.Dockerfile                                                                                                            0.0s
 => => transferring dockerfile: 587B                                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/python:3.12-slim-bookworm                                                                                              0.8s
 => [internal] load .dockerignore                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                           0.0s
 => [1/7] FROM docker.io/library/python:3.12-slim-bookworm@sha256:34656cd90456349040784165b9decccbcee4de66f3ead0a1168ba893455afd1e                                        0.0s
 => [internal] load build context                                                                                                                                         0.0s
 => => transferring context: 137B                                                                                                                                         0.0s
 => [3/7] ADD https://astral.sh/uv/0.5.29/install.sh /uv-installer.sh                                                                                                     0.7s
 => CACHED [2/7] RUN apt-get update && apt-get upgrade -y     && apt-get install -y curl                                                                                  0.0s
 => CACHED [3/7] ADD https://astral.sh/uv/0.5.29/install.sh /uv-installer.sh                                                                                              0.0s
 => CACHED [4/7] RUN sh /uv-installer.sh && rm /uv-installer.sh                                                                                                           0.0s
 => CACHED [5/7] WORKDIR /app                                                                                                                                             0.0s
 => CACHED [6/7] COPY pyproject.toml hello.py /app/                                                                                                                       0.0s
 => [7/7] RUN uv --version     && uv sync --group linux --group linux-cpu --no-group cuda                                                                                 6.6s
 => => # uv 0.5.29                                                                                                                                                            
 => => # Using CPython 3.12.9 interpreter at: /usr/local/bin/python3                                                                                                          
 => => # Creating virtual environment at: .venv                                                                                                                               
 => => #    Building tensorrt-cu12-libs==10.8.0.43                                                                                                                            

Commands or Scripts:

  • uv sync --extra macos
  • uv sync --group macos
  • docker build -f linux-cpu.Dockerfile -t uv-test-extra .
  • docker build -f linux-cpu.Dockerfile -t uv-test-group .

Have you tried the latest release?

Yes, the issue persists with the latest release of TensorRT.

Can this model run on other frameworks?

Not applicable. The issue is related to package metadata and dependency resolution, not model execution.

Suggested Solution

Please consider updating the build process for tensorrt-cu12-libs to use the latest version of setuptools, which generates Metadata 2.2 or later. This update would include the enhanced metadata within the source distribution, allowing tools to read dependency information without building the package.

This change would improve compatibility with modern package management tools and prevent unnecessary build attempts on unsupported platforms.

Linked issue on repository uv: astral-sh/uv#11363

Metadata

Metadata

Assignees

Labels

Feature RequestRequest for new functionalityModule:OSS BuildBuilding issues: cmake, make, pip install, etc.internal-bug-trackedTracked internally, will be fixed in a future release.triagedIssue has been triaged by maintainers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions