-
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
Add --dry-run option to pip install #11096
Conversation
e57e1d2
to
2cdca0b
Compare
My understanding from #53 was that the concensus is to put such functionality into a separate |
@pradyunsg It is not entirely clear to me there was a clear consensus in #53, which is a very long thread. And #10748 shows that other people understood it as an extension of pip download. But yes I am proposing that instead of pip resolve, we allow the composition of 3 pip install options: This PR is one of several I propose for ease of review (see the full plan in #10771 (comment)). |
@pradyunsg to elaborate a little bit, I am not opposed to a |
ebcefbe
to
3f4da4d
Compare
Thanks @uranusjr. Change applied. |
Hm, Not sure why there is no metadata directory in that case because it did log I'd be inclined to say that some modern pip feature require the new resolver... |
3f4da4d
to
7cdc1aa
Compare
Hm, and now that I have fixed the assert to properly show the requirement in error, I notice the problem comes from an already installed requirement that is somehow returned by the legacy resolver. Weird, I'll need to dig into this. |
If it only happens on the legacy resolver (still need to make sure of this, of course), it’s probably OK to simply filter those out manually. |
@uranusjr actually it looks like the legacy resolver retunrs already installed requirements, and they are filtered out later by resolver.get_installation_order. So yeah, this discrepancy is annoying and I think I'll make |
OTOH if we call get_installation_order when printing what would be installed it does the job even though it is not very nice. But we can drop that together with the legacy resolver so it is not a debt we'll need to carry for a long time hopefully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks reasonable to me.
183e47f
to
0f6605e
Compare
Alright, it looks like this is not done done yet :/ I found out that get_installation_order can't be called twice because with the new resolver it modifies the result graph and the second call fails. And with the current approach we'd need to call it twice for the installation report. So I'm considering to do |
Oki, now with the last commit it should be good. |
Before it did support only requirements that had their metadata prepared to a local directory. WIth wheels that does not happen so we need to handle that case too. get_dist() is used by the metadata property of InstallRequirement, which in turn is useful to obtain metadata of the RequirementSet returned by the resolver.
Co-authored-by: Tzu-ping Chung <[email protected]>
This property is necessary because the legacy resolver returns requirements that need not be installed.
86758b5
to
701a5d6
Compare
If there are no more comments on this one I plan to merge on Sunday or so. |
Thanks for the review @uranusjr ! |
This options simply prints what pip would install instead of actually installing.
The output is human readable and mimics what an actual pip install prints.
It is not intended to be parsed by tools: that will be added by the
--report
option which will produce a rich json output.Towards #53 and #10771.