Avoid the horrendous line break for type hints
@@ -47,6 +47,7 @@ if MYPY_CHECK_RUNNING:
C = TypeVar("C")
Cache = Dict[Link, C]
+ VersionCandidates = Dict[_BaseVersion, Candidate]
class Factory(object):
@@ -130,8 +131,7 @@ class Factory(object):
# requirement needs to return only one candidate per version, so we
# implement that logic here so that requirements using this helper
# don't all have to do the same thing later.
- version_candidates = collections.OrderedDict(
- ) # type: Dict[_BaseVersion, Candidate]
+ candidates = collections.OrderedDict() # type: VersionCandidates
# Yield the installed version, if it matches, unless the user
# specified `--force-reinstall`, when we want the version from
@@ -149,7 +149,7 @@ class Factory(object):
extras=extras,
parent=ireq,
)
- version_candidates[installed_version] = candidate
+ candidates[installed_version] = candidate
found = self.finder.find_best_candidate(
project_name=ireq.req.name,
@@ -166,9 +166,9 @@ class Factory(object):
name=name,
version=ican.version,
)
- version_candidates[ican.version] = candidate
+ candidates[ican.version] = candidate
- return six.itervalues(version_candidates)
+ return six.itervalues(candidates)
def make_requirement_from_install_req(self, ireq):
# type: (InstallRequirement) -> Requirement
