Beispiel #1
0
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()
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
def test_list_packages(capsys):
    actions.do_list(Project())
    out, _ = capsys.readouterr()
    assert "pdm" in out
    assert "tomlkit" in out
    assert "halo" in out
Beispiel #5
0
 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
Beispiel #6
0
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()