From a73522b6e4aa04f0fbc83a28de8039d29ac16343 Mon Sep 17 00:00:00 2001 From: Fantix King Date: Sun, 25 Aug 2024 23:51:44 -0400 Subject: [PATCH] Use Cython 3.0 and fix deprecated test --- pyproject.toml | 10 ++++++---- setup.py | 2 +- tests/test_tcp.py | 6 ++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c4f93f0b..85c59bf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,14 +36,16 @@ test = [ # pycodestyle is a dependency of flake8, but it must be frozen because # their combination breaks too often # (example breakage: https://gitlab.com/pycqa/flake8/issues/427) - 'aiohttp>=3.8.1; python_version < "3.12"', - 'aiohttp==3.9.0b0; python_version >= "3.12"', + 'aiohttp>=3.10.5', 'flake8~=5.0', 'psutil', 'pycodestyle~=2.9.0', 'pyOpenSSL~=23.0.0', 'mypy>=0.800', - 'Cython(>=0.29.36,<0.30.0)', +] +dev = [ + 'setuptools>=60', + 'Cython~=3.0', ] docs = [ 'Sphinx~=4.1.2', @@ -55,7 +57,7 @@ docs = [ requires = [ "setuptools>=60", "wheel", - "Cython(>=0.29.36,<0.30.0)", + "Cython~=3.0", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index e6aa5201..5ac869d5 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ from setuptools.command.sdist import sdist -CYTHON_DEPENDENCY = 'Cython(>=0.29.36)' +CYTHON_DEPENDENCY = 'Cython>=3.0' MACHINE = platform.machine() MODULES_CFLAGS = [os.getenv('UVLOOP_OPT_CFLAGS', '-O2')] _ROOT = pathlib.Path(__file__).parent diff --git a/tests/test_tcp.py b/tests/test_tcp.py index f269406e..8759383d 100644 --- a/tests/test_tcp.py +++ b/tests/test_tcp.py @@ -2239,8 +2239,7 @@ def test_renegotiation(self): sslctx.use_privatekey_file(self.ONLYKEY) sslctx.use_certificate_chain_file(self.ONLYCERT) client_sslctx = self._create_client_ssl_context() - if sys.version_info < (3, 8) and hasattr(ssl, 'OP_NO_TLSv1_3'): - client_sslctx.options |= ssl.OP_NO_TLSv1_3 + client_sslctx.maximum_version = ssl.TLSVersion.TLSv1_2 def server(sock): conn = openssl_ssl.Connection(sslctx, sock) @@ -2598,8 +2597,7 @@ def test_flush_before_shutdown(self): sslctx_openssl.use_privatekey_file(self.ONLYKEY) sslctx_openssl.use_certificate_chain_file(self.ONLYCERT) client_sslctx = self._create_client_ssl_context() - if sys.version_info < (3, 8) and hasattr(ssl, 'OP_NO_TLSv1_3'): - client_sslctx.options |= ssl.OP_NO_TLSv1_3 + client_sslctx.maximum_version = ssl.TLSVersion.TLSv1_2 future = None