From 639c9411309f7cce232da91547a808fbff2567cf Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 24 Jan 2022 15:56:43 +0100 Subject: [PATCH] build(tests): Python 3.10 support (#1309) Adding Python 3.10 to our test suite Refs GH-1273 * Do not test Flask 0.11 and 0.12 in Python 3.10 * fix(python): Capture only 5xx HTTP errors in Falcon Integration (#1314) * Write code that is actually somehow typed and can be linted. * Updated test matrix for Tornado and Asgi --- .github/workflows/ci.yml | 2 +- setup.py | 1 + test-requirements.txt | 2 +- tox.ini | 52 +++++++++++++++++++++------------------- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6724359e85..8850aaddc7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: strategy: matrix: linux-version: [ubuntu-latest] - python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9"] + python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] include: # GHA doesn't host the combo of python 3.4 and ubuntu-latest (which is # currently 20.04), so run just that one under 18.04. (See diff --git a/setup.py b/setup.py index 85c6de2fc4..6c9219e872 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ def get_file_text(file_name): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Software Development :: Libraries :: Python Modules", ], options={"bdist_wheel": {"universal": "1"}}, diff --git a/test-requirements.txt b/test-requirements.txt index 3f95d90ed3..f980aeee9c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ pytest -pytest-forked==1.1.3 +pytest-forked tox==3.7.0 Werkzeug pytest-localserver==0.5.0 diff --git a/tox.ini b/tox.ini index d282f65d17..4a488cbffa 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ [tox] envlist = # === Core === - py{2.7,3.4,3.5,3.6,3.7,3.8,3.9} + py{2.7,3.4,3.5,3.6,3.7,3.8,3.9,3.10} pypy @@ -24,29 +24,28 @@ envlist = {pypy,py2.7,py3.5}-django-{1.8,1.9,1.10} {pypy,py2.7}-django-{1.8,1.9,1.10,1.11} {py3.5,py3.6,py3.7}-django-{2.0,2.1} - {py3.7,py3.8,py3.9}-django-{2.2,3.0,3.1,3.2} + {py3.7,py3.8,py3.9,py3.10}-django-{2.2,3.0,3.1,3.2} {pypy,py2.7,py3.4,py3.5,py3.6,py3.7,py3.8,py3.9}-flask-{0.10,0.11,0.12,1.0} - {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9}-flask-1.1 - {py3.6,py3.8,py3.9}-flask-2.0 + {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10}-flask-1.1 + {py3.6,py3.8,py3.9,py3.10}-flask-2.0 - {py3.7,py3.8,py3.9}-quart + {py3.7,py3.8,py3.9,py3.10}-quart - {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9}-bottle-0.12 + {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10}-bottle-0.12 {pypy,py2.7,py3.5,py3.6,py3.7}-falcon-1.4 - {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9}-falcon-2.0 + {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10}-falcon-2.0 {py3.5,py3.6,py3.7}-sanic-{0.8,18} {py3.6,py3.7}-sanic-19 {py3.6,py3.7,py3.8}-sanic-20 - {py3.7,py3.8,py3.9}-sanic-21 + {py3.7,py3.8,py3.9,py3.10}-sanic-21 - # TODO: Add py3.9 {pypy,py2.7}-celery-3 {pypy,py2.7,py3.5,py3.6}-celery-{4.1,4.2} {pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-celery-{4.3,4.4} - {py3.6,py3.7,py3.8}-celery-5.0 + {py3.6,py3.7,py3.8,py3.9,py3.10}-celery-5.0 py3.7-beam-{2.12,2.13,2.32,2.33} @@ -55,37 +54,38 @@ envlist = py3.7-gcp - {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9}-pyramid-{1.6,1.7,1.8,1.9,1.10} + {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10}-pyramid-{1.6,1.7,1.8,1.9,1.10} {pypy,py2.7,py3.5,py3.6}-rq-{0.6,0.7,0.8,0.9,0.10,0.11} {pypy,py2.7,py3.5,py3.6,py3.7,py3.8,py3.9}-rq-{0.12,0.13,1.0,1.1,1.2,1.3} - {py3.5,py3.6,py3.7,py3.8,py3.9}-rq-{1.4,1.5} + {py3.5,py3.6,py3.7,py3.8,py3.9,py3.10}-rq-{1.4,1.5} py3.7-aiohttp-3.5 - {py3.7,py3.8,py3.9}-aiohttp-3.6 + {py3.7,py3.8,py3.9,py3.10}-aiohttp-3.6 - {py3.7,py3.8,py3.9}-tornado-{5,6} + {py3.7,py3.8,py3.9}-tornado-{5} + {py3.7,py3.8,py3.9,py3.10}-tornado-{6} {py3.5,py3.6,py3.7,py3.8,py3.9}-trytond-{4.6,5.0,5.2} - {py3.6,py3.7,py3.8,py3.9}-trytond-{5.4} + {py3.6,py3.7,py3.8,py3.9,py3.10}-trytond-{5.4} {py2.7,py3.8,py3.9}-requests {py2.7,py3.7,py3.8,py3.9}-redis {py2.7,py3.7,py3.8,py3.9}-rediscluster-{1,2} - py{3.7,3.8,3.9}-asgi + py{3.7,3.8,3.9,3.10}-asgi - {py2.7,py3.7,py3.8,py3.9}-sqlalchemy-{1.2,1.3} + {py2.7,py3.7,py3.8,py3.9,py3.10}-sqlalchemy-{1.2,1.3} - {py3.5,py3.6,py3.7,py3.8,py3.9}-pure_eval + {py3.5,py3.6,py3.7,py3.8,py3.9,py3.10}-pure_eval {py3.6,py3.7,py3.8}-chalice-{1.16,1.17,1.18,1.19,1.20} {py2.7,py3.6,py3.7,py3.8}-boto3-{1.9,1.10,1.11,1.12,1.13,1.14,1.15,1.16} - {py3.6,py3.7,py3.8,py3.9}-httpx-{0.16,0.17} + {py3.6,py3.7,py3.8,py3.9,py3.10}-httpx-{0.16,0.17} [testenv] deps = @@ -96,9 +96,9 @@ deps = django-{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: djangorestframework>=3.0.0,<4.0.0 - {py3.7,py3.8,py3.9}-django-{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: channels>2 - {py3.7,py3.8,py3.9}-django-{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: pytest-asyncio - {py2.7,py3.7,py3.8,py3.9}-django-{1.11,2.2,3.0,3.1,3.2}: psycopg2-binary + {py3.7,py3.8,py3.9,py3.10}-django-{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: channels>2 + {py3.7,py3.8,py3.9,py3.10}-django-{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: pytest-asyncio + {py2.7,py3.7,py3.8,py3.9,py3.10}-django-{1.11,2.2,3.0,3.1,3.2}: psycopg2-binary django-{1.6,1.7}: pytest-django<3.0 django-{1.8,1.9,1.10,1.11,2.0,2.1}: pytest-django<4.0 @@ -140,7 +140,7 @@ deps = sanic-19: sanic>=19.0,<20.0 sanic-20: sanic>=20.0,<21.0 sanic-21: sanic>=21.0,<22.0 - {py3.7,py3.8,py3.9}-sanic-21: sanic_testing + {py3.7,py3.8,py3.9,py3.10}-sanic-21: sanic_testing {py3.5,py3.6}-sanic: aiocontextvars==0.2.1 sanic: aiohttp py3.5-sanic: ujson<4 @@ -163,7 +163,7 @@ deps = celery-5.0: Celery>=5.0,<5.1 py3.5-celery: newrelic<6.0.0 - {pypy,py2.7,py3.6,py3.7,py3.8,py3.9}-celery: newrelic + {pypy,py2.7,py3.6,py3.7,py3.8,py3.9,py3.10}-celery: newrelic requests: requests>=2.0 @@ -295,6 +295,7 @@ basepython = py3.7: python3.7 py3.8: python3.8 py3.9: python3.9 + py3.10: python3.10 # Python version is pinned here because flake8 actually behaves differently # depending on which version is used. You can patch this out to point to @@ -314,6 +315,9 @@ commands = ; https://github.com/more-itertools/more-itertools/issues/578 py3.5-flask-{0.10,0.11,0.12}: pip install more-itertools<8.11.0 + ; use old pytest for old Python versions: + {py2.7,py3.4,py3.5}: pip install pytest-forked==1.1.3 + py.test {env:TESTPATH} {posargs} [testenv:linters]