- Notifications
You must be signed in to change notification settings - Fork 3.2k
unpack metadata-only sdists after downloading them with the BatchDownloader #12197
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
unpack metadata-only sdists after downloading them with the BatchDownloader #12197
Conversation
300550c to fd0e223 Compare b76e180 to 16b4bb7 Compare 2294b81 to cc9e3bd Compare cc9e3bd to 834a887 Compare
uranusjr left a comment
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.
The change combining with the added comments makes sense to me. I assume some of the weird structure (for example the added if not req.is_wheel block kind of duplicates code) would be cleaned up later.
By "would be cleaned up later" do you mean "in later commits to this PR" or "in a future PR"? Because I'm wary of the latter - we have enough hard-to-understand legacy code in pip without adding more, so I'd rather not merge this without those fixups being already completed (at least in a follow-up PR that's ready to merge). Disclaimer: I haven't reviewed this PR (or any of @cosmicexplorer's current work) yet, as it all seems to be changing too fast at the moment for me to feel it's worth trying to keep up. |
| Oh, I'm sorry @pfmoore. I have been using the draft status for #12186 to indicate that it's not ready yet, but I did intend the undrafted ones to remain pretty stable. I'm not in a hurry to get this merged but this change in particular I think is quite orthogonal to the rest and specifically resolves the earlier issue you identified. |
| This one would also be helpful to get in earlier because it moves the test framework to generate a local pypi index into conftest.py, which is used by #12186 and others, but I'd love to make sure I'm not missing some existing test facility to do that. |
| It's not a problem, I mostly just monitor stuff via the emails that come through, and I haven't had time to keep close track of what's what between the various PRs. The emails don't make "this is a draft" particularly visible, which is also not ideal. I'll see if I can find some time in the next few days to take a look at this, but don't wait on me doing so. As long as there's a definite action to keep things maintainable, that's my main concern. |
| Hmm, @uranusjr I also agree with you here:
I can try to improve this. |
6347ea7 to 627c884 Compare | Ok, this solution adds (yet another) attribute |
480cda8 to f7dd273 Compare f7dd273 to fb0d7e9 Compare
uranusjr left a comment
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.
Looks good to me!
c4e440e to 39da6e0 Compare | This change also conclusively solves an issue which blocked a prior release (and adds tests), without introducing any new behavior, so it should be easier to sign off on than those two. I'll fix up the OP so the commit message is useful. |
| I’ll let this go in if no-one objects until the end of this weekend (anywhere on earth) |
Fixes #11847.
Problem
Following up on @pfmoore's comment at 7ad477e#r1280931823: the reason sdists are in an inconsistent state when we have metadata is because we don't unpack the sdist after downloading it, the way we do with
unpack_url()all in one go in the normal code path (see https://github.com/cosmicexplorer/pip/blob/e860f2d0534d2ac6958d6ce34d134c0882a030c3/src/pip/_internal/operations/prepare.py#L593-L602).Solution
.needs_unpacked_archive()and.ensure_pristine_source_checkout()methods toInstallRequirement._complete_partial_requirements()with theBatchDownloader, make sure to unpack it after preparing the source directory in._prepare_linked_requirement().test_download_metadata_server()that verifies we only ever download any dist exactly once when metadata is available.