File tree 3 files changed +181
-153
lines changed
3 files changed +181
-153
lines changed Original file line number Diff line number Diff line change
1
+ Refactor much of ``RequirementPreparer `` to avoid duplicated code paths for metadata-only requirements.
Original file line number Diff line number Diff line change 8
8
def make_distribution_for_install_requirement (
9
9
install_req : InstallRequirement ,
10
10
) -> AbstractDistribution :
11
- """Returns a Distribution for the given InstallRequirement"""
11
+ """Returns an AbstractDistribution for the given InstallRequirement.
12
+
13
+ As AbstractDistribution only covers installable artifacts, this method may only be
14
+ invoked at the conclusion of a resolve, when the RequirementPreparer has downloaded
15
+ the file corresponding to the resolved dist. Commands which intend to consume
16
+ metadata-only resolves without downloading should not call this method or
17
+ consume AbstractDistribution objects.
18
+ """
12
19
# Only pre-installed requirements will have a .satisfied_by dist.
13
20
if install_req .satisfied_by :
14
21
return InstalledDistribution (install_req )
You can’t perform that action at this time.
0 commit comments