commit:     8f041477bdd17213149e32f81ae2e9e4f1f1f4e2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 15 08:35:41 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May 15 08:43:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f041477

dev-python/websockets: Enable py3.11

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../websockets/files/websockets-10.3-py311.patch   | 24 ++++++++++++++++++++++
 dev-python/websockets/websockets-10.3.ebuild       |  6 +++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/dev-python/websockets/files/websockets-10.3-py311.patch 
b/dev-python/websockets/files/websockets-10.3-py311.patch
new file mode 100644
index 000000000000..d15eb2d32f81
--- /dev/null
+++ b/dev-python/websockets/files/websockets-10.3-py311.patch
@@ -0,0 +1,24 @@
+diff --git a/tests/legacy/test_client_server.py 
b/tests/legacy/test_client_server.py
+index f9de70c..05070c8 100644
+--- a/tests/legacy/test_client_server.py
++++ b/tests/legacy/test_client_server.py
+@@ -426,6 +426,10 @@ class CommonClientServerTests:
+                 self.used_for_read = True
+                 return super().recv(*args, **kwargs)
+ 
++            def recv_into(self, *args, **kwargs):
++                self.used_for_read = True
++                return super().recv_into(*args, **kwargs)
++
+             def send(self, *args, **kwargs):
+                 self.used_for_write = True
+                 return super().send(*args, **kwargs)
+@@ -1299,6 +1303,8 @@ class ClientServerOriginTests(ClientServerTestsMixin, 
AsyncioTestCase):
+         self.assertEqual(self.loop.run_until_complete(self.client.recv()), 
"Hello!")
+ 
+ 
++@unittest.skipIf(sys.version_info[:2] >= (3, 11),
++                 "asyncio.coroutine has been removed in Python 3.11")
+ class YieldFromTests(ClientServerTestsMixin, AsyncioTestCase):
+     @with_server()
+     def test_client(self):

diff --git a/dev-python/websockets/websockets-10.3.ebuild 
b/dev-python/websockets/websockets-10.3.ebuild
index 8ae85335baa3..ab47cfe892ef 100644
--- a/dev-python/websockets/websockets-10.3.ebuild
+++ b/dev-python/websockets/websockets-10.3.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( pypy3 python3_{8..10} )
+PYTHON_COMPAT=( pypy3 python3_{8..11} )
 
 inherit distutils-r1
 
@@ -25,6 +25,10 @@ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc 
~ppc64 ~riscv ~s390 ~
 
 distutils_enable_tests pytest
 
+PATCHES=(
+       "${FILESDIR}/${P}-py311.patch"
+)
+
 python_test() {
        local EPYTEST_DESELECT=(
                # very fragile to speed

Reply via email to