本文整理汇总了Python中setuptools.Distribution.fetch_build_eggs方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.fetch_build_eggs方法的具体用法?Python Distribution.fetch_build_eggs怎么用?Python Distribution.fetch_build_eggs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.Distribution
的用法示例。
在下文中一共展示了Distribution.fetch_build_eggs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ensure_sphinx_astropy_installed
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import fetch_build_eggs [as 别名]
def ensure_sphinx_astropy_installed():
"""
Make sure that sphinx-astropy is available, installing it temporarily if not.
This returns the available version of sphinx-astropy as well as any
paths that should be added to sys.path for sphinx-astropy to be available.
"""
# We've split out the Sphinx part of astropy-helpers into sphinx-astropy
# but we want it to be auto-installed seamlessly for anyone using
# build_docs. We check if it's already installed, and if not, we install
# it to a local .eggs directory and add the eggs to the path (these
# have to each be added to the path, we can't add them by simply adding
# .eggs to the path)
sys_path_inserts = []
sphinx_astropy_version = None
try:
from sphinx_astropy import __version__ as sphinx_astropy_version # noqa
except ImportError:
from setuptools import Distribution
dist = Distribution()
eggs = dist.fetch_build_eggs('sphinx-astropy')
# Find out the version of sphinx-astropy if possible. For some old
# setuptools version, eggs will be None even if sphinx-astropy was
# successfully installed.
if eggs is not None:
for egg in eggs:
if egg.project_name == 'sphinx-astropy':
sphinx_astropy_version = egg.parsed_version.public
break
eggs_path = os.path.abspath('.eggs')
for egg in glob.glob(os.path.join(eggs_path, '*.egg')):
sys_path_inserts.append(egg)
return sphinx_astropy_version, sys_path_inserts
示例2: fetch_build_eggs
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import fetch_build_eggs [as 别名]
def fetch_build_eggs(requires, dist):
return Distribution.fetch_build_eggs(dist, requires)