From c8bc39387135f49c40baf022e6ef9cabbb01014b Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 24 Jul 2023 16:02:05 -0700 Subject: [PATCH] Raise the minimum setuptools version to 66.1.0 (#81341) * Raise the minimum setuptools version to 66.1.0 This is the first version to support Python 3.12. While Python 3.10 and 3.11 could use an older version, a consistent minimum is easier to work with and test against. * Fix PEP 517 integration test --- .../ansible-test-minimum-setuptools.yml | 2 +- pyproject.toml | 2 +- setup.cfg | 2 +- .../minimum-build-constraints.txt | 6 +---- .../modernish-build-constraints.txt | 2 +- .../runme_test.py | 27 ------------------- .../code-smell/package-data.requirements.in | 2 +- .../code-smell/package-data.requirements.txt | 2 +- 8 files changed, 7 insertions(+), 38 deletions(-) diff --git a/changelogs/fragments/ansible-test-minimum-setuptools.yml b/changelogs/fragments/ansible-test-minimum-setuptools.yml index 9c7fbeebc7763e..f989b7607244ba 100644 --- a/changelogs/fragments/ansible-test-minimum-setuptools.yml +++ b/changelogs/fragments/ansible-test-minimum-setuptools.yml @@ -1,2 +1,2 @@ minor_changes: - - The minimum required ``setuptools`` version is now 45.2.0, as it is the oldest version to support Python 3.10. + - The minimum required ``setuptools`` version is now 66.1.0, as it is the oldest version to support Python 3.12. diff --git a/pyproject.toml b/pyproject.toml index 8a28c0b2cad317..b5b135175fcd09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ [build-system] -requires = ["setuptools >= 45.2.0"] +requires = ["setuptools >= 66.1.0"] # minimum setuptools version supporting Python 3.12 backend-path = ["packaging"] # requires 'Pip>=20' or 'pep517>=0.6.0' build-backend = "pep517_backend.hooks" # wraps `setuptools.build_meta` diff --git a/setup.cfg b/setup.cfg index d73956cac1a435..f7127b426f9e45 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,4 @@ -# Minimum target setuptools 45.2.0 +# Minimum target setuptools 66.1.0 [metadata] name = ansible-core diff --git a/test/integration/targets/canonical-pep517-self-packaging/minimum-build-constraints.txt b/test/integration/targets/canonical-pep517-self-packaging/minimum-build-constraints.txt index a6ce0dcbbb6cca..b0dd6f1080e2f0 100644 --- a/test/integration/targets/canonical-pep517-self-packaging/minimum-build-constraints.txt +++ b/test/integration/targets/canonical-pep517-self-packaging/minimum-build-constraints.txt @@ -1,8 +1,4 @@ -# Lowest supporting Python 3.10: -setuptools == 57.0.0; python_version == "3.10" - -# Lowest supporting Python 3.11: -setuptools == 60.0.0; python_version >= "3.11" +setuptools == 66.1.0 # minimum requirement in pyproject.toml # An arbitrary old version that was released before Python 3.10.0: diff --git a/test/integration/targets/canonical-pep517-self-packaging/modernish-build-constraints.txt b/test/integration/targets/canonical-pep517-self-packaging/modernish-build-constraints.txt index 5de287375c14c9..ef175831153b73 100644 --- a/test/integration/targets/canonical-pep517-self-packaging/modernish-build-constraints.txt +++ b/test/integration/targets/canonical-pep517-self-packaging/modernish-build-constraints.txt @@ -1,4 +1,4 @@ -setuptools == 67.4.0 +setuptools == 68.0.0 # latest release as of this commit # Wheel-only build dependency wheel == 0.38.4 diff --git a/test/integration/targets/canonical-pep517-self-packaging/runme_test.py b/test/integration/targets/canonical-pep517-self-packaging/runme_test.py index 9a5e26b74e43bf..a52a31255b33d2 100644 --- a/test/integration/targets/canonical-pep517-self-packaging/runme_test.py +++ b/test/integration/targets/canonical-pep517-self-packaging/runme_test.py @@ -96,32 +96,6 @@ def assert_dirs_equal(*dir_paths: t.List[Path]) -> None: assert not dir_comparison.funny_files -def normalize_unpacked_rebuilt_sdist(sdist_path: Path) -> None: - top_pkg_info_path = sdist_path / 'PKG-INFO' - nested_pkg_info_path = ( - sdist_path / 'lib' / f'{DIST_NAME}.egg-info' / 'PKG-INFO' - ) - entry_points_path = nested_pkg_info_path.parent / 'entry_points.txt' - - # setuptools v39 write out two trailing empty lines and an unknown platform - # while the recent don't - top_pkg_info_path.write_text( - top_pkg_info_path.read_text().replace( - 'Classifier: Development Status :: 5', - 'Platform: UNKNOWN\nClassifier: Development Status :: 5', - ) + '\n\n' - ) - nested_pkg_info_path.write_text( - nested_pkg_info_path.read_text().replace( - 'Classifier: Development Status :: 5', - 'Platform: UNKNOWN\nClassifier: Development Status :: 5', - ) + '\n\n' - ) - - # setuptools v39 write out one trailing empty line while the recent don't - entry_points_path.write_text(entry_points_path.read_text() + '\n') - - @pytest.fixture def venv_python_exe(tmp_path: Path) -> t.Iterator[Path]: venv_path = tmp_path / 'pytest-managed-venv' @@ -336,7 +310,6 @@ def test_dist_rebuilds_with_manpages_premutations( ) assert rebuilt_sdist_path.exists() assert rebuilt_sdist_path.is_dir() - normalize_unpacked_rebuilt_sdist(rebuilt_sdist_path) # Ensure the man page directory exists to ease diff comparison. for dir_path in (rebuilt_sdist_path, sdist_with_manpages_path): (dir_path / 'docs/man/man1').mkdir(parents=True, exist_ok=True) diff --git a/test/sanity/code-smell/package-data.requirements.in b/test/sanity/code-smell/package-data.requirements.in index 61b1e3f8cd8775..e727ce3fd5a4f7 100644 --- a/test/sanity/code-smell/package-data.requirements.in +++ b/test/sanity/code-smell/package-data.requirements.in @@ -5,4 +5,4 @@ pyyaml resolvelib < 1.1.0 rstcheck < 6 # newer versions have too many dependencies antsibull-changelog -setuptools == 45.2.0 # minimum supported setuptools +setuptools == 66.1.0 # minimum supported setuptools diff --git a/test/sanity/code-smell/package-data.requirements.txt b/test/sanity/code-smell/package-data.requirements.txt index ba714afa9112be..847d4985fa8b62 100644 --- a/test/sanity/code-smell/package-data.requirements.txt +++ b/test/sanity/code-smell/package-data.requirements.txt @@ -12,7 +12,7 @@ PyYAML==6.0 resolvelib==1.0.1 rstcheck==5.0.0 semantic-version==2.10.0 -setuptools==45.2.0 +setuptools==66.1.0 tomli==2.0.1 types-docutils==0.18.3 typing_extensions==4.5.0