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


Python setuptools.wheel方法代码示例

本文整理汇总了Python中setuptools.wheel方法的典型用法代码示例。如果您正苦于以下问题:Python setuptools.wheel方法的具体用法?Python setuptools.wheel怎么用?Python setuptools.wheel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在setuptools的用法示例。


在下文中一共展示了setuptools.wheel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: distros_for_location

# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import wheel [as 别名]
def distros_for_location(location, basename, metadata=None):
    """Yield egg or source distribution objects based on basename"""
    if basename.endswith('.egg.zip'):
        basename = basename[:-4]  # strip the .zip
    if basename.endswith('.egg') and '-' in basename:
        # only one, unambiguous interpretation
        return [Distribution.from_location(location, basename, metadata)]
    if basename.endswith('.whl') and '-' in basename:
        wheel = Wheel(basename)
        if not wheel.is_compatible():
            return []
        return [Distribution(
            location=location,
            project_name=wheel.project_name,
            version=wheel.version,
            # Increase priority over eggs.
            precedence=EGG_DIST + 1,
        )]
    if basename.endswith('.exe'):
        win_base, py_ver, platform = parse_bdist_wininst(basename)
        if win_base is not None:
            return interpret_distro_name(
                location, win_base, metadata, py_ver, BINARY_DIST, platform
            )
    # Try source distro extensions (.zip, .tgz, etc.)
    #
    for ext in EXTENSIONS:
        if basename.endswith(ext):
            basename = basename[:-len(ext)]
            return interpret_distro_name(location, basename, metadata)
    return []  # no extension matched 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:33,代码来源:package_index.py

示例2: install_wheel

# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import wheel [as 别名]
def install_wheel(self, wheel_path, tmpdir):
        wheel = Wheel(wheel_path)
        assert wheel.is_compatible()
        destination = os.path.join(self.install_dir, wheel.egg_name())
        destination = os.path.abspath(destination)
        if not self.dry_run:
            ensure_directory(destination)
        if os.path.isdir(destination) and not os.path.islink(destination):
            dir_util.remove_tree(destination, dry_run=self.dry_run)
        elif os.path.exists(destination):
            self.execute(
                os.unlink,
                (destination,),
                "Removing " + destination,
            )
        try:
            self.execute(
                wheel.install_as_egg,
                (destination,),
                ("Installing %s to %s") % (
                    os.path.basename(wheel_path),
                    os.path.dirname(destination)
                ),
            )
        finally:
            update_dist_caches(destination, fix_zipimporter_caches=False)
        self.add_output(destination)
        return self.egg_distribution(destination) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:30,代码来源:easy_install.py

示例3: test_wheel_is_compatible

# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import wheel [as 别名]
def test_wheel_is_compatible(monkeypatch):
    def sys_tags():
        for t in parse_tag('cp36-cp36m-manylinux1_x86_64'):
            yield t
    monkeypatch.setattr('setuptools.wheel.sys_tags', sys_tags)
    assert Wheel(
        'onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl').is_compatible() 
开发者ID:pypa,项目名称:setuptools,代码行数:9,代码来源:test_wheel.py


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