當前位置: 首頁>>代碼示例>>Python>>正文


Python version._BaseVersion方法代碼示例

本文整理匯總了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,
        ) 
開發者ID:ali5h,項目名稱:rules_pip,代碼行數:18,代碼來源:candidates.py

示例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 
開發者ID:ali5h,項目名稱:rules_pip,代碼行數:7,代碼來源:candidates.py

示例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 
開發者ID:ali5h,項目名稱:rules_pip,代碼行數:28,代碼來源:factory.py


注:本文中的pip._vendor.packaging.version._BaseVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。