Example #1
0
def test_build_wheel_extended():
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "extended")):
        filename = api.build_wheel(tmp_dir)
        whl = Path(tmp_dir) / filename
        assert whl.exists()
        validate_wheel_contents(name="extended",
                                version="0.1",
                                path=whl.as_posix())
Example #2
0
def test_build_wheel_with_include():
    with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "with-include")):
        filename = api.build_wheel(tmp_dir)
        validate_wheel_contents(
            name="with_include",
            version="1.2.3",
            path=str(os.path.join(tmp_dir, filename)),
            files=["entry_points.txt"],
        )
Example #3
0
def test_build_wheel() -> None:
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "complete")):
        filename = api.build_wheel(tmp_dir)
        validate_wheel_contents(
            name="my_package",
            version="1.2.3",
            path=str(os.path.join(tmp_dir, filename)),
            files=["entry_points.txt"],
        )
Example #4
0
def test_build_editable_wheel():
    pkg_dir = Path(fixtures) / "complete"

    with temporary_directory() as tmp_dir, cwd(pkg_dir):
        filename = api.build_editable(tmp_dir)
        wheel_pth = Path(tmp_dir) / filename

        validate_wheel_contents(
            name="my_package",
            version="1.2.3",
            path=str(wheel_pth),
        )

        with zipfile.ZipFile(wheel_pth) as z:
            namelist = z.namelist()

            assert "my_package.pth" in namelist
            assert pkg_dir.as_posix() == z.read(
                "my_package.pth").decode().strip()