def test_build_distributions(tmp_path): project = Project() actions.do_build(project, dest=tmp_path.as_posix()) wheel = Wheel(next(tmp_path.glob("*.whl")).as_posix()) assert wheel.name == "pdm" tarball = next(tmp_path.glob("*.tar.gz")) assert tarball.exists()
def test_list_packages(capsys, core): project = Project() project.core = core actions.do_list(project) out, _ = capsys.readouterr() assert "pdm" in out assert "tomlkit" in out assert "pip" in out
def test_list_dependency_graph(capsys): project = Project() actions.do_list(project, True) content, _ = capsys.readouterr() assert "halo 0.0.28 [ required: <1.0.0,>=0.0.28 ]" in content assert "six 1.14.0 [ required: >=1.12.0 ]" in content
def test_list_packages(capsys): actions.do_list(Project()) out, _ = capsys.readouterr() assert "pdm" in out assert "tomlkit" in out assert "halo" in out
def __init__(self, ireq: shims.InstallRequirement) -> None: self.ireq = ireq self.project = Project(ireq.unpacked_source_directory) self._old_cwd = None self.package_dir = None
def test_export_setup_py(): project = Project(FIXTURES / "projects/demo-package") content = setup_py.export(project, [], None) assert content == project.root.joinpath("setup.txt").read_text()