Repository navigation
Declare the direct dependencies TRL gets transitively - #7713
Merged
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
qgallouedec
approved these changes
Oct 14, 2026
qgallouedec
left a comment
Member
There was a problem hiding this comment.
Thanks! #7648 moved the minimum-versions job to Python 3.13 after this ran on 3.12; merging main to this branch right now so that it's green (hopefully) tomorrow with 3.13
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 713143b. Configure here.
This was referenced Oct 15, 2026
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.

This PR declares
huggingface_hub,numpy,pandas,psutil,pyarrowandpyyamlas dependencies, with a floor for each.Fix #7653.
Motivation
TRL imports these six packages directly but only gets them through accelerate, datasets and transformers. If one of those drops a package or makes it optional,
import trlbreaks.Solution
Under the criterion in
CONTRIBUTING.md(#7638), a first floor drops support for nothing and only records what we test.Each floor is the higher of two versions: the floor accelerate, datasets or transformers already declare, and the oldest release with Python 3.12 wheels. None of the APIs TRL uses requires anything newer. The full suite passes with exactly these floors on Python 3.12: https://github.com/huggingface/trl/actions/runs/38434120299
huggingface_hubnumpypandaspsutilpyarrowpyyamlnumpy,pandas,psutilandpyyamlare all more than 2 years old. Their floors only exclude releases that cannot be installed on Python 3.12, plus, on Python 3.11, numpy 1.23 to 1.25 and pandas 1.5 to 2.1.0.huggingface_hubandpyarrowmatch floors the stack already enforces.pyyamlis imported lazily, but only by the CLI config parsing, which is still a direct use.torchis declared by #7642.No version guard, shim or warning filter is retired, since nothing in the code depended on a version older than these floors.
Changes
huggingface_hub>=0.34.0,numpy>=1.26.0,pandas>=2.1.1,psutil>=5.9.4,pyarrow>=21.0.0andpyyaml>=6.0.1to the project dependenciesNote
Low Risk
Packaging-only change that documents and pins already-used libraries; no runtime logic changes in this diff.
Overview
Adds explicit minimum-version dependencies for six packages TRL imports directly but previously only received transitively via
accelerate,datasets, andtransformers:huggingface_hub>=0.34.0,numpy>=1.26.0,pandas>=2.1.1,psutil>=5.9.4,pyarrow>=21.0.0, andpyyaml>=6.0.1.This hardens installs so
import trldoes not break if an upstream package drops or optionalizes one of these libraries. The chosen floors align with existing stack constraints and Python 3.12 wheel availability rather than new API requirements.Reviewed by Cursor Bugbot for commit a4faf33. Bugbot is set up for automated code reviews on this repo. Configure here.