-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Refactor metadata directory handling #7087
Conversation
202780a
to
c4076ea
Compare
Why: Since the result is a single directory and it's better for the resposibility of computing the exact location of the metadata directory should be with the generator, that generates it.
Why: expecting metadata_directory to exist, once metadata is generated, is easier to reason about, than considering that some kinds of distributions set it while others do not.
Why: Changes made are IMO much clearer, with a step by step flow to this method that is easier to reason about.
c4076ea
to
ec5e9d3
Compare
@@ -56,7 +62,10 @@ def _generate_metadata_legacy(install_req): | |||
command_desc='python setup.py egg_info', | |||
) | |||
|
|||
# Return the metadata directory. | |||
return install_req.find_egg_info() |
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.
A follow up PR will move this method's contents into this file.
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.
I've only had time to desk check this, but it looks OK to me.
Thanks a lot for taking a look @pfmoore! ^>^ |
I'm feeling good today, so I'm gonna go ahead and merge this since CI is happy and a different set of 👀 reviewed and did not spot any major concerns. :) |
Built on top of #7086
Closes #7088
With this PR,
InstallRequirement.metadata_directory
refers to the directory containing metadata for that object, regardless of how it was built (PEP 517 or legacy). If a metadata generator has been called on that object, themetadata_directory
would be set appropriately. This is IMO, much easier to reason about than status quo. (please don't ask me to explain how this worked in v19.2, thanks)InstallRequirement.get_dist()
works, since some of the variables it modified, have been removed.