提交 7511737e 编写于 作者: T Tzu-ping Chung

AlreadyInstalledCandidate

上级 f061f3f6
......@@ -154,7 +154,7 @@ class LinkCandidate(Candidate):
return self._ireq
class InstalledCandidate(Candidate):
class AlreadyInstalledCandidate(Candidate):
def __init__(
self,
dist, # type: Distribution
......@@ -219,8 +219,12 @@ class ExtrasCandidate(Candidate):
version 2.0. Having those candidates depend on foo=1.0 and foo=2.0
respectively forces the resolver to recognise that this is a conflict.
"""
def __init__(self, base, extras):
# type: (Union[InstalledCandidate, LinkCandidate], Set[str]) -> None
def __init__(
self,
base, # type: Union[AlreadyInstalledCandidate, LinkCandidate]
extras, # type: Set[str]
):
# type: (...) -> None
self.base = base
self.extras = extras
......
......@@ -7,8 +7,8 @@ from pip._vendor.pkg_resources import (
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
from .candidates import (
AlreadyInstalledCandidate,
ExtrasCandidate,
InstalledCandidate,
LinkCandidate,
RequiresPythonCandidate,
)
......@@ -60,7 +60,7 @@ class Factory(object):
parent, # type: InstallRequirement
):
# type: (...) -> Candidate
base = InstalledCandidate(dist, parent, factory=self)
base = AlreadyInstalledCandidate(dist, parent, factory=self)
if extras:
return ExtrasCandidate(base, extras)
return base
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册