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"]
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