Beispiel #1
0
def test_handover_setup_requires(tmpfolder, existing_config):
    # Given an existing setup.cfg with setup_requires
    # when we update it
    opts = {"project_path": tmpfolder, "pretend": False}
    update.handover_setup_requires({}, opts)
    cfg = info.read_setupcfg(existing_config)
    # then setup_requirements should not be included
    assert "setup_requires" not in str(cfg["options"])
Beispiel #2
0
def test_handover_setup_requires_no_pyproject(tmpfolder, existing_config):
    # Given an existing setup.cfg with outdated setup_requires and pyscaffold version,
    # when we update it without no_pyproject
    opts = {
        "project_path": tmpfolder,
        "pretend": False,
        "isolated_build": False
    }
    update.handover_setup_requires({}, opts)
    cfg = info.read_setupcfg(existing_config)
    # then setup_requirements is left alone
    assert cfg["options"]["setup_requires"]
Beispiel #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