Add Python 3.11 support

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
pull/1019/head
Nerijus Baliūnas 1 year ago committed by Alex Willmer
parent 57b5be3589
commit 4089e875a9

@ -21,9 +21,9 @@ jobs:
matrix: matrix:
Mito_27: Mito_27:
tox.env: py27-mode_mitogen tox.env: py27-mode_mitogen
Mito_310: Mito_311:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen tox.env: py311-mode_mitogen
# TODO: test python3, python3 tests are broken # TODO: test python3, python3 tests are broken
Loc_27_210: Loc_27_210:
@ -96,33 +96,33 @@ jobs:
python.version: '3.6' python.version: '3.6'
tox.env: py36-mode_mitogen-distro_ubuntu2004 tox.env: py36-mode_mitogen-distro_ubuntu2004
Mito_310_centos6: Mito_311_centos6:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_centos6 tox.env: py311-mode_mitogen-distro_centos6
Mito_310_centos7: Mito_311_centos7:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_centos7 tox.env: py311-mode_mitogen-distro_centos7
Mito_310_centos8: Mito_311_centos8:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_centos8 tox.env: py311-mode_mitogen-distro_centos8
Mito_310_debian9: Mito_311_debian9:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_debian9 tox.env: py311-mode_mitogen-distro_debian9
Mito_310_debian10: Mito_311_debian10:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_debian10 tox.env: py311-mode_mitogen-distro_debian10
Mito_310_debian11: Mito_311_debian11:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_debian11 tox.env: py311-mode_mitogen-distro_debian11
Mito_310_ubuntu1604: Mito_311_ubuntu1604:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_ubuntu1604 tox.env: py311-mode_mitogen-distro_ubuntu1604
Mito_310_ubuntu1804: Mito_311_ubuntu1804:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_ubuntu1804 tox.env: py311-mode_mitogen-distro_ubuntu1804
Mito_310_ubuntu2004: Mito_311_ubuntu2004:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_mitogen-distro_ubuntu2004 tox.env: py311-mode_mitogen-distro_ubuntu2004
Ans_27_210: Ans_27_210:
tox.env: py27-mode_ansible-ansible2.10 tox.env: py27-mode_ansible-ansible2.10
@ -136,18 +136,18 @@ jobs:
python.version: '3.6' python.version: '3.6'
tox.env: py36-mode_ansible-ansible4 tox.env: py36-mode_ansible-ansible4
Ans_310_210: Ans_311_210:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_ansible-ansible2.10 tox.env: py311-mode_ansible-ansible2.10
Ans_310_3: Ans_311_3:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_ansible-ansible3 tox.env: py311-mode_ansible-ansible3
Ans_310_4: Ans_311_4:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_ansible-ansible4 tox.env: py311-mode_ansible-ansible4
Ans_310_5: Ans_311_5:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_ansible-ansible5 tox.env: py311-mode_ansible-ansible5
Ans_310_6: Ans_311_6:
python.version: '3.10' python.version: '3.11'
tox.env: py310-mode_ansible-ansible6 tox.env: py311-mode_ansible-ansible6

@ -147,8 +147,8 @@ Noteworthy Differences
* Mitogen 0.2.x supports Ansible 2.3-2.9; with Python 2.6, 2.7, or 3.6. * Mitogen 0.2.x supports Ansible 2.3-2.9; with Python 2.6, 2.7, or 3.6.
Mitogen 0.3.1+ supports Mitogen 0.3.1+ supports
- Ansible 2.10, 3, and 4; with Python 2.7, or 3.6-3.10 - Ansible 2.10, 3, and 4; with Python 2.7, or 3.6-3.11
- Ansible 5 and 6; with Python 3.8-3.10 - Ansible 5 and 6; with Python 3.8-3.11
Verify your installation is running one of these versions by checking Verify your installation is running one of these versions by checking
``ansible --version`` output. ``ansible --version`` output.

@ -20,6 +20,8 @@ To avail of fixes in an unreleased version, please download a ZIP file
Unreleased Unreleased
---------- ----------
* :gh:issue:`987` Support Python 3.11
v0.3.4 (2023-07-02) v0.3.4 (2023-07-02)
------------------- -------------------

@ -77,6 +77,7 @@ setup(
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Distributed Computing', 'Topic :: System :: Distributed Computing',
'Topic :: System :: Systems Administration', 'Topic :: System :: Systems Administration',

@ -16,7 +16,12 @@ from ansible.plugins.action import ActionBase
TEMPLATE_KWARGS = {} TEMPLATE_KWARGS = {}
_argspec = inspect.getargspec(ansible.template.Templar.template) try:
# inspect.getfullargspec() Added: 3.0
_argspec = inspect.getfullargspec(ansible.template.Templar.template)
except AttributeError:
# inspect.getargspec() Added: 2.1 Deprecated: 3.0 Removed: 3.11
_argspec = inspect.getargspec(ansible.template.Templar.template)
if 'bare_deprecated' in _argspec.args: if 'bare_deprecated' in _argspec.args:
TEMPLATE_KWARGS['bare_deprecated'] = False TEMPLATE_KWARGS['bare_deprecated'] = False

@ -201,8 +201,7 @@
"pytz.exceptions", "pytz.exceptions",
"pytz.lazy", "pytz.lazy",
"pytz.tzfile", "pytz.tzfile",
"pytz.tzinfo", "pytz.tzinfo"
"zipimport"
] ]
} }
} }

@ -1,11 +1,10 @@
psutil==5.4.8 cffi==1.15.1
coverage==5.5; python_version < '3.7' coverage==5.5; python_version < '3.7'
coverage==6.4.4; python_version >= '3.7' coverage==6.4.4; python_version >= '3.7'
Django==1.11.29; python_version < '3.0' Django==1.11.29; python_version < '3.0'
Django==3.2.20; python_version >= '3.6' Django==3.2.20; python_version >= '3.6'
mock==2.0.0 mock==2.0.0
cffi==1.14.3 # Random pin to try and fix pyparser==2.18 not having effect psutil==5.9.5
pycparser==2.18 # Last version supporting 2.6.
pytest-catchlog==1.2.2 pytest-catchlog==1.2.2
pytest==3.1.2 pytest==3.1.2
subprocess32==3.5.4; python_version < '3.0' subprocess32==3.5.4; python_version < '3.0'

@ -90,7 +90,7 @@ def base_executable(executable=None):
base_executable = None base_executable = None
if base_executable and base_executable != executable: if base_executable and base_executable != executable:
return 'be', base_executable return base_executable
# Python 2.x only has sys.base_prefix if running outside a virtualenv. # Python 2.x only has sys.base_prefix if running outside a virtualenv.
try: try:

@ -34,10 +34,10 @@
envlist = envlist =
init, init,
py{27,36}-mode_ansible-ansible{2.10,3,4}, py{27,36}-mode_ansible-ansible{2.10,3,4},
py{310}-mode_ansible-ansible{2.10,3,4,5,6}, py{311}-mode_ansible-ansible{2.10,3,4,5,6},
py{27,36,310}-mode_mitogen-distro_centos{6,7,8}, py{27,36,311}-mode_mitogen-distro_centos{6,7,8},
py{27,36,310}-mode_mitogen-distro_debian{9,10,11}, py{27,36,311}-mode_mitogen-distro_debian{9,10,11},
py{27,36,310}-mode_mitogen-distro_ubuntu{1604,1804,2004}, py{27,36,311}-mode_mitogen-distro_ubuntu{1604,1804,2004},
report, report,
[testenv] [testenv]
@ -50,6 +50,7 @@ basepython =
py38: python3.8 py38: python3.8
py39: python3.9 py39: python3.9
py310: python3.10 py310: python3.10
py311: python3.11
deps = deps =
-r{toxinidir}/tests/requirements.txt -r{toxinidir}/tests/requirements.txt
mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt

Loading…
Cancel
Save