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


Python TestPyPI.file_storage_domain方法代碼示例

本文整理匯總了Python中pip._internal.models.index.TestPyPI.file_storage_domain方法的典型用法代碼示例。如果您正苦於以下問題:Python TestPyPI.file_storage_domain方法的具體用法?Python TestPyPI.file_storage_domain怎麽用?Python TestPyPI.file_storage_domain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pip._internal.models.index.TestPyPI的用法示例。


在下文中一共展示了TestPyPI.file_storage_domain方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: install_req_from_req

# 需要導入模塊: from pip._internal.models.index import TestPyPI [as 別名]
# 或者: from pip._internal.models.index.TestPyPI import file_storage_domain [as 別名]
def install_req_from_req(
    req, comes_from=None, isolated=False, wheel_cache=None
):
    try:
        req = Requirement(req)
    except InvalidRequirement:
        raise InstallationError("Invalid requirement: '%s'" % req)

    domains_not_allowed = [
        PyPI.file_storage_domain,
        TestPyPI.file_storage_domain,
    ]
    if req.url and comes_from.link.netloc in domains_not_allowed:
        # Explicitly disallow pypi packages that depend on external urls
        raise InstallationError(
            "Packages installed from PyPI cannot depend on packages "
            "which are not also hosted on PyPI.\n"
            "%s depends on %s " % (comes_from.name, req)
        )

    return InstallRequirement(
        req, comes_from, isolated=isolated, wheel_cache=wheel_cache
    ) 
開發者ID:luckystarufo,項目名稱:pySINDy,代碼行數:25,代碼來源:constructors.py

示例2: install_req_from_req_string

# 需要導入模塊: from pip._internal.models.index import TestPyPI [as 別名]
# 或者: from pip._internal.models.index.TestPyPI import file_storage_domain [as 別名]
def install_req_from_req_string(
    req_string,  # type: str
    comes_from=None,  # type: Optional[InstallRequirement]
    isolated=False,  # type: bool
    wheel_cache=None,  # type: Optional[WheelCache]
    use_pep517=None  # type: Optional[bool]
):
    # type: (...) -> InstallRequirement
    try:
        req = Requirement(req_string)
    except InvalidRequirement:
        raise InstallationError("Invalid requirement: '%s'" % req_string)

    domains_not_allowed = [
        PyPI.file_storage_domain,
        TestPyPI.file_storage_domain,
    ]
    if (req.url and comes_from and comes_from.link and
            comes_from.link.netloc in domains_not_allowed):
        # Explicitly disallow pypi packages that depend on external urls
        raise InstallationError(
            "Packages installed from PyPI cannot depend on packages "
            "which are not also hosted on PyPI.\n"
            "%s depends on %s " % (comes_from.name, req)
        )

    return InstallRequirement(
        req, comes_from, isolated=isolated, wheel_cache=wheel_cache,
        use_pep517=use_pep517
    ) 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:32,代碼來源:constructors.py

示例3: install_req_from_req_string

# 需要導入模塊: from pip._internal.models.index import TestPyPI [as 別名]
# 或者: from pip._internal.models.index.TestPyPI import file_storage_domain [as 別名]
def install_req_from_req_string(
    req_string,  # type: str
    comes_from=None,  # type: Optional[InstallRequirement]
    isolated=False,  # type: bool
    wheel_cache=None,  # type: Optional[WheelCache]
    use_pep517=None  # type: Optional[bool]
):
    # type: (...) -> InstallRequirement
    try:
        req = Requirement(req_string)
    except InvalidRequirement:
        raise InstallationError("Invalid requirement: '%s'" % req)

    domains_not_allowed = [
        PyPI.file_storage_domain,
        TestPyPI.file_storage_domain,
    ]
    if req.url and comes_from.link.netloc in domains_not_allowed:
        # Explicitly disallow pypi packages that depend on external urls
        raise InstallationError(
            "Packages installed from PyPI cannot depend on packages "
            "which are not also hosted on PyPI.\n"
            "%s depends on %s " % (comes_from.name, req)
        )

    return InstallRequirement(
        req, comes_from, isolated=isolated, wheel_cache=wheel_cache,
        use_pep517=use_pep517
    ) 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:31,代碼來源:constructors.py

示例4: install_req_from_req_string

# 需要導入模塊: from pip._internal.models.index import TestPyPI [as 別名]
# 或者: from pip._internal.models.index.TestPyPI import file_storage_domain [as 別名]
def install_req_from_req_string(
    req_string,  # type: str
    comes_from=None,  # type: Optional[InstallRequirement]
    isolated=False,  # type: bool
    use_pep517=None  # type: Optional[bool]
):
    # type: (...) -> InstallRequirement
    try:
        req = Requirement(req_string)
    except InvalidRequirement:
        raise InstallationError("Invalid requirement: '{}'".format(req_string))

    domains_not_allowed = [
        PyPI.file_storage_domain,
        TestPyPI.file_storage_domain,
    ]
    if (req.url and comes_from and comes_from.link and
            comes_from.link.netloc in domains_not_allowed):
        # Explicitly disallow pypi packages that depend on external urls
        raise InstallationError(
            "Packages installed from PyPI cannot depend on packages "
            "which are not also hosted on PyPI.\n"
            "{} depends on {} ".format(comes_from.name, req)
        )

    return InstallRequirement(
        req, comes_from, isolated=isolated, use_pep517=use_pep517
    ) 
開發者ID:ali5h,項目名稱:rules_pip,代碼行數:30,代碼來源:constructors.py


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