예제 #1
0
def test_update_pyproject_toml(tmpfolder, pyproject_from_old_extension):
    update.update_pyproject_toml({}, {
        "project_path": tmpfolder,
        "pretend": False
    })
    pyproject = info.read_pyproject(pyproject_from_old_extension)
    deps = " ".join(pyproject["build-system"]["requires"])
    assert "setuptools_scm" in deps
    assert "setuptools.build_meta" in pyproject["build-system"][
        "build-backend"]
    assert "setuptools_scm" in pyproject["tool"]
예제 #2
0
def test_putup(cwd, putup):
    # Given pyscaffold is installed,
    # when we run putup
    run(f"{putup} myproj")
    # then no error should be raised when running the common tasks
    with cwd.join("myproj").as_cwd():
        # then the new version of PyScaffold should produce packages with
        # the correct build deps
        pyproject_toml = read_pyproject(".")
        stored_deps = " ".join(pyproject_toml["build-system"]["requires"])
        for dep in BUILD_DEPS:
            assert dep in stored_deps
        # and no error should be raised when running the common tasks
        run_common_tasks()
예제 #3
0
def test_migrate_setup_requires(tmpfolder, existing_config):
    # When a project with setup.cfg :: setup_requires is updated
    opts = {"project_path": tmpfolder, "pretend": False}
    _, opts = update.handover_setup_requires({}, opts)
    update.update_pyproject_toml({}, opts)
    # then the minimal dependencies are added
    pyproject = info.read_pyproject(tmpfolder)
    deps = " ".join(pyproject["build-system"]["requires"])
    assert "setuptools_scm" in deps
    # old dependencies are migrated from setup.cfg
    assert "somedep>=3.8" in deps
    setupcfg = info.read_setupcfg(existing_config)
    assert "setup_requires" not in setupcfg["options"]
    # but pyscaffold is not included.
    assert "pyscaffold" not in deps