From 7aae8d1687af3ce1c5dad7f19485ea6027d57bae Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Thu, 27 Apr 2023 10:21:05 +0200 Subject: chore: bump min setuptools version to 61 required for pyproject.toml support in setuptools --- src/setuptools_scm/integration.py | 19 ++++--------------- testing/test_integration.py | 6 +++--- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/setuptools_scm/integration.py b/src/setuptools_scm/integration.py index 9df4f3e..42ea95d 100644 --- a/src/setuptools_scm/integration.py +++ b/src/setuptools_scm/integration.py @@ -26,27 +26,16 @@ if TYPE_CHECKING: def _warn_on_old_setuptools(_version: str = setuptools.__version__) -> None: - if int(_version.split(".")[0]) < 45: + if int(_version.split(".")[0]) < 61: warnings.warn( RuntimeWarning( f""" -ERROR: setuptools=={_version} is used in combination with setuptools_scm>=6.x +ERROR: setuptools=={_version} is used in combination with setuptools_scm>=8.x Your build configuration is incomplete and previously worked by accident! -setuptools_scm requires setuptools>=45 +setuptools_scm requires setuptools>=61 - -This happens as setuptools is unable to replace itself when a activated build dependency -requires a more recent setuptools version -(it does not respect "setuptools>X" in setup_requires). - - -setuptools>=31 is required for setup.cfg metadata support -setuptools>=42 is required for pyproject.toml configuration support - -Suggested workarounds if applicable: - - preinstalling build dependencies like setuptools_scm before running setup.py - - installing setuptools_scm using the system package manager to ensure consistency +Suggested workaround if applicable: - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools diff --git a/testing/test_integration.py b/testing/test_integration.py index c0594ad..06cc95c 100644 --- a/testing/test_integration.py +++ b/testing/test_integration.py @@ -139,9 +139,9 @@ def test_pretend_version_accepts_bad_string( def testwarn_on_broken_setuptools() -> None: - _warn_on_old_setuptools("45") - with pytest.warns(RuntimeWarning, match="ERROR: setuptools==44"): - _warn_on_old_setuptools("44") + _warn_on_old_setuptools("61") + with pytest.warns(RuntimeWarning, match="ERROR: setuptools==60"): + _warn_on_old_setuptools("60") @pytest.mark.issue(611) -- cgit v1.2.1