Move all Python test dependencies to pyproject#4256
Open
SandSnip3r wants to merge 1 commit into
Open
Conversation
…CI to avoid duplicated requirements.
lanluo-nvidia
approved these changes
May 13, 2026
Collaborator
lanluo-nvidia
left a comment
There was a problem hiding this comment.
LGTM
noxfile.py is deprecated anyway, we no longer use nox for pytest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Install Python test dependencies from pyproject dependency groups in CI to avoid duplicated requirements.
Description
Summary
This PR ports Python test dependency installation in CI from
tests/py/requirements.txttopyproject.tomldependency groups, so local development and CI use the same dependency source of truth.Problem
The test dependencies were defined in more than one place and had drifted. In particular,
tests/py/requirements.txtpinnedtransformers==4.53.1, whilepyproject.tomlspecifiedtransformers>=5.0.0.That was risky because GitHub CI was installing from
tests/py/requirements.txt, while local development withuvuses the dependency groups inpyproject.toml. As a result, CI and local dev could resolve meaningfully different test environments.What Changed
Moved the shared Python test dependencies into the
test,test-ext, andquantizationdependency groups inpyproject.toml.Updated
.github/scripts/install-torch-tensorrt.shto install test dependencies with:pip install --group test --group test-ext --group quantizationUpdated noxfile.py to install the same dependency groups instead of tests/py/requirements.txt.
Reduced tests/py/requirements.txt to a compatibility stub for tooling that still expects the file to exist.
Updated the release checklist to point maintainers at pyproject.toml dependency groups instead of the old test requirements file.
Design Decisions
The main design choice was to make pyproject.toml the source of truth for shared test dependencies. This matches the local uv workflow and avoids maintaining duplicate package constraints in both dependency groups and a requirements file.
CI now uses native pip dependency group support instead of a custom parser or generated requirements file. This keeps the CI path simple and close to the intended interface for PEP 735 dependency groups.
install-torch-tensorrt.sh upgrades to pip>=25.1 before installing groups because pip --group support requires a recent pip. The script also installs tomli only for Python versions before 3.11 because it parses pyproject.toml to recover the torchvision requirement used later in the script.
The old tests/py/requirements.txt file is intentionally left in place as an empty compatibility stub because there is still non-CI tooling that references it by path. It no longer contains dependency constraints, so it cannot drift from pyproject.toml.
Type of change
Checklist: