-
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
Make --target functionality align with other install schemas #12524
base: main
Are you sure you want to change the base?
Conversation
c522a4c
to
b9ac4c0
Compare
I don’t think that this PR goes in the direction I want. We should never be simply dumping a new install over an old one. Instead, we should properly support the normal uninstall/reinstall mechanism that upgrades use. |
See #10110 (comment) |
This change now supports the normal uninstall/reinstall mechanism that upgrades use. |
Does this work if options like |
It seems to yes, I will look into writing a test for this case:
|
I assume the point about adding the location to But all of this is soemwhat secondary. The reason we install into a temp directory and then copy to the correct location at the end is for safety. If the install fails (for example, building a wheel from a sdist fails with a compile error) we can discard the temporary directory and fail with no changes made to the user's system. By installing direct into the target location, we lose this possibility, and risk a failed build leaving everything in a corrupted state. And while I'd like to say that people should only use |
If this is the case, why would installing into site-packages not work the same way? If a build failure would leave the system in an un-wanted state, wouldn't that be true across the board? I do not believe it has ever been documented that |
Sorry, I wasn't clear. One of the important properties of
Correct, it hasn't. I believe1 the original intended use case was to populate an empty directory for vendoring, and we only ever really made sure We can patch things over a bit in the meanwhile, and maybe we should. But I'm not convinced we're not just going to trade one set of problems for another. Anyway, I think we've reached a point where you're not going to convince me that your approach works, and I'm afraid I don't have time to take you through the process of writing the implementation I was hoping to get round to writing myself. Maybe one of the other pip maintainers will support this approach - I won't block it if they do, I'm very aware that I might be holding out for something that's impractical given our resources, so I want to leave the way open for the lower bar of "at least one maintainer is OK with this approach" as an option. Footnotes
|
Fair enough. For what it's worth, I'm happy to jump through whatever hoops are needed to validate this approach and/or work on improving it (including potentially taking another approach). |
54ea428
to
0e37cb0
Compare
Seems this is blocked :( . Is there a workaround for #10629 ? |
Fix for #10110
This patch makes target install packages directly to the target directory without installing to a temporary directory and the copying things to the final install location. This means
--upgrade
and--ignore-installed
now work the same as--prefix
.Additionally fixes: #9605 #10629