From e65e27c38aa8a9568e97f8bca0a5d1fe25c9c852 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 20 Mar 2026 16:39:04 -0700 Subject: [PATCH] ansible-test - Update sanity test requirements (#86701) --- .azure-pipelines/scripts/publish-codecov.py | 2 +- .../ansible-test-sanity-requirements.yml | 2 ++ lib/ansible/_internal/_powershell/_clixml.py | 1 - lib/ansible/_internal/_powershell/_script.py | 1 - .../_data/requirements/sanity.ansible-doc.txt | 2 +- .../_data/requirements/sanity.changelog.txt | 2 +- .../_data/requirements/sanity.pylint.txt | 12 ++++++------ .../requirements/sanity.runtime-metadata.txt | 2 +- .../requirements/sanity.validate-modules.txt | 2 +- .../_data/requirements/sanity.yamllint.txt | 4 ++-- test/sanity/code-smell/black.py | 4 +++- test/sanity/code-smell/black.requirements.txt | 12 ++++++------ .../code-smell/codespell.requirements.txt | 2 +- test/sanity/code-smell/mypy.requirements.in | 2 +- test/sanity/code-smell/mypy.requirements.txt | 19 ++++++++++--------- .../code-smell/package-data.requirements.txt | 4 ++-- test/sanity/code-smell/pymarkdown.py | 10 ++++++++-- .../code-smell/pymarkdown.requirements.txt | 11 +++++++---- test/sanity/code-smell/release-names.py | 1 - test/sanity/code-smell/update-bundled.py | 2 -- .../update-bundled.requirements.txt | 2 +- 21 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 changelogs/fragments/ansible-test-sanity-requirements.yml diff --git a/.azure-pipelines/scripts/publish-codecov.py b/.azure-pipelines/scripts/publish-codecov.py index 1b5b2d12897..c4ec60aeb60 100755 --- a/.azure-pipelines/scripts/publish-codecov.py +++ b/.azure-pipelines/scripts/publish-codecov.py @@ -4,6 +4,7 @@ Upload code coverage reports to codecov.io. Multiple coverage files from multiple languages are accepted and aggregated after upload. Python coverage, as well as PowerShell and Python stubs can all be uploaded. """ + from __future__ import annotations import argparse @@ -15,7 +16,6 @@ import tempfile import typing as t import venv - SCRIPTS_DIR = pathlib.Path(__file__).parent.resolve() DEPS_DIR = SCRIPTS_DIR / 'dependencies' diff --git a/changelogs/fragments/ansible-test-sanity-requirements.yml b/changelogs/fragments/ansible-test-sanity-requirements.yml new file mode 100644 index 00000000000..c8df06f93d0 --- /dev/null +++ b/changelogs/fragments/ansible-test-sanity-requirements.yml @@ -0,0 +1,2 @@ +minor_changes: + - ansible-test - Update sanity test requirements. diff --git a/lib/ansible/_internal/_powershell/_clixml.py b/lib/ansible/_internal/_powershell/_clixml.py index cda877ac543..db69734afed 100644 --- a/lib/ansible/_internal/_powershell/_clixml.py +++ b/lib/ansible/_internal/_powershell/_clixml.py @@ -6,7 +6,6 @@ import base64 import re import xml.etree.ElementTree as ET - # This is weird, we are matching on byte sequences that match the utf-16-be # matches for '_x(a-fA-F0-9){4}_'. The \x00 and {4} will match the hex sequence # when it is encoded as utf-16-be byte sequence. diff --git a/lib/ansible/_internal/_powershell/_script.py b/lib/ansible/_internal/_powershell/_script.py index d712cfa9381..0d28f55df4e 100644 --- a/lib/ansible/_internal/_powershell/_script.py +++ b/lib/ansible/_internal/_powershell/_script.py @@ -8,7 +8,6 @@ import shlex from . import _clixml - # There are 5 chars that need to be escaped in a single quote. # https://github.com/PowerShell/PowerShell/blob/b7cb335f03fe2992d0cbd61699de9d9aafa1d7c1/src/System.Management.Automation/engine/parser/CharTraits.cs#L265-L272 _PWSH_SINGLE_QUOTES = re.compile("(['\u2018\u2019\u201a\u201b])") diff --git a/test/lib/ansible_test/_data/requirements/sanity.ansible-doc.txt b/test/lib/ansible_test/_data/requirements/sanity.ansible-doc.txt index a7497b3d7bc..ab4d73d7b33 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.ansible-doc.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.ansible-doc.txt @@ -1,5 +1,5 @@ # edit "sanity.ansible-doc.in" and generate with: hacking/update-sanity-requirements.py --test ansible-doc Jinja2==3.1.6 MarkupSafe==3.0.3 -packaging==25.0 +packaging==26.0 PyYAML==6.0.3 diff --git a/test/lib/ansible_test/_data/requirements/sanity.changelog.txt b/test/lib/ansible_test/_data/requirements/sanity.changelog.txt index eac80cd3e9f..2e0becd66d2 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.changelog.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.changelog.txt @@ -1,7 +1,7 @@ # edit "sanity.changelog.in" and generate with: hacking/update-sanity-requirements.py --test changelog antsibull-changelog==0.29.0 docutils==0.18.1 -packaging==25.0 +packaging==26.0 PyYAML==6.0.3 rstcheck==5.0.0 semantic-version==2.10.0 diff --git a/test/lib/ansible_test/_data/requirements/sanity.pylint.txt b/test/lib/ansible_test/_data/requirements/sanity.pylint.txt index 794279dcba2..744ea0e0e9c 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.pylint.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.pylint.txt @@ -1,9 +1,9 @@ # edit "sanity.pylint.in" and generate with: hacking/update-sanity-requirements.py --test pylint -astroid==4.0.1 -dill==0.4.0 -isort==7.0.0 +astroid==4.0.4 +dill==0.4.1 +isort==8.0.1 mccabe==0.7.0 -platformdirs==4.5.0 -pylint==4.0.2 +platformdirs==4.9.4 +pylint==4.0.5 PyYAML==6.0.3 -tomlkit==0.13.3 +tomlkit==0.14.0 diff --git a/test/lib/ansible_test/_data/requirements/sanity.runtime-metadata.txt b/test/lib/ansible_test/_data/requirements/sanity.runtime-metadata.txt index 5215462f869..207bb71a07a 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.runtime-metadata.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.runtime-metadata.txt @@ -1,3 +1,3 @@ # edit "sanity.runtime-metadata.in" and generate with: hacking/update-sanity-requirements.py --test runtime-metadata PyYAML==6.0.3 -voluptuous==0.15.2 +voluptuous==0.16.0 diff --git a/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt b/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt index 8906d9ec282..1310fd80910 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt +++ b/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt @@ -3,4 +3,4 @@ antsibull-docs-parser==1.0.0 Jinja2==3.1.6 MarkupSafe==3.0.3 PyYAML==6.0.3 -voluptuous==0.15.2 +voluptuous==0.16.0 diff --git a/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt b/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt index 95a0e350b3b..d65c4d33b9d 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 +pathspec==1.0.4 PyYAML==6.0.3 -yamllint==1.37.1 +yamllint==1.38.0 diff --git a/test/sanity/code-smell/black.py b/test/sanity/code-smell/black.py index c1dbea01920..21c183ca4e5 100644 --- a/test/sanity/code-smell/black.py +++ b/test/sanity/code-smell/black.py @@ -21,7 +21,9 @@ def main() -> None: remote_only_python_versions = os.environ['ANSIBLE_TEST_REMOTE_ONLY_PYTHON_VERSIONS'].split(',') fix_mode = bool(int(os.environ['ANSIBLE_TEST_FIX_MODE'])) - controller_python_versions.remove('3.14') # black does not yet support formatting for Python 3.14 + # Report only the oldest controller Python version, which is the oldest version that may be used to run this test. + # Reporting newer Python versions to black can result in failures when running on older versions. + controller_python_versions = controller_python_versions[:1] target_python_versions = remote_only_python_versions + controller_python_versions diff --git a/test/sanity/code-smell/black.requirements.txt b/test/sanity/code-smell/black.requirements.txt index 7d5aee2fab7..7a74dbd2155 100644 --- a/test/sanity/code-smell/black.requirements.txt +++ b/test/sanity/code-smell/black.requirements.txt @@ -1,8 +1,8 @@ # edit "black.requirements.in" and generate with: hacking/update-sanity-requirements.py --test black -black==25.9.0 -click==8.3.0 +black==26.3.1 +click==8.3.1 mypy_extensions==1.1.0 -packaging==25.0 -pathspec==0.12.1 -platformdirs==4.5.0 -pytokens==0.2.0 +packaging==26.0 +pathspec==1.0.4 +platformdirs==4.9.4 +pytokens==0.4.1 diff --git a/test/sanity/code-smell/codespell.requirements.txt b/test/sanity/code-smell/codespell.requirements.txt index be35485ce5a..c97c7e39589 100644 --- a/test/sanity/code-smell/codespell.requirements.txt +++ b/test/sanity/code-smell/codespell.requirements.txt @@ -1,2 +1,2 @@ # edit "codespell.requirements.in" and generate with: hacking/update-sanity-requirements.py --test codespell -codespell==2.4.1 +codespell==2.4.2 diff --git a/test/sanity/code-smell/mypy.requirements.in b/test/sanity/code-smell/mypy.requirements.in index 150adb1b970..9e21079bfae 100644 --- a/test/sanity/code-smell/mypy.requirements.in +++ b/test/sanity/code-smell/mypy.requirements.in @@ -2,7 +2,7 @@ mypy cryptography # type stubs not published separately jinja2 # type stubs not published separately packaging # type stubs not published separately -pytest # type stubs not published separately +pytest < 9 # type stubs not published separately, pytest 9 drops support for Python 3.9 pytest-mock # type stubs not published separately resolvelib # type stubs not published separately tomli # type stubs not published separately, required for toml inventory plugin diff --git a/test/sanity/code-smell/mypy.requirements.txt b/test/sanity/code-smell/mypy.requirements.txt index 27ec8a1b1b2..c2235685fa8 100644 --- a/test/sanity/code-smell/mypy.requirements.txt +++ b/test/sanity/code-smell/mypy.requirements.txt @@ -1,25 +1,26 @@ # edit "mypy.requirements.in" and generate with: hacking/update-sanity-requirements.py --test mypy cffi==2.0.0 -cryptography==46.0.3 +cryptography==46.0.5 iniconfig==2.3.0 Jinja2==3.1.6 +librt==0.8.1 MarkupSafe==3.0.3 -mypy==1.18.2 +mypy==1.19.1 mypy_extensions==1.1.0 -packaging==25.0 -pathspec==0.12.1 +packaging==26.0 +pathspec==1.0.4 pluggy==1.6.0 -pycparser==2.23 +pycparser==3.0 Pygments==2.19.2 pytest==8.4.2 pytest-mock==3.15.1 resolvelib==1.2.1 -tomli==2.3.0 +tomli==2.4.0 types-backports==0.1.3 types-paramiko==4.0.0.20250822 types-PyYAML==6.0.12.20250915 -types-requests==2.32.4.20250913 -types-setuptools==80.9.0.20250822 +types-requests==2.32.4.20260107 +types-setuptools==82.0.0.20260210 types-toml==0.10.8.20240310 typing_extensions==4.15.0 -urllib3==2.5.0 +urllib3==2.6.3 diff --git a/test/sanity/code-smell/package-data.requirements.txt b/test/sanity/code-smell/package-data.requirements.txt index d0d2324f9a4..b2f49d4f893 100644 --- a/test/sanity/code-smell/package-data.requirements.txt +++ b/test/sanity/code-smell/package-data.requirements.txt @@ -1,4 +1,4 @@ # edit "package-data.requirements.in" and generate with: hacking/update-sanity-requirements.py --test package-data -build==1.3.0 -packaging==25.0 +build==1.4.0 +packaging==26.0 pyproject_hooks==1.2.0 diff --git a/test/sanity/code-smell/pymarkdown.py b/test/sanity/code-smell/pymarkdown.py index 853d94d54f3..5126982b225 100644 --- a/test/sanity/code-smell/pymarkdown.py +++ b/test/sanity/code-smell/pymarkdown.py @@ -38,9 +38,15 @@ def main() -> None: if not (stdout := process.stdout.strip()): return - pattern = re.compile(r'^(?P[^:]*:[0-9]+:[0-9]+): (?P[^:]*): (?P.*) \((?P.*)\)$') + pattern = re.compile(r'^(?P[^:]*):(?P[0-9]+):(?P[0-9]+): (?P[^:]*): (?P.*) \((?P.*)\)$') matches = parse_to_list_of_dict(pattern, stdout) - results = [f"{match['path_line_column']}: {match['aliases'].split(', ')[0]}: {match['message']}" for match in matches] + + base_dir = pathlib.Path(__file__).parent.parent.parent.parent + + for match in matches: + match['path'] = str(pathlib.Path(match['path']).relative_to(base_dir)) + + results = [f"{match['path']}:{match['line']}:{match['column']}: {match['aliases'].split(', ')[0]}: {match['message']}" for match in matches] print('\n'.join(results)) diff --git a/test/sanity/code-smell/pymarkdown.requirements.txt b/test/sanity/code-smell/pymarkdown.requirements.txt index 75e4d8e3a27..bc2df207e17 100644 --- a/test/sanity/code-smell/pymarkdown.requirements.txt +++ b/test/sanity/code-smell/pymarkdown.requirements.txt @@ -1,10 +1,13 @@ # edit "pymarkdown.requirements.in" and generate with: hacking/update-sanity-requirements.py --test pymarkdown -application_properties==0.9.0 +application_file_scanner==0.6.4 +application_properties==0.9.2 Columnar==1.4.1 +py-walk==0.3.3 pyjson5==2.0.0 -pymarkdownlnt==0.9.33 +pymarkdownlnt==0.9.36 PyYAML==6.0.3 -tomli==2.3.0 +sly==0.5 +tomli==2.4.0 toolz==1.1.0 typing_extensions==4.15.0 -wcwidth==0.2.14 +wcwidth==0.6.0 diff --git a/test/sanity/code-smell/release-names.py b/test/sanity/code-smell/release-names.py index cac3071ded4..d8d937913cb 100644 --- a/test/sanity/code-smell/release-names.py +++ b/test/sanity/code-smell/release-names.py @@ -19,7 +19,6 @@ Test that the release name is present in the list of used up release names """ - from __future__ import annotations import pathlib diff --git a/test/sanity/code-smell/update-bundled.py b/test/sanity/code-smell/update-bundled.py index ef41163e3ea..82bfab77bed 100644 --- a/test/sanity/code-smell/update-bundled.py +++ b/test/sanity/code-smell/update-bundled.py @@ -20,7 +20,6 @@ This test checks whether the libraries we're bundling are out of date and need t a newer upstream release. """ - from __future__ import annotations import fnmatch @@ -33,7 +32,6 @@ import packaging.specifiers from ansible.module_utils.urls import open_url - BUNDLED_RE = re.compile(b'\\b_BUNDLED_METADATA\\b') diff --git a/test/sanity/code-smell/update-bundled.requirements.txt b/test/sanity/code-smell/update-bundled.requirements.txt index db68e61ce64..7ba15e8fa5a 100644 --- a/test/sanity/code-smell/update-bundled.requirements.txt +++ b/test/sanity/code-smell/update-bundled.requirements.txt @@ -1,2 +1,2 @@ # edit "update-bundled.requirements.in" and generate with: hacking/update-sanity-requirements.py --test update-bundled -packaging==25.0 +packaging==26.0