diff options
author | Matt Clay <matt@mystile.com> | 2024-04-04 18:41:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-04 18:41:14 +0200 |
commit | 1c17fe2d53c7409dc02780eb29430bee99fb42ad (patch) | |
tree | da3dfaea40d84d2e49b48550641d3a6d8b2fcc37 | |
parent | Remove missed changelog fragments (#82975) (diff) | |
download | ansible-1c17fe2d53c7409dc02780eb29430bee99fb42ad.tar.xz ansible-1c17fe2d53c7409dc02780eb29430bee99fb42ad.zip |
Drop Python 3.7 support (#82982)
-rw-r--r-- | .azure-pipelines/azure-pipelines.yml | 1 | ||||
-rw-r--r-- | changelogs/fragments/ansible-drop-python-3.7.yml | 2 | ||||
-rw-r--r-- | lib/ansible/config/base.yml | 1 | ||||
-rw-r--r-- | lib/ansible/module_utils/basic.py | 2 | ||||
-rw-r--r-- | test/lib/ansible_test/_data/completion/docker.txt | 6 | ||||
-rw-r--r-- | test/lib/ansible_test/_data/requirements/ansible-test.txt | 1 | ||||
-rw-r--r-- | test/lib/ansible_test/_internal/commands/sanity/mypy.py | 9 | ||||
-rw-r--r-- | test/lib/ansible_test/_internal/coverage_util.py | 1 | ||||
-rw-r--r-- | test/lib/ansible_test/_util/target/common/constants.py | 1 | ||||
-rw-r--r-- | test/sanity/ignore.txt | 1 |
10 files changed, 6 insertions, 19 deletions
diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index a7897f9c49..14ce6a240a 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -54,7 +54,6 @@ stages: nameFormat: Python {0} testFormat: units/{0} targets: - - test: 3.7 - test: 3.8 - test: 3.9 - test: '3.10' diff --git a/changelogs/fragments/ansible-drop-python-3.7.yml b/changelogs/fragments/ansible-drop-python-3.7.yml new file mode 100644 index 0000000000..73313a383d --- /dev/null +++ b/changelogs/fragments/ansible-drop-python-3.7.yml @@ -0,0 +1,2 @@ +minor_changes: + - The minimum supported Python version on targets is now Python 3.8. diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 9a5686dba9..dce8e1c1d6 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -1567,7 +1567,6 @@ INTERPRETER_PYTHON_FALLBACK: - python3.10 - python3.9 - python3.8 - - python3.7 - /usr/bin/python3 - python3 vars: diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 7308bb7e8b..51638a07d5 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -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( diff --git a/test/lib/ansible_test/_data/completion/docker.txt b/test/lib/ansible_test/_data/completion/docker.txt index 942859bd19..a8deb5e763 100644 --- a/test/lib/ansible_test/_data/completion/docker.txt +++ b/test/lib/ansible_test/_data/completion/docker.txt @@ -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 diff --git a/test/lib/ansible_test/_data/requirements/ansible-test.txt b/test/lib/ansible_test/_data/requirements/ansible-test.txt index e0bb945e62..9f18c1e268 100644 --- a/test/lib/ansible_test/_data/requirements/ansible-test.txt +++ b/test/lib/ansible_test/_data/requirements/ansible-test.txt @@ -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' diff --git a/test/lib/ansible_test/_internal/commands/sanity/mypy.py b/test/lib/ansible_test/_internal/commands/sanity/mypy.py index 0465951d3d..4d580e933e 100644 --- a/test/lib/ansible_test/_internal/commands/sanity/mypy.py +++ b/test/lib/ansible_test/_internal/commands/sanity/mypy.py @@ -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) diff --git a/test/lib/ansible_test/_internal/coverage_util.py b/test/lib/ansible_test/_internal/coverage_util.py index 28e66b5abd..2999413a44 100644 --- a/test/lib/ansible_test/_internal/coverage_util.py +++ b/test/lib/ansible_test/_internal/coverage_util.py @@ -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. diff --git a/test/lib/ansible_test/_util/target/common/constants.py b/test/lib/ansible_test/_util/target/common/constants.py index fdad9f28a0..868a4d227c 100644 --- a/test/lib/ansible_test/_util/target/common/constants.py +++ b/test/lib/ansible_test/_util/target/common/constants.py @@ -5,7 +5,6 @@ from __future__ import annotations REMOTE_ONLY_PYTHON_VERSIONS = ( - '3.7', '3.8', '3.9', ) diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index 4b65ff8155..b5e0f43f8e 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -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 |