Drop Python 3.7 support (#82982)

This commit is contained in:
Matt Clay 2024-04-04 09:41:14 -07:00 committed by GitHub
parent c12d42577e
commit 1c17fe2d53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 6 additions and 19 deletions

View File

@ -54,7 +54,6 @@ stages:
nameFormat: Python {0}
testFormat: units/{0}
targets:
- test: 3.7
- test: 3.8
- test: 3.9
- test: '3.10'

View File

@ -0,0 +1,2 @@
minor_changes:
- The minimum supported Python version on targets is now Python 3.8.

View File

@ -1567,7 +1567,6 @@ INTERPRETER_PYTHON_FALLBACK:
- python3.10
- python3.9
- python3.8
- python3.7
- /usr/bin/python3
- python3
vars:

View File

@ -9,7 +9,7 @@ import sys
# Used for determining if the system is running a new enough python version
# and should only restrict on our documented minimum versions
_PY_MIN = (3, 7)
_PY_MIN = (3, 8)
if sys.version_info < _PY_MIN:
print(json.dumps(dict(

View File

@ -1,6 +1,6 @@
base image=quay.io/ansible/base-test-container:6.2.0 python=3.12,3.7,3.8,3.9,3.10,3.11
default image=quay.io/ansible/default-test-container:9.5.0 python=3.12,3.7,3.8,3.9,3.10,3.11 context=collection
default image=quay.io/ansible/ansible-core-test-container:9.5.0 python=3.12,3.7,3.8,3.9,3.10,3.11 context=ansible-core
base image=quay.io/ansible/base-test-container:6.2.0 python=3.12,3.8,3.9,3.10,3.11
default image=quay.io/ansible/default-test-container:9.5.0 python=3.12,3.8,3.9,3.10,3.11 context=collection
default image=quay.io/ansible/ansible-core-test-container:9.5.0 python=3.12,3.8,3.9,3.10,3.11 context=ansible-core
alpine319 image=quay.io/ansible/alpine319-test-container:7.1.0 python=3.11 cgroup=none audit=none
fedora39 image=quay.io/ansible/fedora39-test-container:7.1.0 python=3.12
ubuntu2004 image=quay.io/ansible/ubuntu2004-test-container:7.1.0 python=3.8

View File

@ -1,3 +1,2 @@
# The test-constraints sanity test verifies this file, but changes must be made manually to keep it in up-to-date.
coverage == 7.3.2 ; python_version >= '3.8' and python_version <= '3.12'
coverage == 6.5.0 ; python_version >= '3.7' and python_version <= '3.7'

View File

@ -19,7 +19,6 @@ from . import (
from ...constants import (
CONTROLLER_PYTHON_VERSIONS,
REMOTE_ONLY_PYTHON_VERSIONS,
SUPPORTED_PYTHON_VERSIONS,
)
from ...test import (
@ -37,7 +36,6 @@ from ...util import (
ANSIBLE_TEST_CONTROLLER_ROOT,
ApplicationError,
is_subdir,
str_to_version,
)
from ...util_common import (
@ -85,13 +83,6 @@ class MypyTest(SanityMultipleVersion):
"""True if the test requires PyPI, otherwise False."""
return True
@property
def supported_python_versions(self) -> t.Optional[tuple[str, ...]]:
"""A tuple of supported Python versions or None if the test does not depend on specific Python versions."""
# Because the version of typeshed mypy use in 1.9 doesn't support 3.7, neither does mypy 1.9.
# see: https://mypy-lang.blogspot.com/2024/03/mypy-19-released.html
return tuple(version for version in SUPPORTED_PYTHON_VERSIONS if str_to_version(version) >= (3, 8))
def test(self, args: SanityConfig, targets: SanityTargets, python: PythonConfig) -> TestResult:
settings = self.load_processor(args, python.version)

View File

@ -70,7 +70,6 @@ class CoverageVersion:
COVERAGE_VERSIONS = (
# IMPORTANT: Keep this in sync with the ansible-test.txt requirements file.
CoverageVersion('7.3.2', 7, (3, 8), (3, 12)),
CoverageVersion('6.5.0', 7, (3, 7), (3, 7)),
)
"""
This tuple specifies the coverage version to use for Python version ranges.

View File

@ -5,7 +5,6 @@
from __future__ import annotations
REMOTE_ONLY_PYTHON_VERSIONS = (
'3.7',
'3.8',
'3.9',
)

View File

@ -49,7 +49,6 @@ lib/ansible/modules/user.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/user.py validate-modules:use-run-command-not-popen
lib/ansible/module_utils/basic.py no-get-exception # only referenced in deprecation code
lib/ansible/module_utils/basic.py pylint:unused-import # deferring resolution to allow enabling the rule now
lib/ansible/module_utils/compat/selinux.py import-3.7!skip # pass/fail depends on presence of libselinux.so
lib/ansible/module_utils/compat/selinux.py import-3.8!skip # pass/fail depends on presence of libselinux.so
lib/ansible/module_utils/compat/selinux.py import-3.9!skip # pass/fail depends on presence of libselinux.so
lib/ansible/module_utils/compat/selinux.py import-3.10!skip # pass/fail depends on presence of libselinux.so