Update to 10.4

This commit is contained in:
Rommel Layco 2022-12-07 10:54:49 +13:00
parent 6c612a57a0
commit 2f1ce2bd8b
No known key found for this signature in database
GPG Key ID: 64B7A75CBFF56102
4 changed files with 7 additions and 67 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@
/websockets-10.1.tar.gz
/websockets-10.2.tar.gz
/websockets-10.3.tar.gz
/websockets-10.4.tar.gz

View File

@ -1,61 +0,0 @@
From ab4b20f6cbf4f04bd8e38a6885906d5afc9bb435 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sun, 15 May 2022 10:27:09 +0200
Subject: [PATCH 1/2] Wrap recv_into() in test_explicit_socket to fix py3.11
Extend TrackedSocket class in test_explicit_socket to wrap
the recv_into() method. The Python 3.11 implementation of asyncio
is calling it rather than recv(), therefore causing used_for_read
not to be set if it's not wrapped.
---
tests/legacy/test_client_server.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/legacy/test_client_server.py b/tests/legacy/test_client_server.py
index f9de70c9..b627644b 100644
--- a/tests/legacy/test_client_server.py
+++ b/tests/legacy/test_client_server.py
@@ -422,10 +422,14 @@ def __init__(self, *args, **kwargs):
self.used_for_write = False
super().__init__(*args, **kwargs)
- def recv(self, *args, **kwargs):
+ def recv(self, *args, **kwargs): # pragma: no cover
self.used_for_read = True
return super().recv(*args, **kwargs)
+ def recv_into(self, *args, **kwargs): # pragma: no cover
+ 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)
From 008ea57bb216b2c8ac0c50a4332c7d24ee3f889b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sun, 15 May 2022 10:32:03 +0200
Subject: [PATCH 2/2] Skip YieldFromTests in Python 3.11+
asyncio.coroutine has been removed in Python 3.11, so skip it if Python
is newer than that.
Fixes #1175
---
tests/legacy/test_client_server.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/legacy/test_client_server.py b/tests/legacy/test_client_server.py
index b627644b..bf5d2f39 100644
--- a/tests/legacy/test_client_server.py
+++ b/tests/legacy/test_client_server.py
@@ -1303,6 +1303,9 @@ def test_checking_lack_of_origin_succeeds_backwards_compatibility(self):
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):

View File

@ -5,17 +5,14 @@
%endif
Name: python-%{pypi_name}
Version: 10.3
Release: 3%{?dist}
Version: 10.4
Release: 1%{?dist}
Summary: Implementation of the WebSocket Protocol for Python
License: BSD
URL: https://github.com/aaugustin/websockets
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
# Fix Python 3.11 test failures
Patch: https://github.com/aaugustin/websockets/pull/1176.patch
BuildRequires: gcc
%global _description %{expand:
@ -58,6 +55,9 @@ BuildRequires: python3-devel
%doc README.rst
%changelog
* Wed Dec 07 2022 Rommel Layco <rj.layco@gmail.com> - 10.4-1
- Update to 10.4
* Fri Aug 12 2022 Julien Enselme <jujens@jujens.eu> - 10.3-3
- Rebuild to update Python bytecode files.

View File

@ -1 +1 @@
SHA512 (websockets-10.3.tar.gz) = 75a11dd7605808954c5f59decda5b115db73de96ed4023d8d7ee3c9966551a9ded2d771f76b086c76f49b0787f19349dadcd9010eb5fea8eeddf3d9bba1c6cbb
SHA512 (websockets-10.4.tar.gz) = 087b1920ff26e21b8d3b80b53249d44b841fc45a4992df1ad725112404f724a41aaa2d759a2bd521dfe337459f8bf0d2ae048c423489f527c68f6825f928b582