示例#1
0
def _common_wheel_editable_install(
    tmpdir_factory: pytest.TempdirFactory, common_wheels: Path, package: str
) -> Path:
    wheel_candidates = list(common_wheels.glob(f"{package}-*.whl"))
    assert len(wheel_candidates) == 1, wheel_candidates
    install_dir = Path(str(tmpdir_factory.mktemp(package))) / "install"
    Wheel(wheel_candidates[0]).install_as_egg(install_dir)
    (install_dir / "EGG-INFO").rename(install_dir / f"{package}.egg-info")
    assert compileall.compile_dir(str(install_dir), quiet=1)
    return install_dir