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


Python FrozenRequirement.from_dist方法代碼示例

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


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

示例1: dist_is_editable

# 需要導入模塊: from pip import FrozenRequirement [as 別名]
# 或者: from pip.FrozenRequirement import from_dist [as 別名]
def dist_is_editable(dist):
    """Is distribution an editable install?"""
    #TODO: factor out determining editableness out of FrozenRequirement
    from pip import FrozenRequirement
    req = FrozenRequirement.from_dist(dist, [])
    return req.editable 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:8,代碼來源:util.py

示例2: frozen_req_from_dist

# 需要導入模塊: from pip import FrozenRequirement [as 別名]
# 或者: from pip.FrozenRequirement import from_dist [as 別名]
def frozen_req_from_dist(dist):
    try:
        return FrozenRequirement.from_dist(dist)
    except TypeError:
        return FrozenRequirement.from_dist(dist, []) 
開發者ID:naiquevin,項目名稱:pipdeptree,代碼行數:7,代碼來源:pipdeptree.py

示例3: dist_is_editable

# 需要導入模塊: from pip import FrozenRequirement [as 別名]
# 或者: from pip.FrozenRequirement import from_dist [as 別名]
def dist_is_editable(dist):
    """Is distribution an editable install?"""
    # TODO: factor out determining editableness out of FrozenRequirement
    from pip import FrozenRequirement
    req = FrozenRequirement.from_dist(dist, [])
    return req.editable 
開發者ID:chalasr,項目名稱:Flask-P2P,代碼行數:8,代碼來源:__init__.py

示例4: dist_to_req

# 需要導入模塊: from pip import FrozenRequirement [as 別名]
# 或者: from pip.FrozenRequirement import from_dist [as 別名]
def dist_to_req(dist):
    """Make a pip.FrozenRequirement from a pkg_resources distribution object"""
    try:  # :pragma:nocover: (pip>=10)
        from pip._internal.operations.freeze import FrozenRequirement
    except ImportError:  # :pragma:nocover: (pip<10)
        from pip import FrozenRequirement

    # normalize the casing, dashes in the req name
    orig_name, dist.project_name = dist.project_name, dist.key
    result = FrozenRequirement.from_dist(dist, [])
    # put things back the way we found it.
    dist.project_name = orig_name

    return result 
開發者ID:Yelp,項目名稱:venv-update,代碼行數:16,代碼來源:pip_faster.py


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