Example #1
0
def test_build_sdist():
    with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "complete")):
        filename = api.build_sdist(tmp_dir)

        with tarfile.open(str(os.path.join(tmp_dir, filename))) as tar:
            namelist = tar.getnames()

            assert "my-package-1.2.3/LICENSE" in namelist
Example #2
0
def test_build_sdist():
    with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "complete")):
        filename = api.build_sdist(tmp_dir)
        validate_sdist_contents(
            name="my-package",
            version="1.2.3",
            path=str(os.path.join(tmp_dir, filename)),
            files=["LICENSE"],
        )
Example #3
0
def test_build_sdist_with_include() -> None:
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "with-include")):
        filename = api.build_sdist(tmp_dir)
        validate_sdist_contents(
            name="with-include",
            version="1.2.3",
            path=str(os.path.join(tmp_dir, filename)),
            files=["LICENSE"],
        )
Example #4
0
def test_build_sdist_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_sdist(tmp_dir)
    assert "does not exist" in str(err.value)
Example #5
0
def test_build_sdist_with_bad_path_dev_dep_succeeds():
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "with_bad_path_dev_dep")):
        api.build_sdist(tmp_dir)