From f397cd448f7a915145337d40f4d0c41ecbcd0d74 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 15 Jul 2022 11:03:26 +0100 Subject: [PATCH] Add support for Python 3.11 (#2239) --- .github/workflows/tox.yml | 31 ++++++++++++++++++++----------- .pre-commit-config.yaml | 4 ++-- requirements.txt | 2 +- setup.cfg | 3 ++- tox.ini | 4 ++-- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index bcc18f6231..7291e1467b 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -8,7 +8,7 @@ on: push: # only publishes pushes to the main branch to TestPyPI branches: # any integration branch but not tag - "main" - pull_request_target: + pull_request: release: types: - published # It seems that you can publish directly without creating @@ -111,24 +111,21 @@ jobs: # proof that we failed to catch a bug by not running it. Using # distribution should be preferred instead of custom builds. matrix: + name: + - py38 + tox_env: + - py38 python-version: - # keep list sorted as it determines UI order too - 3.8 - - 3.9 - - "3.10" os: # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners - ubuntu-20.04 # - windows-latest # - windows-2016 include: - # windows-2022 WSL does timeout running tests, likely caused but some - # extreme (>10x) performance degradation compared with windows-2019 - # https://github.com/actions/virtual-environments/issues/4856 - - name: py39 (wsl) - tox_env: py39 - os: windows-2019 - shell: "wsl-bash {0}" + # keep list sorted as it determines UI order too + # linux + # py38 is first and comes from matrix - tox_env: py38 os: ubuntu-20.04 python-version: 3.8 @@ -141,6 +138,11 @@ jobs: os: ubuntu-20.04 python-version: "3.10" devel: true + - tox_env: py311 + os: ubuntu-20.04 + python-version: "~3.11.0-0" # see https://github.com/actions/setup-python/issues/213#issuecomment-1146676713 + devel: true + # macos - name: py38 (macos) tox_env: py38 os: macOS-latest @@ -149,6 +151,13 @@ jobs: tox_env: py310 os: macOS-latest python-version: "3.10" + # windows-2022 WSL does timeout running tests, likely caused but some + # extreme (>10x) performance degradation compared with windows-2019 + # https://github.com/actions/virtual-environments/issues/4856 + - name: py39 (wsl) + tox_env: py39 + os: windows-2019 + shell: "wsl-bash {0}" env: # vars safe to be passed to wsl: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c142bea077..8f0446727d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -128,7 +128,7 @@ repos: # empty args needed in order to match mypy cli behavior args: [--strict] additional_dependencies: - - ansible-compat>=2.1.0 + - ansible-compat>=2.2.0 - ansible-core - enrich - flaky @@ -153,7 +153,7 @@ repos: hooks: - id: pylint additional_dependencies: - - ansible-compat>=2.1.0 + - ansible-compat>=2.2.0 - ansible-core - docutils - enrich diff --git a/requirements.txt b/requirements.txt index fa25329acd..06deb7dd0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ # pip-compile --extra=docs --extra=test --no-annotate --output-file=requirements.txt --strip-extras setup.cfg # alabaster==0.7.12 -ansible-compat==2.1.0 +ansible-compat==2.2.0 ansible-core==2.13.0 ansible-pygments==0.1.1 astroid==2.11.5 diff --git a/setup.cfg b/setup.cfg index 1af614d214..2708317d20 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,6 +39,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 :: Implementation Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: Jython @@ -63,7 +64,7 @@ zip_safe = False # These are required in actual runtime: install_requires = - ansible-compat>=2.1.0 # GPLv3 + ansible-compat>=2.2.0 # GPLv3 ansible-core>=2.12.0 # GPLv3 enrich>=1.2.6 jsonschema>=4.6.0 # MIT, first version to have ordered keys in output diff --git a/tox.ini b/tox.ini index b044906129..b231e4167f 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,8 @@ envlist = lint packaging docs - py{310,39,38} - py{310,39,38}-devel + py + py-devel isolated_build = true requires = setuptools >= 41.4.0