当前位置: 首页>>代码示例>>Python>>正文


Python Distribution.fetch_build_eggs方法代码示例

本文整理汇总了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
开发者ID:Cadair,项目名称:astropy-helpers,代码行数:39,代码来源:build_sphinx.py

示例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)
开发者ID:agiledata,项目名称:pkglib,代码行数:4,代码来源:setup.py


注:本文中的setuptools.Distribution.fetch_build_eggs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。