commit 1603d863935cfbfed5e36922a5642ac1d1d80150bf4181cc3698cef39c649f74 Author: Dirk Mueller Date: Tue Oct 29 17:04:19 2024 +0000 - Update to 13.1 * Added support for reconnecting automatically by using connect() as an asynchronous iterator to the new asyncio implementation. * connect() now follows redirects in the new asyncio implementation. * Added HTTP Basic Auth to the new asyncio and threading implementations of servers. * Made the set of active connections available in the Server.connections property. * Improved reporting of errors during the opening handshake. * Raised ConcurrencyError on unsupported concurrent calls. Previously, RuntimeError was raised. For backwards compatibility, ConcurrencyError is a subclass of RuntimeError. * The new asyncio and threading implementations of servers don’t start the connection handler anymore when process_request or process_response returns an HTTP response. * Fixed a bug in the threading implementation that could lead to incorrect error reporting when closing a connection while recv() is running. - from version 13.0.1 * Restored the C extension in the source distribution. - from version 13.0 * Validated compatibility with Python 3.12 and 3.13. * Added environment variables to configure debug logs, the Server and User-Agent headers, as well as security limits. * If you were monkey-patching constants, be aware that they were renamed, which will break your configuration. You must switch to the environment variables. * The error message in server logs when a header is too long is more explicit. * Fixed a bug in the threading implementation that could prevent the program from exiting when a connection wasn’t closed properly. * Redirecting from a ws:// URI to a wss:// URI now works. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-websockets?expand=0&rev=53 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/12.0.tar.gz b/12.0.tar.gz new file mode 100644 index 0000000..6108dd6 --- /dev/null +++ b/12.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49978ae3f2aedf1c40ce9031c547fb766deaf7e86c3ec9677f0f5991bdc160ec +size 352120 diff --git a/13.1.tar.gz b/13.1.tar.gz new file mode 100644 index 0000000..93fb479 --- /dev/null +++ b/13.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39345b087381694ca06c5b2b922aa8c2a54dc8f08fcaee358eafaa2222c4dd22 +size 414934 diff --git a/python-websockets.changes b/python-websockets.changes new file mode 100644 index 0000000..61e760a --- /dev/null +++ b/python-websockets.changes @@ -0,0 +1,347 @@ +------------------------------------------------------------------- +Tue Oct 29 16:04:09 UTC 2024 - John Paul Adrian Glaubitz + +- Update to 13.1 + * Added support for reconnecting automatically by using connect() + as an asynchronous iterator to the new asyncio implementation. + * connect() now follows redirects in the new asyncio implementation. + * Added HTTP Basic Auth to the new asyncio and threading implementations + of servers. + * Made the set of active connections available in the Server.connections + property. + * Improved reporting of errors during the opening handshake. + * Raised ConcurrencyError on unsupported concurrent calls. Previously, + RuntimeError was raised. For backwards compatibility, ConcurrencyError + is a subclass of RuntimeError. + * The new asyncio and threading implementations of servers don’t start the + connection handler anymore when process_request or process_response returns + an HTTP response. + * Fixed a bug in the threading implementation that could lead to incorrect + error reporting when closing a connection while recv() is running. +- from version 13.0.1 + * Restored the C extension in the source distribution. +- from version 13.0 + * Validated compatibility with Python 3.12 and 3.13. + * Added environment variables to configure debug logs, the Server and + User-Agent headers, as well as security limits. + * If you were monkey-patching constants, be aware that they were renamed, + which will break your configuration. You must switch to the environment + variables. + * The error message in server logs when a header is too long is more explicit. + * Fixed a bug in the threading implementation that could prevent the program + from exiting when a connection wasn’t closed properly. + * Redirecting from a ws:// URI to a wss:// URI now works. + * broadcast(raise_exceptions=True) no longer crashes when there isn’t + any exception. +- Remove stray speedups.c from websockets Python directory + +------------------------------------------------------------------- +Wed Jan 24 16:29:29 UTC 2024 - Daniel Garcia + +- Disable broken tests with openssl 3.2 and python < 3.11 bsc#1217782 + +------------------------------------------------------------------- +Wed Dec 6 09:18:32 UTC 2023 - Dirk Müller + +- update to 12.0: + * websockets 12.0 requires Python ≥ 3.8. + * Made convenience imports from ``websockets`` compatible with + static code analysis tools such as auto-completion in an IDE + or type checking with mypy_. + * Accepted a plain :class:`int` where an + :class:`~http.HTTPStatus` is expected. + * Added :class:`~frames.CloseCode`. +- drop py312-shutdown.patch (upstream) + +------------------------------------------------------------------- +Wed Sep 20 14:58:11 UTC 2023 - Markéta Machová + +- Add py312-shutdown.patch to fix server shutdown on Python 3.12 + +------------------------------------------------------------------- +Wed May 24 11:10:45 UTC 2023 - Daniel Garcia + +- Run tests with pytest +- Disable flaky test gh#python-websockets/websockets#1322 + +------------------------------------------------------------------- +Sun May 14 18:45:02 UTC 2023 - Dirk Müller + +- update to 11.0.3: + * Fixed the :mod:`threading` implementation of servers on + Windows. + +------------------------------------------------------------------- +Wed May 10 06:57:26 UTC 2023 - Dirk Müller + +- update to 11.0.2: + * Fixed a deadlock in the :mod:`threading` implementation when + closing a connection without reading all messages. + * Restored the C extension in the source distribution. + * Backwards-incompatible changes + * The Sans-I/O implementation was moved. + * The ``connection`` module was renamed to ``protocol``. + * The ``connection.Connection``, ``server.ServerConnection``, + and ``client.ClientConnection`` classes were renamed to + ``protocol.Protocol``, ``server.ServerProtocol``, and + ``client.ClientProtocol``. + * If you instantiate :class:`~server.ServerProtocol` or + :class:`~client.ClientProtocol` directly, make sure you are + using keyword arguments. + * Closing a connection without an empty close frame is OK. + * .. admonition:: websockets 10.0 introduces a implementation + on top of :mod:`threading`. + * It may be more convenient if you don't need to manage many + connections and you're more comfortable with :mod:`threading` + than :mod:`asyncio`. + * It is particularly suited to client applications that + establish only one connection. It may be used for servers + handling few connections. + * See :func:`~sync.client.connect` and + :func:`~sync.server.serve` for details. + * Added ``open_timeout`` to :func:`~server.serve`. + * Made it possible to close a server without closing existing + connections. + * Added :attr:`~server.ServerProtocol.select_subprotocol` to + customize negotiation of subprotocols in the Sans-I/O layer. + * Added platform-independent wheels. + * Improved error handling in :func:`~websockets.broadcast`. + * Set ``server_hostname`` automatically on TLS connections when + providing a ``sock`` argument to :func:`~sync.client.connect`. + +------------------------------------------------------------------- +Fri Apr 21 12:38:50 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:45:55 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Wed Nov 9 19:45:34 UTC 2022 - Yogalakshmi Arunachalam + +- Update to 10.4 + New features + * Validated compatibility with Python 3.11. + * Added the latency property to protocols. + * Changed ping to return the latency of the connection. + * Supported overriding or removing the User-Agent header in clients and the Server header in servers. + * Added deployment guides for more Platform as a Service providers. + +------------------------------------------------------------------- +Sat Sep 24 16:17:47 UTC 2022 - Dirk Müller + +- update to 10.3: + * Reduced noise in logs when :mod:`ssl` or :mod:`zlib` raise exceptions. + * Made compression negotiation more lax for compatibility with Firefox. + * Improved FAQ and quick start guide. + * Fixed backwards-incompatibility in 10.1 for connection handlers created with + * Avoided leaking open sockets when :func:`~client.connect` is canceled. + +------------------------------------------------------------------- +Thu Jul 21 11:39:54 UTC 2022 - John Paul Adrian Glaubitz + +- Include in SLE-15 (bsc#1199282, jsc#PM-3243, jsc#SLE-24629) + +------------------------------------------------------------------- +Fri Feb 4 22:08:32 UTC 2022 - Dirk Müller + +- update to 10.1: + * Made the second parameter of connection handlers optional. It will be + deprecated in the next major release. The request path is available in + the :attr:`~legacy.protocol.WebSocketCommonProtocol.path` attribute of + the first argument. + If you implemented the connection handler of a server as:: + async def handler(request, path): + ... + + You should replace it by:: + + async def handler(request): + path = request.path # if handler() uses the path argument + ... + * Added ``python -m websockets --version``. + * Reverted optimization of default compression settings for clients, mainly to + avoid triggering bugs in poorly implemented servers like `AWS API Gateway`_. + * Mirrored the entire :class:`~asyncio.Server` API + in :class:`~server.WebSocketServer`. + * Improved performance for large messages on ARM processors. + * Documented how to auto-reload on code changes in development. + * Avoided half-closing TCP connections that are already closed. + +------------------------------------------------------------------- +Sat Oct 30 22:51:02 UTC 2021 - Ben Greiner + +- Reactivate python39 build, only disable testing. No need to break + consuming packages -- gh#aaugustin/websockets#1051 + +------------------------------------------------------------------- +Fri Oct 29 05:31:17 UTC 2021 - Matej Cepl + +- Update to 10.0: + - Backwards-incompatible changes + - websockets 10.0 requires Python ≥ 3.7. + - The ``loop`` parameter is deprecated from all APIs. + The ``loop`` parameter is also removed + from `~server.WebSocketServer`. This should be transparent. + - `~client.connect` times out after 10 seconds by default. + You can adjust the timeout with the ``open_timeout`` parameter. Set it to + `None` to disable the timeout entirely. + - The ``legacy_recv`` option is deprecated. + - The signature of `~exceptions.ConnectionClosed` changed. + If you raise `~exceptions.ConnectionClosed` or a subclass, rather + than catch them when websockets raises them, you must change your code. + - A ``msg`` parameter was added to `~exceptions.InvalidURI`. + If you raise `~exceptions.InvalidURI`, rather than catch it when + websockets raises it, you must change your code. + - New features + - websockets 10.0 introduces a Sans-I/O API for easier + integration in third-party libraries. + - Added compatibility with Python 3.10. + - Added `~websockets.broadcast` to send a message to many + clients. + - Added support for reconnecting automatically by using + `~client.connect` as an asynchronous iterator. + - Added ``open_timeout`` to :func:`~client.connect`. + - Documented how to integrate with Django. + - Documented how to deploy websockets in production, with + several options. + - Documented how to authenticate connections. + - Documented how to broadcast messages to many connections. + - Improvements + - Improved logging. + - Optimized default compression settings to reduce memory + usage. + - Optimized processing of client-to-server messages when the + C extension isn't available. + - Supported relative redirects in `~client.connect`. + - Handled TCP connection drops during the opening handshake. + - Made it easier to customize authentication with + `~auth.BasicAuthWebSocketServerProtocol.check_credentials`. + - Provided additional information in + `~exceptions.ConnectionClosed` exceptions. + - Clarified several exceptions or log messages. + - Restructured documentation. + - Improved API documentation. + - Extended FAQ. + - Bug fixes + - Avoided a crash when receiving a ping while the connection + is closing. +- The test suite is temporarily broken on Python 3.9.7 + (gh#aaugustin/websockets#1051). + +------------------------------------------------------------------- +Wed Aug 11 09:17:13 UTC 2021 - Matej Cepl + +- Increase WEBSOCKETS_TESTS_TIMEOUT_FACTOR to 10 to make + test_keepalive_ping_with_no_ping_timeout pass again. +- Remove skip-test_keepalive_ping_with_no_ping_timeout.patch, of course. + +------------------------------------------------------------------- +Tue Aug 10 07:18:14 UTC 2021 - Matej Cepl + +- Use %pyunittest macro instead of doing it on our own. +- Add skip-test_keepalive_ping_with_no_ping_timeout.patch for + gh#aaugustin/websockets#1026. + +------------------------------------------------------------------- +Sun Jun 6 12:00:22 UTC 2021 - Dirk Müller + +- update to 9.1: + **Version 9.1 fixes a security issue introduced in version 8.0.** + * Restored compatibility of ``python -m websockets`` with Python < 3.9. + * Restored compatibility with mypy. + * Fixed issues with the packaging of the 9.0 release. + * :class:`~datastructures.Headers` and + :exc:`~datastructures.MultipleValuesError` were moved from + ``websockets.http`` to :mod:`websockets.datastructures`. If you're using + them, you should adjust the import path. + * The ``client``, ``server``, ``protocol``, and ``auth`` modules were + moved from the ``websockets`` package to ``websockets.legacy`` + sub-package, as part of an upcoming refactoring. Despite the name, + they're still fully supported. The refactoring should be a transparent + upgrade for most uses when it's available. The legacy implementation + will be preserved according to the `backwards-compatibility policy`_. + * The ``framing``, ``handshake``, ``headers``, ``http``, and ``uri`` + modules in the ``websockets`` package are deprecated. These modules + provided low-level APIs for reuse by other WebSocket implementations, + but that never happened. Keeping these APIs public makes it more + difficult to improve websockets for no actual benefit. + * Added compatibility with Python 3.9. + * Added support for IRIs in addition to URIs. + * Added close codes 1012, 1013, and 1014. + * Raised an error when passing a :class:`dict` to + +------------------------------------------------------------------- +Sat Nov 28 10:59:12 UTC 2020 - John Vandenberg + +- Remove Suggest python-asyncio, which is in Python 3 stdlib + +------------------------------------------------------------------- +Thu Feb 6 13:45:03 UTC 2020 - Marketa Calabkova + +- update to 8.1 + * Added compatibility with Python 3.8. +- drop upstreamed patch python38-support.patch + +------------------------------------------------------------------- +Wed Oct 16 03:19:43 UTC 2019 - Steve Kowalik + +- Add python38-support.patch from upstream that fixes build failures + against Python 3.8. + +------------------------------------------------------------------- +Tue Aug 13 16:35:47 UTC 2019 - Tomáš Chvátal + +- Update to 8.0.2: + * Restored the ability to pass a socket with the sock parameter of :func:`~server.serve`. + * Removed an incorrect assertion when a connection drops. + +------------------------------------------------------------------- +Mon Jul 22 11:41:40 UTC 2019 - Tomáš Chvátal + +- Update to 8.0.1: + * Version 8.0 drops compatibility with Python 3.4 and 3.5. + * Various fixes + +------------------------------------------------------------------- +Tue Apr 16 11:11:59 UTC 2019 - Tomáš Chvátal + +- Update to 7.0: + * Various fixes + * Repository layout changes + +------------------------------------------------------------------- +Mon Oct 1 07:22:29 UTC 2018 - Tomáš Chvátal + +- Call the tests the same way as upstream to avoid import cycles + +------------------------------------------------------------------- +Mon Sep 24 07:35:18 UTC 2018 - Tomáš Chvátal + +- Do make sure to error out on test failure. + +------------------------------------------------------------------- +Wed Aug 29 11:41:58 UTC 2018 - tchvatal@suse.com + +- Version update to 6.0: + * compatibility with python 3.6 + +------------------------------------------------------------------- +Wed Jun 27 09:20:26 UTC 2018 - abergmann@suse.com + +- Update to version 5.0.1 + * CVE-2018-1000518: Defend against zip bombs (boo#1099269). + +------------------------------------------------------------------- +Sat Oct 7 16:20:14 UTC 2017 - stefan.bruens@rwth-aachen.de + +- Add WEBSOCKETS_TESTS_TIMEOUT_FACTOR=5, otherwise tests in several + projects fail + +------------------------------------------------------------------- +Thu Sep 7 22:42:52 UTC 2017 - toddrme2178@gmail.com + +- initial version diff --git a/python-websockets.spec b/python-websockets.spec new file mode 100644 index 0000000..22b7345 --- /dev/null +++ b/python-websockets.spec @@ -0,0 +1,71 @@ +# +# spec file for package python-websockets +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-websockets +Version: 13.1 +Release: 0 +Summary: An implementation of the WebSocket Protocol (RFC 6455) +License: BSD-3-Clause +Group: Development/Languages/Python +URL: https://github.com/aaugustin/websockets +Source: https://github.com/aaugustin/websockets/archive/%{version}.tar.gz +BuildRequires: %{python_module devel >= 3.8} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +%python_subpackages + +%description +WebSockets is a library for developing WebSocket servers_ and clients_ in +Python. It implements RFC 6455 with a focus on correctness and simplicity. +It passes the Autobahn Testsuite. + +Built on top of Python's asynchronous I/O support introduced in PEP 3156, +it provides an API based on coroutines, making it easy to write highly +concurrent applications. + +%prep +%autosetup -p1 -n websockets-%{version} + +%build +export CFLAGS="%{optflags}" +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} +%python_expand rm -f %{buildroot}%{$python_sitearch}/websockets/speedups.c + +%check +# Test execution speed depends on BS load and architecture, relax +export WEBSOCKETS_TESTS_TIMEOUT_FACTOR=10 +# Disable flaky tests gh#python-websockets/websockets#1322 +donttest="test_close_waits_for_close_frame" +# Disable broken tests with openssl 3.2 and python < 3.11 +donttest+=" or test_reject_invalid_server_certificate" +%pytest_arch -v -k "not ($donttest)" tests + +%files %{python_files} +%license LICENSE +%doc README.rst +%{python_sitearch}/websockets +%{python_sitearch}/websockets-%{version}-py*.egg-info + +%changelog