Beispiel #1
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"],
        )
Beispiel #2
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())
Beispiel #3
0
def test_build_wheel():
    with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "complete")):
        filename = api.build_wheel(tmp_dir)

        with zipfile.ZipFile(str(os.path.join(tmp_dir, filename))) as zip:
            namelist = zip.namelist()

            assert "my_package-1.2.3.dist-info/entry_points.txt" in namelist
            assert "my_package-1.2.3.dist-info/WHEEL" in namelist
            assert "my_package-1.2.3.dist-info/METADATA" in namelist
Beispiel #4
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"],
        )
Beispiel #5
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()

        with zipfile.ZipFile(str(os.path.join(tmp_dir, filename))) as zip:
            namelist = zip.namelist()

            assert "extended-0.1.dist-info/RECORD" in namelist
            assert "extended-0.1.dist-info/WHEEL" in namelist
            assert "extended-0.1.dist-info/METADATA" in namelist
Beispiel #6
0
def test_build_wheel_with_bad_path_dep_fails():
    with pytest.raises(
            ValueError) as err, temporary_directory() as tmp_dir, cwd(
                os.path.join(fixtures, "with_bad_path_dep")):
        api.build_wheel(tmp_dir)
    assert "does not exist" in str(err.value)
Beispiel #7
0
def test_build_wheel_with_bad_path_dev_dep_succeeds():
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "with_bad_path_dev_dep")):
        api.build_wheel(tmp_dir)