Skip to content

#4894 - Polygraphy: add the missing pyproject.toml - #4896

Draft
ConnorBaker wants to merge 1 commit into
NVIDIA:mainfrom
ConnorBaker:polygraphy-add-pyproject-toml
Draft

ConnorBaker wants to merge 1 commit into
NVIDIA:mainfrom
ConnorBaker:polygraphy-add-pyproject-toml

Conversation

@ConnorBaker

Copy link
Copy Markdown
Contributor

Fixes #4894.

TensorRT 11.3 removed tools/Polygraphy/setup.py and setup.cfg and switched the Makefile and install.ps1 to python -m build --wheel, as the CHANGELOG's v0.49.34 entry describes ("Migrated the build system to pyproject.toml"). The pyproject.toml itself wasn't included, so building Polygraphy from source fails:

ERROR Source .../tools/Polygraphy does not appear to be a Python project: no pyproject.toml or setup.py

This adds a pyproject.toml that reproduces the metadata of the polygraphy 0.53.6 wheel on PyPI: the version from polygraphy.__version__, the description, README.md as the long description, the license, author, classifiers and homepage, Requires-Python: >=3.8, and the polygraphy console script. Only the polygraphy package is included, as tests/test_packaging.py expects.

project.license keeps the table form, { text = "Apache 2.0" }, because that is what gives the published wheel its License: Apache 2.0. setuptools 83.0.0 warns that the table form is deprecated and has to be replaced by 2027-02-18. An SPDX expression would change the published metadata, so I've left that choice to you.

Testing (x86_64-linux, Python 3.14.8, setuptools 83.0.0, on v11.4, which is the same commit as main):

  • The wheel has the same 192 package files as the PyPI 0.53.6 wheel, with the same contents, and the same entry_points.txt, top_level.txt and METADATA body. The differences:
    • METADATA adds License-File: LICENSE.txt and Dynamic: license-file, and the dist-info has licenses/LICENSE.txt;
    • WHEEL has Generator: setuptools (83.0.0), where PyPI's has (84.0.0);
    • there's no zip-safe file.
  • These 10 test modules, which don't import TensorRT, pass (285 passed, 4 skipped): tests/backend/base/test_loader.py, tests/common/test_interface.py, tests/common/test_struct.py, tests/comparator/test_compare.py, tests/comparator/test_postprocess.py, tests/func/test_func.py, tests/logger/test_logger.py, tests/mod/test_exporter.py, tests/mod/test_util.py and tests/test_deprecated_aliases.py.
  • Not tested: make install and install.ps1 themselves, tests/test_packaging.py (it needs pytest-virtualenv and network access), and the other test modules, including all of those that import TensorRT.

AI disclosure: this change and description were prepared with Claude Code (Claude Opus 5.5); the commit carries a Co-Authored-By: Claude trailer.

🤖 Generated with Claude Code

The TensorRT 11.3 OSS release removed setup.py and setup.cfg from
tools/Polygraphy and switched the Makefile and install.ps1 to
`python -m build --wheel`, following the build system's migration to
pyproject.toml (CHANGELOG, v0.49.34). The pyproject.toml itself was not
included, so `make install`, install.ps1 and the README's "Building From
Source" steps fail: with neither file, the directory isn't a Python
project.

Add a pyproject.toml that reproduces the metadata of the published
polygraphy 0.53.6 wheel: the version from polygraphy.__version__, the
description, README.md as the long description, the license, author,
classifiers and homepage, `Requires-Python: >=3.8`, and the `polygraphy`
console script. Only the polygraphy package is included, as
tests/test_packaging.py expects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OSS release exports drop pyproject.toml files; Polygraphy can't be built from source since 11.3

1 participant