本文整理匯總了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
示例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, [])
示例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
示例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