From 4d40005c95bd00524be4e06340101bba982e3be3 Mon Sep 17 00:00:00 2001 From: Tomáš Hrnčiar Date: Jun 03 2022 07:56:55 +0000 Subject: Python 3.11 compatibility --- diff --git a/0001-Fixed-cancel-message-related-test-failure-on-py3.11.patch b/0001-Fixed-cancel-message-related-test-failure-on-py3.11.patch new file mode 100644 index 0000000..ca2fbbb --- /dev/null +++ b/0001-Fixed-cancel-message-related-test-failure-on-py3.11.patch @@ -0,0 +1,24 @@ +From f66c127a9629d5ba368b1a731af362af4225c84e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Thu, 26 May 2022 07:56:46 +0200 +Subject: [PATCH] Fixed cancel message related test failure on py3.11 + +--- + tests/test_taskgroups.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/test_taskgroups.py b/tests/test_taskgroups.py +index 528aa2a..40228a9 100644 +--- a/tests/test_taskgroups.py ++++ b/tests/test_taskgroups.py +@@ -991,6 +991,7 @@ def test_unhandled_exception_group(caplog: pytest.LogCaptureFixture) -> None: + + + @pytest.mark.skipif(sys.version_info < (3, 9), ++ sys.version_info >= (3, 11), + reason='Cancel messages are only supported on py3.9+') + @pytest.mark.parametrize('anyio_backend', ['asyncio']) + async def test_cancellederror_combination_with_message() -> None: +-- +2.36.1 + diff --git a/python-anyio.spec b/python-anyio.spec index ea6b922..c82e206 100644 --- a/python-anyio.spec +++ b/python-anyio.spec @@ -29,6 +29,10 @@ Patch: pytest7.patch # Skip @asyncio.coroutine tests on Python 3.11+ where it no longer exists Patch: https://github.com/agronholm/anyio/pull/431.patch +# Cancel messages are only supported on Python 3.9 and 3.10 +# https://github.com/agronholm/anyio/commit/95f43f8db1 +Patch: 0001-Fixed-cancel-message-related-test-failure-on-py3.11.patch + BuildArch: noarch @@ -62,6 +66,10 @@ Documentation for anyio # disable coverage test requirement sed -e '/coverage/d' -i setup.cfg +# Disable some tests till uvloop is compatible with Python 3.11 +# upstream discussion: https://github.com/agronholm/anyio/issues/439 +sed -i '/uvloop/d' setup.cfg + # despite the prescense of a pytest "network" marker, socket tests still fail # without internet access rm tests/test_sockets.py