Skip to content

Commit

Permalink
refactor much of RequirementPreparer and add length docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jul 22, 2024
1 parent 171eac5 commit 3c2aa93
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 141 deletions.
9 changes: 8 additions & 1 deletion src/pip/_internal/distributions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
def make_distribution_for_install_requirement(
install_req: InstallRequirement,
) -> AbstractDistribution:
"""Returns a Distribution for the given InstallRequirement"""
"""Returns an AbstractDistribution for the given InstallRequirement.
As AbstractDistribution only covers installable artifacts, this method may only be
invoked at the conclusion of a resolve, when the RequirementPreparer has downloaded
the file corresponding to the resolved dist. Commands which intend to consume
metadata-only resolves without downloading should not call this method or
consume AbstractDistribution objects.
"""
# Only pre-installed requirements will have a .satisfied_by dist.
if install_req.satisfied_by:
return InstalledDistribution(install_req)
Expand Down
Loading

0 comments on commit 3c2aa93

Please sign in to comment.