From cf265eb14d24bcac1479f5ef76940f955e251e61 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 11 Jun 2024 11:36:10 -0700 Subject: [PATCH] Add Python 3.13 support (#83416) * Add Python 3.13 support * Add temporary work-around for yamllint test --- .azure-pipelines/azure-pipelines.yml | 3 +++ changelogs/fragments/python-3.13.yml | 3 +++ lib/ansible/config/base.yml | 1 + test/lib/ansible_test/_data/completion/docker.txt | 6 +++--- test/lib/ansible_test/_data/requirements/sanity.yamllint.in | 1 + .../lib/ansible_test/_data/requirements/sanity.yamllint.txt | 2 +- .../_util/controller/sanity/shellcheck/exclude.txt | 1 + test/lib/ansible_test/_util/target/common/constants.py | 1 + test/sanity/code-smell/test-constraints.py | 2 +- 9 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/python-3.13.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 28a09a14d09..7438d4219cf 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -59,6 +59,7 @@ stages: - test: '3.10' - test: 3.11 - test: 3.12 + - test: 3.13 - stage: Windows dependsOn: [] jobs: @@ -160,6 +161,7 @@ stages: - test: '3.10' - test: 3.11 - test: 3.12 + - test: 3.13 - stage: Generic dependsOn: [] jobs: @@ -171,6 +173,7 @@ stages: - test: '3.10' - test: 3.11 - test: 3.12 + - test: 3.13 - stage: Incidental_Windows displayName: Incidental Windows dependsOn: [] diff --git a/changelogs/fragments/python-3.13.yml b/changelogs/fragments/python-3.13.yml new file mode 100644 index 00000000000..43a8021a921 --- /dev/null +++ b/changelogs/fragments/python-3.13.yml @@ -0,0 +1,3 @@ +minor_changes: + - ansible-test - Add support for Python 3.13. + - Add ``python3.13`` to the default ``INTERPRETER_PYTHON_FALLBACK`` list. diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index ce37792ee0f..5c1f36225eb 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -1570,6 +1570,7 @@ _INTERPRETER_PYTHON_DISTRO_MAP: INTERPRETER_PYTHON_FALLBACK: name: Ordered list of Python interpreters to check for in discovery default: + - python3.13 - python3.12 - python3.11 - python3.10 diff --git a/test/lib/ansible_test/_data/completion/docker.txt b/test/lib/ansible_test/_data/completion/docker.txt index ba370c37135..5d750e77973 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:7.0.0 python=3.12,3.8,3.9,3.10,3.11 -default image=quay.io/ansible/default-test-container:10.0.0 python=3.12,3.8,3.9,3.10,3.11 context=collection -default image=quay.io/ansible/ansible-core-test-container:10.0.0 python=3.12,3.8,3.9,3.10,3.11 context=ansible-core +base image=quay.io/ansible/base-test-container:7.1.0 python=3.12,3.8,3.9,3.10,3.11,3.13 +default image=quay.io/ansible/default-test-container:10.1.0 python=3.12,3.8,3.9,3.10,3.11,3.13 context=collection +default image=quay.io/ansible/ansible-core-test-container:10.1.0 python=3.12,3.8,3.9,3.10,3.11,3.13 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/sanity.yamllint.in b/test/lib/ansible_test/_data/requirements/sanity.yamllint.in index b2c729ca4de..34ff248dfef 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.yamllint.in +++ b/test/lib/ansible_test/_data/requirements/sanity.yamllint.in @@ -1 +1,2 @@ +PyYAML == 6.0.2rc1 # temporary hack to support Python 3.13 yamllint diff --git a/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt b/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt index 2c91d9e99e5..50e433da7aa 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt @@ -1,4 +1,4 @@ # edit "sanity.yamllint.in" and generate with: hacking/update-sanity-requirements.py --test yamllint pathspec==0.12.1 -PyYAML==6.0.1 +PyYAML==6.0.2rc1 yamllint==1.35.1 diff --git a/test/lib/ansible_test/_util/controller/sanity/shellcheck/exclude.txt b/test/lib/ansible_test/_util/controller/sanity/shellcheck/exclude.txt index 6563f8fbbf3..28318f9fb1d 100644 --- a/test/lib/ansible_test/_util/controller/sanity/shellcheck/exclude.txt +++ b/test/lib/ansible_test/_util/controller/sanity/shellcheck/exclude.txt @@ -1,2 +1,3 @@ SC1090 SC1091 +SC2028 diff --git a/test/lib/ansible_test/_util/target/common/constants.py b/test/lib/ansible_test/_util/target/common/constants.py index 868a4d227cb..ee7b391d289 100644 --- a/test/lib/ansible_test/_util/target/common/constants.py +++ b/test/lib/ansible_test/_util/target/common/constants.py @@ -13,4 +13,5 @@ CONTROLLER_PYTHON_VERSIONS = ( '3.10', '3.11', '3.12', + '3.13', ) diff --git a/test/sanity/code-smell/test-constraints.py b/test/sanity/code-smell/test-constraints.py index 380222857bd..4e01655394d 100644 --- a/test/sanity/code-smell/test-constraints.py +++ b/test/sanity/code-smell/test-constraints.py @@ -43,7 +43,7 @@ def main(): constraints = raw_constraints.strip() comment = requirement.group('comment') - is_pinned = re.search('^ *== *[0-9.]+(\\.post[0-9]+)?$', constraints) + is_pinned = re.search('^ *== *[0-9.]+(rc[0-9]+)?(\\.post[0-9]+)?$', constraints) if is_sanity: sanity = frozen_sanity.setdefault(name, [])