121 lines
5.5 KiB
Diff
121 lines
5.5 KiB
Diff
From c10e3d21fcb54dd0a9dfe44d97355195166510a9 Mon Sep 17 00:00:00 2001
|
|
From: s-hertel <19572925+s-hertel@users.noreply.github.com>
|
|
Date: Tue, 16 May 2023 13:48:12 -0400
|
|
Subject: [PATCH] add Python 3.12 support to ansible-test
|
|
|
|
skip Python 3.12 tests on windows/networking until the default container is
|
|
updated
|
|
|
|
add interpreter fallback?
|
|
---
|
|
lib/ansible/config/base.yml | 1 +
|
|
setup.cfg | 1 +
|
|
test/lib/ansible_test/_data/requirements/ansible-test.txt | 2 +-
|
|
test/lib/ansible_test/_internal/bootstrap.py | 4 ++++
|
|
test/lib/ansible_test/_internal/coverage_util.py | 2 +-
|
|
test/lib/ansible_test/_internal/python_requirements.py | 4 ++--
|
|
test/lib/ansible_test/_util/target/common/constants.py | 1 +
|
|
test/lib/ansible_test/_util/target/setup/bootstrap.sh | 2 +-
|
|
10 files changed, 16 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml
|
|
index 206deb76d2e916..469fbc6846b6d9 100644
|
|
--- a/lib/ansible/config/base.yml
|
|
+++ b/lib/ansible/config/base.yml
|
|
@@ -1557,6 +1557,7 @@ _INTERPRETER_PYTHON_DISTRO_MAP:
|
|
INTERPRETER_PYTHON_FALLBACK:
|
|
name: Ordered list of Python interpreters to check for in discovery
|
|
default:
|
|
+ - python3.12
|
|
- python3.11
|
|
- python3.10
|
|
- python3.9
|
|
diff --git a/setup.cfg b/setup.cfg
|
|
index e020ee3b15caea..af79337f91e9de 100644
|
|
--- a/setup.cfg
|
|
+++ b/setup.cfg
|
|
@@ -30,6 +30,7 @@ classifiers =
|
|
Programming Language :: Python :: 3.9
|
|
Programming Language :: Python :: 3.10
|
|
Programming Language :: Python :: 3.11
|
|
+ Programming Language :: Python :: 3.12
|
|
Programming Language :: Python :: 3 :: Only
|
|
Topic :: System :: Installation/Setup
|
|
Topic :: System :: Systems Administration
|
|
diff --git a/test/lib/ansible_test/_data/requirements/ansible-test.txt b/test/lib/ansible_test/_data/requirements/ansible-test.txt
|
|
index f7cb9c27780856..8b1772fb915bc3 100644
|
|
--- a/test/lib/ansible_test/_data/requirements/ansible-test.txt
|
|
+++ b/test/lib/ansible_test/_data/requirements/ansible-test.txt
|
|
@@ -1,4 +1,4 @@
|
|
# The test-constraints sanity test verifies this file, but changes must be made manually to keep it in up-to-date.
|
|
virtualenv == 16.7.12 ; python_version < '3'
|
|
-coverage == 6.5.0 ; python_version >= '3.7' and python_version <= '3.11'
|
|
+coverage == 6.5.0 ; python_version >= '3.7' and python_version <= '3.12'
|
|
coverage == 4.5.4 ; python_version >= '2.6' and python_version <= '3.6'
|
|
diff --git a/test/lib/ansible_test/_internal/bootstrap.py b/test/lib/ansible_test/_internal/bootstrap.py
|
|
index b0cfb601d94497..1bd357679bb72c 100644
|
|
--- a/test/lib/ansible_test/_internal/bootstrap.py
|
|
+++ b/test/lib/ansible_test/_internal/bootstrap.py
|
|
@@ -90,6 +90,10 @@ def get_variables(self) -> dict[str, t.Union[str, list[str]]]:
|
|
"""The variables to template in the bootstrapping script."""
|
|
variables = super().get_variables()
|
|
|
|
+ # remove once the default docker container is updated
|
|
+ if self.platform in ('ios', 'vyos', 'windows'):
|
|
+ variables['python_versions'] = [version for version in self.python_versions if version != '3.12']
|
|
+
|
|
variables.update(
|
|
platform=self.platform,
|
|
platform_version=self.platform_version,
|
|
diff --git a/test/lib/ansible_test/_internal/coverage_util.py b/test/lib/ansible_test/_internal/coverage_util.py
|
|
index 0af1cac4e97c63..f9276d323c50fc 100644
|
|
--- a/test/lib/ansible_test/_internal/coverage_util.py
|
|
+++ b/test/lib/ansible_test/_internal/coverage_util.py
|
|
@@ -69,7 +69,7 @@ class CoverageVersion:
|
|
|
|
COVERAGE_VERSIONS = (
|
|
# IMPORTANT: Keep this in sync with the ansible-test.txt requirements file.
|
|
- CoverageVersion('6.5.0', 7, (3, 7), (3, 11)),
|
|
+ CoverageVersion('6.5.0', 7, (3, 7), (3, 12)),
|
|
CoverageVersion('4.5.4', 0, (2, 6), (3, 6)),
|
|
)
|
|
"""
|
|
diff --git a/test/lib/ansible_test/_internal/python_requirements.py b/test/lib/ansible_test/_internal/python_requirements.py
|
|
index fc88b637c2b242..1a07334d8637c5 100644
|
|
--- a/test/lib/ansible_test/_internal/python_requirements.py
|
|
+++ b/test/lib/ansible_test/_internal/python_requirements.py
|
|
@@ -434,8 +434,8 @@ def get_venv_packages(python: PythonConfig) -> dict[str, str]:
|
|
# See: https://github.com/ansible/base-test-container/blob/main/files/installer.py
|
|
|
|
default_packages = dict(
|
|
- pip='21.3.1',
|
|
- setuptools='60.8.2',
|
|
+ pip='23.1.2',
|
|
+ setuptools='67.7.2',
|
|
wheel='0.37.1',
|
|
)
|
|
|
|
diff --git a/test/lib/ansible_test/_util/target/common/constants.py b/test/lib/ansible_test/_util/target/common/constants.py
|
|
index 9bddfaf439563e..f3c3857ef97dbf 100644
|
|
--- a/test/lib/ansible_test/_util/target/common/constants.py
|
|
+++ b/test/lib/ansible_test/_util/target/common/constants.py
|
|
@@ -17,4 +17,5 @@
|
|
'3.9',
|
|
'3.10',
|
|
'3.11',
|
|
+ '3.12',
|
|
)
|
|
diff --git a/test/lib/ansible_test/_util/target/setup/bootstrap.sh b/test/lib/ansible_test/_util/target/setup/bootstrap.sh
|
|
index ea17dad38751cc..367dcfcb4ce17e 100644
|
|
--- a/test/lib/ansible_test/_util/target/setup/bootstrap.sh
|
|
+++ b/test/lib/ansible_test/_util/target/setup/bootstrap.sh
|
|
@@ -53,7 +53,7 @@ install_pip() {
|
|
pip_bootstrap_url="https://ci-files.testing.ansible.com/ansible-test/get-pip-20.3.4.py"
|
|
;;
|
|
*)
|
|
- pip_bootstrap_url="https://ci-files.testing.ansible.com/ansible-test/get-pip-21.3.1.py"
|
|
+ pip_bootstrap_url="https://ci-files.testing.ansible.com/ansible-test/get-pip-23.1.2.py"
|
|
;;
|
|
esac
|
|
|