-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix new dependency-groups feature to use the stdlib tomllib where possible #13356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1ce4661
to
9665fc5
Compare
…sible Previously, commit 88c9f31 modified pip to use the stdlib on versions of python where this module is in the stdlib. As justified there: Although a tomli copy is vendored, doing this conditional import allows: - automatically upgrading the code, when the time comes to drop py3.10 support - slightly simplifying debundling support, as it's no longer necessary to depend on a tomli(-wheel)? package on sufficiently newer versions of python. pypa#13065 added a new feature, including a vendored "dependency_groups" library that likewise supports using the stdlib tomllib via `dependency_groups/_toml_compat.py`. But the code in pip itself to use dependency_groups manually loads pyproject.toml and passes it to dependency_groups, and fails to use the same compatibility dispatch as both the pre-existing pip code and dependency_groups itself. Add back the conditional logic.
Please hold off on merging this. I don't feel that it counts as a bug fix, and I want to avoid introducing extra changes into a potential 25.1.1 release, if needed. I'm happy to review whether this should be included if we need a 25.1.1, but let's not pre-judge that question for now. |
It caused a problem for me
|
I don't understand this test failure, it doesn't seem possible to have happened because of the changes in this PR. It is also reproducible in this scheduled cron job: https://github.com/pypa/pip/actions/runs/14697699388 |
Maybe due to setuptools 80, released yesterday, which changed editable installs. |
Until I hear otherwise, I'll assume my PR is entirely fine and passes all tests. They pass in my local environment to my satisfaction, though it's not the same as the CI environment so I cannot assert any guarantees. |
Attempt to make tests green again in #13357 |
@NHOrus that looks like a bug with the Gentoo distribution of pip, if you think there is a bug with source pip or are asking to make a change based on helping distributions out please make a new issue and we can discuss there. |
Previously, commit 88c9f31 modified pip to use the stdlib on versions of python where this module is in the stdlib. As justified there:
Although a tomli copy is vendored, doing this conditional import allows:
automatically upgrading the code, when the time comes to drop py3.10 support
slightly simplifying debundling support, as it's no longer necessary to depend on a tomli(-wheel)? package on sufficiently newer versions of python.
#13065 added a new feature, including a vendored "dependency_groups" library that likewise supports using the stdlib tomllib via
dependency_groups/_toml_compat.py
. But the code in pip itself to use dependency_groups manually loads pyproject.toml and passes it to dependency_groups, and fails to use the same compatibility dispatch as both the pre-existing pip code and dependency_groups itself.Add back the conditional logic.