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


Python wheel.Wheel方法代碼示例

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


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

示例1: _check_wheel_install

# 需要導入模塊: from setuptools import wheel [as 別名]
# 或者: from setuptools.wheel import Wheel [as 別名]
def _check_wheel_install(filename, install_dir, install_tree_includes,
                         project_name, version, requires_txt):
    w = Wheel(filename)
    egg_path = os.path.join(install_dir, w.egg_name())
    w.install_as_egg(egg_path)
    if install_tree_includes is not None:
        install_tree = format_install_tree(install_tree_includes)
        exp = tree_set(install_dir)
        assert install_tree.issubset(exp), (install_tree - exp)

    metadata = PathMetadata(egg_path, os.path.join(egg_path, 'EGG-INFO'))
    dist = Distribution.from_filename(egg_path, metadata=metadata)
    assert dist.project_name == project_name
    assert dist.version == version
    if requires_txt is None:
        assert not dist.has_metadata('requires.txt')
    else:
        assert requires_txt == dist.get_metadata('requires.txt').lstrip() 
開發者ID:pypa,項目名稱:setuptools,代碼行數:20,代碼來源:test_wheel.py

示例2: distros_for_location

# 需要導入模塊: from setuptools import wheel [as 別名]
# 或者: from setuptools.wheel 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

示例3: install_wheel

# 需要導入模塊: from setuptools import wheel [as 別名]
# 或者: from setuptools.wheel 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

示例4: test_wheel_info

# 需要導入模塊: from setuptools import wheel [as 別名]
# 或者: from setuptools.wheel import Wheel [as 別名]
def test_wheel_info(filename, info):
    if inspect.isclass(info):
        with pytest.raises(info):
            Wheel(filename)
        return
    w = Wheel(filename)
    assert {k: getattr(w, k) for k in info.keys()} == info 
開發者ID:pypa,項目名稱:setuptools,代碼行數:9,代碼來源:test_wheel.py

示例5: test_wheel_is_compatible

# 需要導入模塊: from setuptools import wheel [as 別名]
# 或者: from setuptools.wheel 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.Wheel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。