mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 12:19:53 +01:00
Set the minimum setuptools to 45.2.0 (#80649)
Also update the package-data sanity test to use the minimum setuptools version.
This commit is contained in:
parent
ece8da71ea
commit
4d25e3d54f
2
changelogs/fragments/ansible-test-minimum-setuptools.yml
Normal file
2
changelogs/fragments/ansible-test-minimum-setuptools.yml
Normal file
|
|
@ -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', 'wheel'], env=env, check=True) # make bdist_wheel available during pip install
|
||||||
subprocess.run(pip + ['install', '-r', self.source_path], env=env, check=True)
|
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}'
|
requirements = f'# edit "{self.source_path.name}" and generate with: {SELF} --test {self.name}\n{pip_freeze.stdout}'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools >= 39.2.0"]
|
requires = ["setuptools >= 45.2.0"]
|
||||||
backend-path = ["packaging"] # requires 'Pip>=20' or 'pep517>=0.6.0'
|
backend-path = ["packaging"] # requires 'Pip>=20' or 'pep517>=0.6.0'
|
||||||
build-backend = "pep517_backend.hooks" # wraps `setuptools.build_meta`
|
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]
|
[metadata]
|
||||||
name = ansible-core
|
name = ansible-core
|
||||||
|
|
|
||||||
|
|
@ -188,9 +188,10 @@ def create_sdist(tmp_dir):
|
||||||
)
|
)
|
||||||
|
|
||||||
stderr = create.stderr
|
stderr = create.stderr
|
||||||
|
stdout = create.stdout
|
||||||
|
|
||||||
if create.returncode != 0:
|
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
|
# Determine path to sdist
|
||||||
tmp_dir_files = os.listdir(tmp_dir)
|
tmp_dir_files = os.listdir(tmp_dir)
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@ pyyaml # ansible-core requirement
|
||||||
resolvelib < 1.1.0
|
resolvelib < 1.1.0
|
||||||
rstcheck < 6 # match version used in other sanity tests
|
rstcheck < 6 # match version used in other sanity tests
|
||||||
antsibull-changelog
|
antsibull-changelog
|
||||||
|
setuptools == 45.2.0 # minimum supported setuptools
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ PyYAML==6.0
|
||||||
resolvelib==1.0.1
|
resolvelib==1.0.1
|
||||||
rstcheck==5.0.0
|
rstcheck==5.0.0
|
||||||
semantic-version==2.10.0
|
semantic-version==2.10.0
|
||||||
|
setuptools==45.2.0
|
||||||
tomli==2.0.1
|
tomli==2.0.1
|
||||||
types-docutils==0.18.3
|
types-docutils==0.18.3
|
||||||
typing_extensions==4.5.0
|
typing_extensions==4.5.0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user