Move call to _fetch_metadata next to call to RequirementPreparer
Since wheels can't be editable, we can move this into LinkCandidate,
closer to `RequirementPreparer.prepare_linked_requirement` into which we
want to integrate `_fetch_metadata`.
@@ -218,9 +218,7 @@ class _InstallRequirementBackedCandidate(Candidate):
# type: () -> None
if self._dist is not None:
return
- dist = self._fetch_metadata()
try:
- if dist is None:
dist = self._prepare_distribution()
except HashError as e:
e.req = self._ireq
@@ -322,6 +320,9 @@ class LinkCandidate(_InstallRequirementBackedCandidate):
def _prepare_distribution(self):
# type: () -> Distribution
+ dist = self._fetch_metadata()
+ if dist is not None:
+ return dist
return self._factory.preparer.prepare_linked_requirement(
self._ireq, parallel_builds=True,
)
