Skip to content
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

Merged
merged 4 commits into from
Sep 28, 2019

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Sep 26, 2019

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, the metadata_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)

  • needed to update how InstallRequirement.get_dist() works, since some of the variables it modified, have been removed.
  • cleaned up the "move to ideal build directory location" logic and added comments based on my understanding of it as of right now.

@pradyunsg pradyunsg added type: refactor Refactoring code skip news Does not need a NEWS file entry (eg: trivial changes) labels Sep 26, 2019
@pradyunsg pradyunsg force-pushed the refactor/metadata-directory branch from 202780a to c4076ea Compare September 26, 2019 21:17
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.
@pradyunsg pradyunsg force-pushed the refactor/metadata-directory branch from c4076ea to ec5e9d3 Compare September 27, 2019 05:04
@pradyunsg pradyunsg marked this pull request as ready for review September 27, 2019 05:04
@@ -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()
Copy link
Member Author

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.

Copy link
Member

@pfmoore pfmoore left a 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.

@pradyunsg
Copy link
Member Author

Thanks a lot for taking a look @pfmoore! ^>^

@pradyunsg
Copy link
Member Author

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. :)

@pradyunsg pradyunsg merged commit 0339287 into pypa:master Sep 28, 2019
@pradyunsg pradyunsg deleted the refactor/metadata-directory branch September 28, 2019 12:04
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set InstallRequirement.metadata_directory, once metadata is generated
2 participants