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
pip output is confusing/incomplete when a package is pulled with different extras #11683
Comments
As an example, this made investigating vega/altair#2794 significantly harder than it should have been. |
(Opinion) - I always observed similar behaviour, and while I believe the ouput printed by Maybe future diagnostics could be improved a little in terms of historical view on why certain decisions have been made by the resolver, but not more than that IMHO From what I understand how extras work (It's not really specified I think, it's more of an observation of what I've seen), extras are always "transient" dependencies. They are only used during the run of the And to be honest it's the only "reasonable" way you could approach it, when you think of that, because as a user you could change your mind what optional extras you want to install - over time. For example imagine (example from airflow that uses extras heavily):
There are multiple scenarios here that could go wrong if you try to "remember" what optional extras have been installed the previous time. Imagine those two commands produce a different (and conflicting) set of dependencies. For example:
And those above questions are just tip of the iceberg. There are many more complex scenarios because dependencies can also be specified with extras transitively and that adds even more complexity here and quite likely leads to a number of those scenarios being impossible to solve and even to reason about. So - the choice that And I think it is a good choice. I think what can be done instead to make it easier for people like you and me is to have some kind of "audit log" of installations. I.e. to record an information about decisions made (so basically exactly what you see as output of |
Thanks for filing this @dechamps! :)
Yea, I'll consolidate this into #3797. I will agree that it's an annoying issue, but it's also frustratingly tricky because there's no metadata stored about which "extras" were installed-on-request in the environment. In the future @potiuk, I'd appreciate if you defer posting your opinion until after an issue has been triaged by triagers/maintainers -- it'd be good to avoid overwhelming reporters with various peoples' opinions as the first interaction on their issue. :)
I haven't read the entire wall of text posted (sorry, I have limited time), but I will say that I disagree with, at least, this part of what has been said. |
Sure, if you think that positing opinions (even clearly stating that this is an opinion coming from heavy users coming from an experience), I can hold a bit with my opinions not being the first response. But just wanted to note, that I find it a bit awkward approach personally. My comment was not directed to you but to help @dechamps to understand the complexities involved. I understand you have limited time as maintainer to read all messages in I think if you really want to be the first one to respond to all And BTW. I think I described pretty well the current state of the #3797 with some good examples showing the complexities involved, and I believe discussing "external way" of showing the extra dependencies is exactly what's beeing discussed in https://discuss.python.org/t/provide-information-on-installed-extras-in-package-metadata/15385 (and BTW thanks for pointing to those, this is really helpful). Maybe phrasing is a little "lame" (from the user's perspective).
Yep. You are right. I think that was slightly incorrect. It is kept in package metadata of course. I realised after reading the discussion you pointed out to that there is no extra information that |
Description
Consider the following:
pip install A
will end up pulling E, which is correct. However, it is extremely difficult to figure out why, as the outputs of bothpip install --verbose --verbose --verbose
and the output ofpip show
are incomplete/misleading. Other tools such aspipdeptree
can't figure it out either.Expected behavior
No response
pip version
22.3
Python version
3.10
OS
Debian Unstable
How to Reproduce
jupyter_events
is installed becausenbclassic
specifies:jsonschema
is installed with theformat-nongpl
extra becausejupyter_events
specifies:And, crucially,
nbformat
(andfastjsonschema
) also specifies:rfc3986-validator
is installed becausejsonformat
specifies:…and the
format-nongpl
extra is enabled forjsonformat
fromjupyter_events
(see above).Output
The output of
bin/pip --verbose --verbose --verbose install nbclassic
contains:The path shown is wrong and misleading.
nbformat
does not pullrfc3986-validator
throughjsonschema
becausenbformat
does not specify theformat-nongpl
extra forjsonschema
. The correct output should have been:pip info jupyter_events
does not mention that it depends on theformat-nongpl
extra ofjsonschema
:pip info jsonschema
does not mention anything aboutrfc3986-validator
:And finally, to add insult to injury,
pip info rfc3986-validator
claims it's not required by anything, which is clearly a lie since it was pulled by a dependency (jsonschema[format-nongpl]
)!Because of the above, it took me hours to figure out why
pip install jupyter
ends up pullingrfc3986-validator
.Code of Conduct
The text was updated successfully, but these errors were encountered: