-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fail installation on conflicting package metadata #7179
Comments
Concerning the name, it was initially the case in #3153 but we feared it would break too many things. Concerning the version, it also makes sense (and it could be included in the same Concerning the
|
PEP 427 mentions that
IMO, barring some very widespread issue, any lack of consistency is enough to justify aborting installation. In my mind the error message would clearly indicate the culprit package and working around it as a user would require explicitly excluding the offending version (via constraints/requirements) and ideally reporting the issue to the package maintainer who would then yank that specific version. This is already the case right now - if a user is not pinning to a specific version/hash and a package maintainer releases a new version that has any issue, then that breaks everyone until the package is yanked or an updated version released. Noting that doing this responsibly would require implementing build system requirement overrides (for build dependencies of dependencies) like mentioned here. |
👍 I forgot that detail and we currently do not check the content of this file as far as I know.
IMO, the point of crashing for inconsistent name & version is clear: For the wheel tag & python_requires cases, I find the gain less clear. In summary, I'm totally on board for name & version checks and currently somewhat lukewarm for additional checks :) |
@pfmoore @uranusjr related to |
@pradyunsg @pfmoore @uranusjr My current reading is that this is not something we must resolve before releasing 20.2b2, so I'm removing it from the "to do before beta" column in the Resolver Rollout board; please correct if I'm wrong. |
Just to note, the new resolver already emits a nice-ish error message for name and version mismatches, implemented in #8476. The |
If anyone is opposed to making mismatching If no one raises concerns by the end of this week, I'll move forward to make this happen.
Notes for future me: The new resolver does handle the first two cases currently, and makes them a hard error. For the last one, I'm not 100% sure what mismatching wheel tags could look like. For the |
FWIW this broke the build on a legacy project that I maintain. It uses a package that has not changed in many years, but happens to have a different name in the metadata from the package name. I have very shallow knowledge when it comes to packaging and installing. I have not found any way to disable this error directly, but I found I could prevent it by changing the requirements line from something like |
The |
With #9264, the only thing undone (and undecided) here is whether we should reject a package if its |
I’m in agreement. Let’s wrap it up. |
I misclicked but feel free to reopen lol |
What's the problem this feature will solve?
Currently pip outputs a warning if package metadata does not align with the package name indicated in a direct URL or
#egg=
fragment.Examples:
The warning is traced from here.
Describe the solution you'd like
I would like this to be a hard failure, and I think we should apply the same policy across-the-board with respect to metadata. If information acquired at one stage in package processing (whether provided by the user or derived some other way) doesn't match the metadata determined at a later stage for the same package, then the whole installation process should fail.
The kinds of metadata I had in mind specifically were:
#egg=
fragment, or simple API)#egg=
fragment or simple API)data-requires-python
in simple API)Taking this approach would ensure that the dependency resolution in #988 isn't made more complicated or delayed due to backwards-compatibility concerns.
Alternative Solutions
If we can't fully trust the metadata other than from the package itself, then either:
setup.py egg_info
,prepare_metadata_for_build_wheel
, or*.dist-info/METADATA
in a wheel) - very time-consuming as we have to download all packages, orAdditional context
The text was updated successfully, but these errors were encountered: