Add Python 3.11 support.

ci_complete
ci_coverage
pull/77837/head
Matt Clay 2 years ago
parent 8ca28acd0d
commit dfde4be444

@ -67,6 +67,7 @@ stages:
- test: 3.8
- test: 3.9
- test: '3.10'
- test: 3.11
- stage: Windows
dependsOn: []
jobs:
@ -142,6 +143,7 @@ stages:
- test: 3.8
- test: 3.9
- test: '3.10'
- test: 3.11
- stage: Generic
dependsOn: []
jobs:
@ -153,6 +155,7 @@ stages:
- test: 3.8
- test: 3.9
- test: '3.10'
- test: 3.11
- stage: Incidental_Remote
displayName: Incidental Remote
dependsOn: []

@ -0,0 +1,3 @@
minor_changes:
- ansible-test - Add support for Python 3.11.
- ansible - Add support for Python 3.11 to Python interpreter discovery.

@ -1546,6 +1546,7 @@ INTERPRETER_PYTHON_DISTRO_MAP:
INTERPRETER_PYTHON_FALLBACK:
name: Ordered list of Python interpreters to check for in discovery
default:
- python3.11
- python3.10
- python3.9
- python3.8

@ -29,6 +29,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3 :: Only
Topic :: System :: Installation/Setup
Topic :: System :: Systems Administration

@ -1,6 +1,6 @@
base image=quay.io/ansible/base-test-container:2.2.0 python=3.10,2.7,3.5,3.6,3.7,3.8,3.9 seccomp=unconfined
default image=quay.io/ansible/default-test-container:5.8.0 python=3.10,2.7,3.5,3.6,3.7,3.8,3.9 seccomp=unconfined context=collection
default image=quay.io/ansible/ansible-core-test-container:5.8.0 python=3.10,2.7,3.5,3.6,3.7,3.8,3.9 seccomp=unconfined context=ansible-core
base image=quay.io/ansible/base-test-container:3.1.0 python=3.10,2.7,3.5,3.6,3.7,3.8,3.9,3.11 seccomp=unconfined
default image=quay.io/ansible/default-test-container:6.2.0 python=3.10,2.7,3.5,3.6,3.7,3.8,3.9,3.11 seccomp=unconfined context=collection
default image=quay.io/ansible/ansible-core-test-container:6.2.0 python=3.10,2.7,3.5,3.6,3.7,3.8,3.9,3.11 seccomp=unconfined context=ansible-core
alpine3 image=quay.io/ansible/alpine3-test-container:4.0.0 python=3.9
centos7 image=quay.io/ansible/centos7-test-container:4.0.0 python=2.7 seccomp=unconfined
fedora34 image=quay.io/ansible/fedora34-test-container:4.0.0 python=3.9 seccomp=unconfined

@ -2,7 +2,8 @@
# do not add a coverage constraint to this file, it is handled internally by ansible-test
packaging < 21.0 ; python_version < '3.6' # packaging 21.0 requires Python 3.6 or newer
paramiko < 2.9.0 # paramiko 2.9.0+ requires changes to the paramiko_ssh connection plugin to work with older systems
pywinrm >= 0.3.0 # message encryption support
pywinrm >= 0.3.0 ; python_version < '3.11' # message encryption support
pywinrm >= 0.4.3 ; python_version >= '3.11' # support for Python 3.11
pytest < 5.0.0, >= 4.5.0 ; python_version == '2.7' # pytest 5.0.0 and later will no longer support python 2.7
pytest >= 4.5.0 ; python_version > '2.7' # pytest 4.5.0 added support for --strict-markers
pytest-forked >= 1.0.2 # pytest-forked before 1.0.2 does not work with pytest 4.2.0+

@ -847,6 +847,7 @@ class SanityCodeSmellTest(SanitySingleVersion):
self.text = self.config.get('text') # type: t.Optional[bool]
self.ignore_self = self.config.get('ignore_self') # type: bool
self.minimum_python_version = self.config.get('minimum_python_version') # type: t.Optional[str]
self.maximum_python_version = self.config.get('maximum_python_version') # type: t.Optional[str]
self.__all_targets = self.config.get('all_targets') # type: bool
self.__no_targets = self.config.get('no_targets') # type: bool
@ -861,6 +862,7 @@ class SanityCodeSmellTest(SanitySingleVersion):
self.text = None # type: t.Optional[bool]
self.ignore_self = False
self.minimum_python_version = None # type: t.Optional[str]
self.maximum_python_version = None # type: t.Optional[str]
self.__all_targets = False
self.__no_targets = True
@ -918,6 +920,9 @@ class SanityCodeSmellTest(SanitySingleVersion):
if self.minimum_python_version:
versions = tuple(version for version in versions if str_to_version(version) >= str_to_version(self.minimum_python_version))
if self.maximum_python_version:
versions = tuple(version for version in versions if str_to_version(version) <= str_to_version(self.maximum_python_version))
return versions
def filter_targets(self, targets): # type: (t.List[TestTarget]) -> t.List[TestTarget]

@ -17,6 +17,10 @@ from . import (
SANITY_ROOT,
)
from ...constants import (
CONTROLLER_PYTHON_VERSIONS,
)
from ...test import (
TestResult,
)
@ -29,6 +33,7 @@ from ...util import (
SubprocessError,
display,
is_subdir,
str_to_version,
)
from ...util_common import (
@ -64,6 +69,11 @@ class PylintTest(SanitySingleVersion):
'too-complex',
])
@property
def supported_python_versions(self): # type: () -> t.Optional[t.Tuple[str, ...]]
"""A tuple of supported Python versions or None if the test does not depend on specific Python versions."""
return tuple(version for version in CONTROLLER_PYTHON_VERSIONS if str_to_version(version) < (3, 11))
@property
def error_code(self): # type: () -> t.Optional[str]
"""Error code for ansible-test matching the format used by the underlying test program, or None if the program does not use error codes."""

@ -16,4 +16,5 @@ CONTROLLER_PYTHON_VERSIONS = (
'3.8',
'3.9',
'3.10',
'3.11',
)

@ -1,5 +1,6 @@
{
"disabled": true,
"maximum_python_version": "3.10",
"no_targets": true,
"output": "path-line-column-message"
}

@ -40,6 +40,18 @@ lib/ansible/galaxy/dependency_resolution/providers.py import-3.10 # circular im
lib/ansible/galaxy/dependency_resolution/reporters.py import-3.10 # circular imports
lib/ansible/galaxy/dependency_resolution/resolvers.py import-3.10 # circular imports
lib/ansible/galaxy/dependency_resolution/versioning.py import-3.10 # circular imports
lib/ansible/cli/galaxy.py import-3.11 # unguarded indirect resolvelib import
lib/ansible/galaxy/collection/__init__.py import-3.11 # unguarded resolvelib import
lib/ansible/galaxy/collection/concrete_artifact_manager.py import-3.11 # unguarded resolvelib import
lib/ansible/galaxy/collection/galaxy_api_proxy.py import-3.11 # unguarded resolvelib imports
lib/ansible/galaxy/collection/gpg.py import-3.11 # unguarded resolvelib imports
lib/ansible/galaxy/dependency_resolution/__init__.py import-3.11 # circular imports
lib/ansible/galaxy/dependency_resolution/dataclasses.py import-3.11 # circular imports
lib/ansible/galaxy/dependency_resolution/errors.py import-3.11 # circular imports
lib/ansible/galaxy/dependency_resolution/providers.py import-3.11 # circular imports
lib/ansible/galaxy/dependency_resolution/reporters.py import-3.11 # circular imports
lib/ansible/galaxy/dependency_resolution/resolvers.py import-3.11 # circular imports
lib/ansible/galaxy/dependency_resolution/versioning.py import-3.11 # circular imports
lib/ansible/cli/scripts/ansible_connection_cli_stub.py shebang
lib/ansible/config/base.yml no-unwanted-files
lib/ansible/executor/playbook_executor.py pylint:disallowed-name
@ -96,6 +108,7 @@ lib/ansible/modules/sysvinit.py validate-modules:return-syntax-error
lib/ansible/modules/uri.py validate-modules:doc-required-mismatch
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/modules/user.py import-3.11 # spwd is deprecated and will be removed in Python 3.13
lib/ansible/modules/yum.py pylint:disallowed-name
lib/ansible/modules/yum.py validate-modules:parameter-invalid
lib/ansible/modules/yum_repository.py validate-modules:doc-default-does-not-match-spec
@ -275,6 +288,7 @@ lib/ansible/module_utils/six/__init__.py mypy-3.7:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:has-type # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:name-defined # vendored code
@ -282,6 +296,7 @@ lib/ansible/module_utils/six/__init__.py mypy-3.7:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:name-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:assignment # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.6:assignment # vendored code
@ -294,6 +309,7 @@ lib/ansible/module_utils/six/__init__.py mypy-3.7:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.8:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:misc # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-2.7:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.5:var-annotated # vendored code
@ -308,6 +324,8 @@ lib/ansible/module_utils/six/__init__.py mypy-3.9:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.9:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.10:attr-defined # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:var-annotated # vendored code
lib/ansible/module_utils/six/__init__.py mypy-3.11:attr-defined # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-2.7:arg-type # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.5:valid-type # vendored code
lib/ansible/module_utils/distro/_distro.py mypy-3.6:valid-type # vendored code
@ -324,6 +342,7 @@ lib/ansible/module_utils/compat/_selectors2.py mypy-3.7:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.8:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.9:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.10:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.11:misc # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-2.7:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.5:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.6:assignment # vendored code
@ -331,5 +350,6 @@ lib/ansible/module_utils/compat/_selectors2.py mypy-3.7:assignment # vendored c
lib/ansible/module_utils/compat/_selectors2.py mypy-3.8:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.9:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.10:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-3.11:assignment # vendored code
lib/ansible/module_utils/compat/_selectors2.py mypy-2.7:attr-defined # vendored code
test/support/integration/plugins/modules/ec2.py pylint:ansible-deprecated-version

Loading…
Cancel
Save