From 14df8c2cf27be5dd694e95eda3a61b69962de4be Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 10 Jun 2024 19:33:33 -0700 Subject: [PATCH] ansible-test - Prepare for Python 3.13 (#83414) Includes an update to `coverage` and pinned Python requirements. --- changelogs/fragments/ansible-test-coverage-update.yml | 2 ++ test/lib/ansible_test/_data/requirements/ansible-test.txt | 2 +- test/lib/ansible_test/_data/requirements/constraints.txt | 2 ++ test/lib/ansible_test/_internal/coverage_util.py | 2 +- test/lib/ansible_test/_internal/python_requirements.py | 6 +++--- test/lib/ansible_test/_util/target/setup/bootstrap.sh | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/ansible-test-coverage-update.yml diff --git a/changelogs/fragments/ansible-test-coverage-update.yml b/changelogs/fragments/ansible-test-coverage-update.yml new file mode 100644 index 00000000000..93fe8e42e00 --- /dev/null +++ b/changelogs/fragments/ansible-test-coverage-update.yml @@ -0,0 +1,2 @@ +minor_changes: + - ansible-test - Update ``coverage`` to version 7.5.3. diff --git a/test/lib/ansible_test/_data/requirements/ansible-test.txt b/test/lib/ansible_test/_data/requirements/ansible-test.txt index 9f18c1e2689..5c1870cc6eb 100644 --- a/test/lib/ansible_test/_data/requirements/ansible-test.txt +++ b/test/lib/ansible_test/_data/requirements/ansible-test.txt @@ -1,2 +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 == 7.5.3 ; python_version >= '3.8' and python_version <= '3.13' diff --git a/test/lib/ansible_test/_data/requirements/constraints.txt b/test/lib/ansible_test/_data/requirements/constraints.txt index 17f3638fb50..755ad32f501 100644 --- a/test/lib/ansible_test/_data/requirements/constraints.txt +++ b/test/lib/ansible_test/_data/requirements/constraints.txt @@ -9,3 +9,5 @@ requests-ntlm >= 1.1.0 # message encryption support requests-credssp >= 0.1.0 # message encryption support mock >= 2.0.0 # needed for features backported from Python 3.6 unittest.mock (assert_called, assert_called_once...) pytest-mock >= 1.4.0 # needed for mock_use_standalone_module pytest option +cffi == 1.17.0rc1 ; python_version >= '3.13' # temporary hack to support Python 3.13 +pyyaml == 6.0.2rc1 ; python_version >= '3.13' # temporary hack to support Python 3.13 diff --git a/test/lib/ansible_test/_internal/coverage_util.py b/test/lib/ansible_test/_internal/coverage_util.py index 2999413a442..d91fc77a74a 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('7.3.2', 7, (3, 8), (3, 12)), + CoverageVersion('7.5.3', 7, (3, 8), (3, 13)), ) """ This tuple specifies the coverage version to use for Python version ranges. diff --git a/test/lib/ansible_test/_internal/python_requirements.py b/test/lib/ansible_test/_internal/python_requirements.py index 404f2cd4e9e..46d9df68e08 100644 --- a/test/lib/ansible_test/_internal/python_requirements.py +++ b/test/lib/ansible_test/_internal/python_requirements.py @@ -412,9 +412,9 @@ 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='23.1.2', - setuptools='67.7.2', - wheel='0.37.1', + pip='24.0', + setuptools='70.0.0', + wheel='0.43.0', ) override_packages: dict[str, dict[str, str]] = { diff --git a/test/lib/ansible_test/_util/target/setup/bootstrap.sh b/test/lib/ansible_test/_util/target/setup/bootstrap.sh index 16e6d382350..69a826ac8a7 100644 --- a/test/lib/ansible_test/_util/target/setup/bootstrap.sh +++ b/test/lib/ansible_test/_util/target/setup/bootstrap.sh @@ -53,14 +53,14 @@ customize_bashrc() fi # Improve shell prompts for interactive use. - echo "export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> ~/.bashrc + echo "export PS1='"'\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '"'" >> ~/.bashrc } install_pip() { if ! "${python_interpreter}" -m pip.__main__ --version --disable-pip-version-check 2>/dev/null; then case "${python_version}" in *) - pip_bootstrap_url="https://ci-files.testing.ansible.com/ansible-test/get-pip-23.1.2.py" + pip_bootstrap_url="https://ci-files.testing.ansible.com/ansible-test/get-pip-24.0.py" ;; esac