本文整理汇总了Python中pip._vendor.packaging.version._BaseVersion方法的典型用法代码示例。如果您正苦于以下问题:Python version._BaseVersion方法的具体用法?Python version._BaseVersion怎么用?Python version._BaseVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip._vendor.packaging.version
的用法示例。
在下文中一共展示了version._BaseVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pip._vendor.packaging import version [as 别名]
# 或者: from pip._vendor.packaging.version import _BaseVersion [as 别名]
def __init__(
self,
link, # type: Link
parent, # type: InstallRequirement
factory, # type: Factory
name=None, # type: Optional[str]
version=None, # type: Optional[_BaseVersion]
):
# type: (...) -> None
super(LinkCandidate, self).__init__(
link=link,
ireq=make_install_req_from_link(link, parent),
factory=factory,
name=name,
version=version,
)
示例2: version
# 需要导入模块: from pip._vendor.packaging import version [as 别名]
# 或者: from pip._vendor.packaging.version import _BaseVersion [as 别名]
def version(self):
# type: () -> _BaseVersion
if self._version is None:
self._version = self.dist.parsed_version
return self._version
示例3: _make_candidate_from_link
# 需要导入模块: from pip._vendor.packaging import version [as 别名]
# 或者: from pip._vendor.packaging.version import _BaseVersion [as 别名]
def _make_candidate_from_link(
self,
link, # type: Link
extras, # type: Set[str]
parent, # type: InstallRequirement
name=None, # type: Optional[str]
version=None, # type: Optional[_BaseVersion]
):
# type: (...) -> Candidate
# TODO: Check already installed candidate, and use it if the link and
# editable flag match.
if parent.editable:
if link not in self._editable_candidate_cache:
self._editable_candidate_cache[link] = EditableCandidate(
link, parent, factory=self, name=name, version=version,
)
base = self._editable_candidate_cache[link] # type: BaseCandidate
else:
if link not in self._link_candidate_cache:
self._link_candidate_cache[link] = LinkCandidate(
link, parent, factory=self, name=name, version=version,
)
base = self._link_candidate_cache[link]
if extras:
return ExtrasCandidate(base, extras)
return base