Set the minimum setuptools to 45.2.0 (#80649)

Also update the package-data sanity test to use the minimum setuptools version.
pull/76156/merge
Matt Clay 2 years ago committed by GitHub
parent ece8da71ea
commit 4d25e3d54f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +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.

@ -45,7 +45,19 @@ class SanityTest:
subprocess.run(pip + ['install', 'wheel'], env=env, check=True) # make bdist_wheel available during pip install
subprocess.run(pip + ['install', '-r', self.source_path], env=env, check=True)
pip_freeze = subprocess.run(pip + ['freeze'], env=env, check=True, capture_output=True, text=True)
keep_setuptools = any(line.startswith('setuptools ') for line in self.source_path.read_text().splitlines())
exclude_packages = ['pip', 'distribute', 'wheel']
if not keep_setuptools:
exclude_packages.append('setuptools')
freeze_options = ['--all']
for exclude_package in exclude_packages:
freeze_options.extend(('--exclude', exclude_package))
pip_freeze = subprocess.run(pip + ['freeze'] + freeze_options, env=env, check=True, capture_output=True, text=True)
requirements = f'# edit "{self.source_path.name}" and generate with: {SELF} --test {self.name}\n{pip_freeze.stdout}'

@ -1,4 +1,4 @@
[build-system]
requires = ["setuptools >= 39.2.0"]
requires = ["setuptools >= 45.2.0"]
backend-path = ["packaging"] # requires 'Pip>=20' or 'pep517>=0.6.0'
build-backend = "pep517_backend.hooks" # wraps `setuptools.build_meta`

@ -1,4 +1,4 @@
# Minimum target setuptools 39.2.0
# Minimum target setuptools 45.2.0
[metadata]
name = ansible-core

@ -188,9 +188,10 @@ def create_sdist(tmp_dir):
)
stderr = create.stderr
stdout = create.stdout
if create.returncode != 0:
raise Exception('make snapshot failed:\n%s' % stderr)
raise Exception('make snapshot failed:\n%s' % stderr + '\n' + stdout)
# Determine path to sdist
tmp_dir_files = os.listdir(tmp_dir)

@ -5,3 +5,4 @@ pyyaml # ansible-core requirement
resolvelib < 1.1.0
rstcheck < 6 # match version used in other sanity tests
antsibull-changelog
setuptools == 45.2.0 # minimum supported setuptools

@ -10,6 +10,7 @@ PyYAML==6.0
resolvelib==1.0.1
rstcheck==5.0.0
semantic-version==2.10.0
setuptools==45.2.0
tomli==2.0.1
types-docutils==0.18.3
typing_extensions==4.5.0

Loading…
Cancel
Save