From c0972d246ea5aeb813c746a8417076101d05b119 Mon Sep 17 00:00:00 2001 From: Richard Schwab Date: Mon, 31 Jan 2022 02:34:05 +0100 Subject: [PATCH] add python 3.11 tests (#722) uvloop is disabled on python 3.11 for now due to cython incompatibility. a new cython version has since been released but uvloop needs to be built against this new cython version. see https://github.com/MagicStack/uvloop/issues/450 and https://github.com/MagicStack/uvloop/pull/459 --- .github/workflows/ci.yml | 2 +- requirements-dev.txt | 2 +- tests/conftest.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e3f2c76..e9e149f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - '3.8' - '3.9' - '3.10' - # - '3.11.0-alpha.4' + - '3.11-dev' db: - [mysql, '5.7'] - [mysql, '8.0'] diff --git a/requirements-dev.txt b/requirements-dev.txt index 82305e95..ae330477 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,5 +8,5 @@ PyMySQL>=1.0.0,<=1.0.2 sphinx>=1.8.1, <4.4.1 sphinxcontrib-asyncio==0.3.0 sqlalchemy>1.2.12,<=1.3.16 -uvloop==0.16.0 +uvloop==0.16.0; python_version < '3.11' pyroma==3.2 diff --git a/tests/conftest.py b/tests/conftest.py index 9d0114e3..5420b456 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,11 +3,21 @@ import os import re import ssl +import sys import aiomysql import pymysql import pytest -import uvloop + + +# version gate can be removed once uvloop supports python 3.11 +# https://github.com/MagicStack/uvloop/issues/450 +# https://github.com/MagicStack/uvloop/pull/459 +PY_311 = sys.version_info >= (3, 11) +if PY_311: + uvloop = None +else: + import uvloop @pytest.fixture