本文整理匯總了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