15
0

- Add patch use-plain-twisted.patch:

* Support pytest-asyncio 1.0 changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-autobahn?expand=0&rev=75
This commit is contained in:
2025-07-22 04:50:05 +00:00
committed by Git OBS Bridge
commit 3c3b3ad9ff
11 changed files with 1063 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
autobahn-23.6.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec9421c52a2103364d1ef0468036e6019ee84f71721e86b36fe19ad6966c1181
size 480814

3
autobahn-24.4.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a2d71ef1b0cf780b6d11f8b205fd2c7749765e65795f2ea7d823796642ee92c9
size 482700

33
fix-wamp-tests.patch Normal file
View File

@@ -0,0 +1,33 @@
diff --git a/autobahn/wamp/test/test_wamp_component_aio.py b/autobahn/wamp/test/test_wamp_component_aio.py
index 168933ea5..2de9bf358 100644
--- a/autobahn/wamp/test/test_wamp_component_aio.py
+++ b/autobahn/wamp/test/test_wamp_component_aio.py
@@ -35,7 +35,7 @@
@pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+")
@pytest.mark.asyncio(forbid_global_loop=True)
- def test_asyncio_component(event_loop):
+ async def test_asyncio_component(event_loop):
orig_loop = txaio.config.loop
txaio.config.loop = event_loop
@@ -72,11 +72,11 @@ def done(f):
txaio.config.loop = orig_loop
assert comp._done_f is None
f.add_done_callback(done)
- return finished
+ await finished
@pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+")
@pytest.mark.asyncio(forbid_global_loop=True)
- def test_asyncio_component_404(event_loop):
+ async def test_asyncio_component_404(event_loop):
"""
If something connects but then gets aborted, it should still try
to re-connect (in real cases this could be e.g. wrong path,
@@ -151,4 +151,4 @@ def done(f):
finished.set_result(None)
txaio.config.loop = orig_loop
f.add_done_callback(done)
- return finished
+ await finished

19
intrin-arch.patch Normal file
View File

@@ -0,0 +1,19 @@
Index: autobahn-23.6.2/autobahn/nvx/_utf8validator.c
===================================================================
--- autobahn-23.6.2.orig/autobahn/nvx/_utf8validator.c
+++ autobahn-23.6.2/autobahn/nvx/_utf8validator.c
@@ -27,10 +27,14 @@
#include <stdlib.h>
#include <stdint.h>
+#ifdef __s390__
+#include <s390intrin.h>
+#else
// http://stackoverflow.com/questions/11228855/header-files-for-simd-intrinsics
#if defined(__SSE2__) || defined(__SSE4_1__)
#include <x86intrin.h>
#endif
+#endif
#define UTF8_ACCEPT 0

428
python-autobahn.changes Normal file
View File

@@ -0,0 +1,428 @@
-------------------------------------------------------------------
Tue Jul 22 04:49:15 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch use-plain-twisted.patch:
* Support pytest-asyncio 1.0 changes.
-------------------------------------------------------------------
Tue Dec 10 06:10:04 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 24.6.2:
* unit test fixes (#1634)
* bump minimum twisted to 24.3.0 (#1635)
* a couple of packaging fixes (#1632)
* update license file to include contributors (#1628)
* Random ID should beginning with 1 (#1637)
- Drop patch fix-wamp-tests.patch, included upstream.
- Add patch support-new-pytest-asyncio.patch:
* Support even more pytest-asyncio.
-------------------------------------------------------------------
Thu Apr 25 08:18:43 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Add upstream patch fix-wamp-tests.patch to make it work with modern
python-pytest-asyncio package gh#crossbario/autobahn-python#1631
-------------------------------------------------------------------
Thu Feb 22 03:58:14 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to autosetup and pyproject macros.
- No more greedy globs in %files.
-------------------------------------------------------------------
Fri Jun 23 11:21:53 UTC 2023 - Markéta Machová <mmachova@suse.com>
- Update to 23.6.2
* fix: use regular PyPI bitarray>=2.7.5 rather than from GitHub master
23.6.1
* fix: updated bitarray to make eth-account work on pypy
* fix: updated web3 and eth-abi to not use beta versions (#1616)
23.1.2
* fix: monkey patch web3/eth_abi for python 3.11
23.1.1
* fix: support for Python up to v3.11
* fix: update GitHub CI
* fix: copyright transferred to typedef int GmbH - no license change!
* fix: remove coverage crap
22.12.1
* new: expand WAMP Flatbuffers schemata (session ID in each message for MUXing)
* new: update flatc v22.12.06 and regenerate WAMP Flatbuffers type libraries
* fix: Twisted 22.10.0 incompability (#1604)
* fix: Rapid Cancelling Of Tasks Can Cause InvalidStateError (#1600)
* fix: identify_realm_name_category (#1590)
* fix: support Python 3.11 (#1599)
* fix: building _nvx_utf8validator extension on non-x86 systems (#1596)
* fix: asyncio rawsocket protocol transport details (#1592)
* new: expand EIP712AuthorityCertificate; more tests
-------------------------------------------------------------------
Thu Aug 4 09:13:28 UTC 2022 - Otto Hollmann <otto.hollmann@suse.com>
- Update to 22.7.1:
* fix: Fix a few typos in docs (#1587)
* fix: remove log noise from autobahn.websocket.protocol (#1588)
* new: add more helpers to EthereumKey and CryptosignKey (#1583)
* new: EIP712 certificate chains, incl. use for WAMP-Cryptosign
* fix: improve message logging at trace log level
* fix: forward correct TLS channel ID once the TLS handshake is complete
* new: add eip712 types for WAMP-Cryptosign certificates
* new: add more helpers to EthereumKey and CryptosignKey
* new: add EthereumKey.from_keyfile, CryptosignKey.from_keyfile,
CryptosignKey.from_pubkey
- Changes from 22.6.1:
* new: add SecurityModuleMemory.from_config and
SecurityModuleMemory.from_keyfile
* new: moved UserKey from crossbar to autobahn
* fix: more WAMP-Cryptosign unit tests
* new: experimental WAMP API catalog support
* new: regenerate FlatBuffers WAMP messages
* fix: allow tests to pass without XBR dependencies (#1580)
* new: Flatbuffers IDL based WAMP payload validation (#1576)
* fix: restore autobahn.twisted.testing to distribution (#1578)
- Changes from 22.5.1:
* new: WAMP Flatbuffers IDL and schema processing (experimental)
* new: WAMP-cryptosign trustroot (experimental)
* new: add wrapper type for CryptosignAuthextra
* fix: stricted type checking of Challenge; fix cryposign unit test;
* new: more test coverage
* fix: reduce log noise
* fix: forward channel_binding selected in Component client
* new: expand ISigningKey to provide security_module/key_id (if used)
* fix: Component cryptosign test
* fix: add type hints; fix channel_binding
* new: work on federated realms and secmods
* new: rename to and work on a.w.CryptosignKey
* new: add bip44 for cryptosign test
* fix: remove all txaio.make_logger refs from generic code (#1564)
* new: initial support for federated WAMP realms via a.x.FederatedRealm/Seeder
* new: moved utility functions and unit tests for WAMP realm name checking
from Crossbar.io
* new: allow list of URLs for transports in a.t.component.Component
* new: add websocket_options to a.t.wamp.ApplicationRunner
* new: add stop_at_close flag in a.t.component.run
* fix: reduce log noise (regression) on ApplicationRunner Twisted (#1561)
* new: allow max_retry_delay==0 for always-immediate auto-reconnect in
ApplicationRunner on Twisted
* new: add websocket_options to WAMP ApplicationRunner on Twisted (#888)
* new: more type hints and docs
- Changes from 22.4.2:
* fix: can not import autobahn.twisted.util with no-TLS (#1559)
- Changes from 22.4.1:
* new: modernize SessionDetails
* new: improve ISession/ITransportHandler and implementations (#1557)
* new: expand and refactor TransportDetails (#1551)
* fix: misc fixes, add type hints, more docs (#1547)
* new: key modules for use with WAMP-cryptosign (#1544)
* fix: string formatting with binary values in
TransportDetails.secure_channel_id (#1483)
* fix: never default set authid/authrole in component authenticators
* fix: TransportDetails string formatting (fixes #1486)
* fix: reading private ssh key for cryptosign (fixes #932)
* fix: do not throw (but log) when leaving a session not joined (#1542)
* fix: store WAMP authextra received (#1541)
-------------------------------------------------------------------
Wed Mar 30 07:49:43 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 22.3.2:
* fix: split out UI deps into separate dist flavor (#1532)
* fix: deps for RTD builds (#1540)
* fix: use and bundle dev deps from requirements file
-------------------------------------------------------------------
Sun Mar 27 13:53:14 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 22.3.1:
* fix generate_token
* reduce twisted log noise for wamp clients
* add GitHub URL for PyPi
-------------------------------------------------------------------
Fri Mar 11 08:54:00 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Fix packaging for %arm, aarch64 and riscv64
-------------------------------------------------------------------
Wed Mar 9 05:57:11 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 22.2.2:
* fix: auto ping/pong logs should be debug instead of info (#1524)
* new: add auto-ping/pong configuration knob autoPingRestartOnAnyTraffic (see discussion here).
* new: extended websocket auto-ping/pong ("heartbeating") with builtin RTT measurement
* new: experimental support for transaction_hash in WAMP Publish/Call (see discussion here).
* new: support decimal numbers WAMP serialization and round-tripping in both JSON and CBOR
* fix: only depend on cbor2 (for WAMP CBOR serialization), not also cbor
* fix: PyInstaller and Docker build / CI issues
* new: support Python 3.10
* new: allow optional keys in endpoint config validation
* fix: reset transport retry status when connection succeeds
* fix: update Docker/PyPy to pypy:3.8-slim
* fix: autobahn installation in docker (#1503)
* new: refactor SigningKey class for reusability (#1500, #1501)
* new: expand XBR node pairing helpers
* fix: build with nvx by default and don't publish universal wheel. (#1493)
* fix: update wamp flatbuffer schema for r2r links
* fix: don't clobber factory (#1480)
* fix: explicitly require setuptools
* new: expand wamp auth scram and xbr argon2/hkdf (#1479)
* fix: WebSocket compression, window size (zlib wbits) == 8 is illegal nowerdays (#1477)
* fix: XBR IDL code generator - all 4 WAMP actions working now
* new: add automated build of xbrnetwork CLI (single-file EXE) in CI
- Remove python-mock BuildRequires
- Rebase respect-cflags.patch
- Ship the xbrnetwork-ui cli tool
-------------------------------------------------------------------
Mon Feb 7 13:56:05 UTC 2022 - Andreas Schwab <schwab@suse.de>
- Do not use NVX on riscv64
-------------------------------------------------------------------
Tue May 18 11:41:43 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 21.3.1:
* fix: Twisted v21.2.0 breaks Crossbar.io
* new: use_binary_hex_encoding option for JSON object serializer
* fix: correct some sphinx doc references
* new: minimum supported Python (language) version is now 3.7 (on CPython and PyPy)
* new: more XBR proxy/stub code generation capabilities (RPC call/invoation handlers)
* fix: wamp-cryptosign loading of keys from SSH agent
* fix: update Docker image building and build Docker multi-arch images
* new: add more WAMP-cryptosign signature test vectors and unit tests
* fix: include XBR code rendering templates in package manifest
-------------------------------------------------------------------
Sat Feb 13 20:06:02 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 21.2.1:
* new: XBR ABI files now via separate package (“xbr”) - substantially reduce
package size for non-XBR users
* fix: circular dependency in “xbr” install flavor
* fix: XBR package manifest and CLI user profile loading
* fix: consider wamp.close.goodbye_and_out a clean exit
* fix: HASH import as well as improve diagnostics if things go wrong
* fix: add missing jinja2 dependency for XBR CLI
* fix: wamp.close.goodbye_and_out counts as a clean exit
-------------------------------------------------------------------
Tue Jan 12 05:13:37 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Add missing BuildRequires/Requires on python-hyperlink
-------------------------------------------------------------------
Tue Jan 5 03:42:59 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 20.12.3:
* fix: URL must be re-encoded when doing redirect (#1439)
(bsc#1180570, CVE-2020-35678)
* new: minimum supported Python (language) version is now 3.6
* fix: derive_bip32childkey traceback (#1436)
* fix: update and adjust docker files to upstream changes
* new: CLI commands for WAMP IDL (xbrnetwork describe-schema / codegen-schema)
* new: add eth address helpers (#1413)
* new: cryptosign authextra allow arbitrary keys (#1411)
* fix: adapt to planet api prefix change (#1408)
* fix: Type check improve (#1405)
-------------------------------------------------------------------
Mon Dec 21 21:50:35 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Fix flavored requires -- gh#openSUSE/python-rpm-macros#66
-------------------------------------------------------------------
Mon Aug 31 10:06:55 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Fix installation path when NVX is not used (fix aarch64)
-------------------------------------------------------------------
Thu Aug 20 08:47:52 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Do not use NVX on %arm and aarch64
-------------------------------------------------------------------
Thu Jul 23 14:42:38 UTC 2020 - Berthold Gunreben <azouhr@opensuse.org>
- Add patch to include correct <arch>intrin.h for s390
* intrin-arch.patch
- Minor patch refresh for respect-cflags.patch
-------------------------------------------------------------------
Tue Jul 21 05:51:09 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 20.7.1:
* new: add market login eip. expose helpers
-------------------------------------------------------------------
Wed Jul 8 02:19:00 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 20.6.2:
* fix: xbr fixes (#1396)
* fix: use cpy 3.8 for running flake in CI
* new: Ticket1392 internal attrs (#1394)
* new: internal-only router attributes and hook for router to add custom
information
-------------------------------------------------------------------
Mon Jun 15 04:37:00 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 20.6.1:
* new: massive expansion of XBR CLI and EIP712 helpers
* new: more (exhaustive) serializer cross-tripping tests
* fix: some code quality and bug-risk issues (#1379)
* fix: removed externalPort assignment when not set (#1378)
* fix: docs link in README (#1381)
* fix: docs typo frameword -> framework (#1380)
* fix: improve logging; track results on observable mixin
* new: add environmental variable that strips xbr. (#1374)
* fix: trollius is gone (#1373)
* new: added ability to disable TLS channel binding (#1368)
- Correct BuildRequires/Requires (boo#1172126)
-------------------------------------------------------------------
Sun Jun 14 08:49:49 UTC 2020 - Dirk Mueller <dmueller@suse.com>
- update to 20.4.3:
* new: XBR CLI (#1367)
* fix: add missing XBR dependency py-multihash
-------------------------------------------------------------------
Wed May 27 09:36:10 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Mon Apr 20 05:41:32 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 20.4.2:
* new: XBR - adjust eip712 signature for channel close
* new: XBR - adjustments after xbr refactoring (#1357)
* new: XBR - add channel open/close eip712 types to AB (#1358)
* new: WAMP-cryptosign - make channel_id_type optional in transport_channel_id()
* new: expose new XBR top-level contracts
* fix: bump dependencies versions for attrs and identity (#1346)
* fix: FrontendProxyProtocol object has no attribute 'write' (#1339)
* fix: WAMP-cryptosign authid is not mandatory; reduce log noise (#1340)
* fix: confusion between paying and payment channel (#1337)
* new: forward explicitly set app level errors from ApplicationRunner.run() (#1336)
* fix: simple typo: hookinh -> hooking (#1333)
* new: update for xbr v20.3.1
* fix: for #1327 - cancel Auto Ping Timeout (#1328)
* new: helper function to create a configured Web3 blockchain connection (#1329)
* fix: add AuthAnonymous to __all__ (#1303)
* fix: CI building (caching?) issue "corrupt ZIP file"
* fix: update docker image build scripts and add ARM64/PyPy
* fix: use :func:`txaio.time_ns` and drop deprecated :func:`autobahn.util.time_ns`
* fix: update project README and docs for supported python versions (#1296)
* fix: WebSocket protocol instances now raise autobahn.exception.Disconnected when sending on a closed connection (#1002)
* fix: version conflict in xbr downstream application dependency (crossbarfx) (#1295)
* fix: add python_requires>=3.5 to prevent installation on python 2 (#1293)
* fix: first part of cleaning up code, dropping Python 2 support (#1282).
* fix: add docs for parameters to component.py (#1276)
* new: statistics tracking on WAMP serializers :class:`autobahn.wamp.serializer.Serializer`
* new: helper :func:`autobahn.util.time_ns`
- No longer build for Python 2
- Update BuildRequires.
-------------------------------------------------------------------
Wed Dec 11 11:53:12 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Skip rng tests as they randomly fail in obs
-------------------------------------------------------------------
Tue Dec 3 14:28:53 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.11.1:
* packaging fixes
-------------------------------------------------------------------
Wed Oct 9 08:44:16 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.10.1:
* various minor bugfixes mostly
-------------------------------------------------------------------
Tue Sep 24 12:05:29 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.9.3:
* packaging fixes
-------------------------------------------------------------------
Fri Sep 13 12:43:37 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.9.2:
* Various bugfixes mostly, not many features
-------------------------------------------------------------------
Tue May 14 22:26:05 UTC 2019 - Jonathan Harker <jharker@suse.com>
- Update to 19.5.1
* fix: authextra merging (#1191)
* fix: set default retry_delay_jitter (#1190)
* new: add rawsocket + twisted example (#1189)
* new: WebSocket testing support, via Agent-style interface (#1186)
* new: decorator for on_connectfailure
* fix: delayed call leakage (#1152)
* new: CLI client (#1150)
* fix: set up TLS over proxy properly (#1149)
* new: expose ser modules (#1148)
* fix: base64 encodings, add hex encoding (#1146)
* new: onConnecting callback (with TransportDetails and ConnectingRequest).
Note: if you've implemented a pure IWebSocketChannel without inheriting
from Autobahn base classes, you'll need to add an onConnecting() method
that just does return None.
-------------------------------------------------------------------
Mon Apr 8 08:41:35 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Rename reproducible.patch to respect-cflags.patch and really make
sure we respect all the cflags
-------------------------------------------------------------------
Mon Apr 8 07:32:05 UTC 2019 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add reproducible.patch to make package build reproducible (boo#1100677)
and to not use SSE4.1 instructions
-------------------------------------------------------------------
Fri Apr 5 08:12:36 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Fix the %pytest_arch call to pass properly
-------------------------------------------------------------------
Tue Mar 26 13:18:38 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.3.3:
* No upstream changelog
-------------------------------------------------------------------
Tue Mar 19 14:37:02 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.3.2:
* no upstream changelog
- List all the missing requirements based on setup.py
-------------------------------------------------------------------
Thu Oct 18 09:23:10 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 18.9.2:
* Various fixes all around
* Support python 3.7
- remove-unittest2.patch was merged upstream
-------------------------------------------------------------------
Fri Aug 10 11:22:33 UTC 2018 - mcepl@suse.com
- Add remove-unittest2.patch which remove dependency on unittest2
(filed upstream https://github.com/crossbario/autobahn-python/issues/1036)
-------------------------------------------------------------------
Mon Mar 12 09:11:02 UTC 2018 - tchvatal@suse.com
- Fix python2 pulling of trollius
-------------------------------------------------------------------
Fri Mar 2 22:01:11 UTC 2018 - avvissu@yandex.by
- Initial package

146
python-autobahn.spec Normal file
View File

@@ -0,0 +1,146 @@
#
# spec file for package python-autobahn
#
# Copyright (c) 2025 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/
#
%ifarch %arm aarch64 riscv64
%bcond_with nvx_support
%else
%bcond_without nvx_support
%endif
Name: python-autobahn
Version: 24.4.2
Release: 0
Summary: WebSocket and WAMP in Python for Twisted and asyncio
License: MIT
URL: https://github.com/crossbario/autobahn-python
Source: https://files.pythonhosted.org/packages/source/a/autobahn/autobahn-%{version}.tar.gz
Patch0: respect-cflags.patch
Patch1: intrin-arch.patch
# PATCH-FIX-UPSTREAM gh#crossbario/autobahn-python#1647
Patch2: support-new-pytest-asyncio.patch
# PATCH-FIX-UPSTREAM gh#crossbario/autobahn-python#1661
Patch3: use-plain-twisted.patch
BuildRequires: %{python_module PyNaCl >= 1.4.0}
BuildRequires: %{python_module Twisted >= 24.3.0}
BuildRequires: %{python_module argon2-cffi >= 20.1.0}
BuildRequires: %{python_module attrs >= 20.3.0}
BuildRequires: %{python_module cbor2 >= 5.2.0}
BuildRequires: %{python_module cffi >= 1.14.5}
BuildRequires: %{python_module cryptography >= 3.4.6}
BuildRequires: %{python_module devel >= 3.9}
BuildRequires: %{python_module flatbuffers >= 22.12.6}
BuildRequires: %{python_module hyperlink >= 21.0.0}
BuildRequires: %{python_module msgpack >= 1.0.2}
BuildRequires: %{python_module passlib >= 1.7.4}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module py-ubjson >= 0.16.1}
BuildRequires: %{python_module pyOpenSSL >= 20.0.1}
BuildRequires: %{python_module pytest >= 2.8.6}
BuildRequires: %{python_module pytest-aiohttp}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytrie >= 0.4.0}
BuildRequires: %{python_module qrcode >= 7.3.1}
BuildRequires: %{python_module service_identity >= 18.1.0}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module txaio >= 21.2.1}
BuildRequires: %{python_module ujson >= 4.0.2}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module wsaccel >= 0.6.3}
BuildRequires: %{python_module zope.interface >= 5.2.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-PyNaCl >= 1.4.0
Requires: python-Twisted >= 24.3.0
Requires: python-argon2-cffi >= 20.1.0
Requires: python-attrs >= 20.3.0
Requires: python-cbor2 >= 5.2.0
Requires: python-cffi >= 1.14.5
Requires: python-cryptography >= 3.4.6
Requires: python-flatbuffers >= 22.12.6
Requires: python-hyperlink >= 21.0.0
Requires: python-msgpack >= 1.0.2
Requires: python-passlib >= 1.7.4
Requires: python-py-ubjson >= 0.16.1
Requires: python-pyOpenSSL >= 20.0.1
Requires: python-pytrie >= 0.4.0
Requires: python-qrcode >= 7.3.1
Requires: python-service_identity >= 18.1.0
Requires: python-setuptools
Requires: python-txaio >= 21.2.1
Requires: python-ujson >= 4.0.2
Requires: python-wsaccel >= 0.6.3
Requires: python-zope.interface >= 5.2.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
WebSocket allows bidirectional real-time messaging on the Web and WAMP adds
asynchronous Remote Procedure Calls and Publish & Subscribe on top of WebSocket.
%prep
%autosetup -p1 -n autobahn-%{version}
# this test relies too much on rng that can behave randomly in obs
rm autobahn/test/test_rng.py
%build
%if %{with nvx_support}
export AUTOBAHN_USE_NVX=true
%endif
export CFLAGS="%{optflags}"
%pyproject_wheel
%install
%if %{with nvx_support}
export AUTOBAHN_USE_NVX=true
%endif
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/wamp
%python_clone -a %{buildroot}%{_bindir}/xbrnetwork
%python_clone -a %{buildroot}%{_bindir}/xbrnetwork-ui
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%if %{with nvx_support}
# It tries to test NVX, even if disabled
%check
export USE_ASYNCIO=true
export AUTOBAHN_USE_NVX=true
export PYTHONDONTWRITEBYTECODE=1
export PY_IGNORE_IMPORTMISMATCH=1
%pytest_arch
%endif
%post
%python_install_alternative wamp xbrnetwork xbrnetwork-ui
%postun
%python_uninstall_alternative wamp xbrnetwork xbrnetwork-ui
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitearch}/_nvx_utf8validator.abi3.so
%{python_sitearch}/autobahn
%{python_sitearch}/twisted
%{python_sitearch}/autobahn-%{version}.dist-info
%python_alternative %{_bindir}/wamp
%python_alternative %{_bindir}/xbrnetwork
%python_alternative %{_bindir}/xbrnetwork-ui
%changelog

24
respect-cflags.patch Normal file
View File

@@ -0,0 +1,24 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
Date: 2019-04-08
This bug was found while working on reproducible builds for openSUSE.
Without this patch, binaries would use SSE4.1 instructions if the build
machine's CPU had it available.
This could cause 'invalid instruction' faults on older user machines.
https://bugzilla.opensuse.org/show_bug.cgi?id=1100677
Index: autobahn-22.2.2/autobahn/nvx/_utf8validator.py
===================================================================
--- autobahn-22.2.2.orig/autobahn/nvx/_utf8validator.py
+++ autobahn-22.2.2/autobahn/nvx/_utf8validator.py
@@ -54,7 +54,7 @@ with open(os.path.join(os.path.dirname(_
"_nvx_utf8validator",
c_source,
libraries=[],
- extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes', '-O3', '-march=native'],
+ extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes'],
optional=optional
)

View File

@@ -0,0 +1,78 @@
From b8d88d02fe9458a084cf6c4a4ce4672b3cd7c4aa Mon Sep 17 00:00:00 2001
From: David Hotham <david.hotham@blueyonder.co.uk>
Date: Sat, 3 Aug 2024 22:01:10 +0100
Subject: [PATCH] fix some deprecations in tests
---
autobahn/asyncio/test/test_aio_websocket.py | 7 +++----
autobahn/wamp/test/test_wamp_component_aio.py | 12 ++++++------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/autobahn/asyncio/test/test_aio_websocket.py b/autobahn/asyncio/test/test_aio_websocket.py
index f80cc2499..afcbfcf9e 100644
--- a/autobahn/asyncio/test/test_aio_websocket.py
+++ b/autobahn/asyncio/test/test_aio_websocket.py
@@ -21,7 +21,6 @@ async def test_echo_async():
assert 'Hello!' == await echo_async('Hello!', 0)
-# @pytest.mark.asyncio(forbid_global_loop=True)
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
def test_websocket_custom_loop(event_loop):
factory = WebSocketServerFactory(loop=event_loop)
@@ -31,8 +30,7 @@ def test_websocket_custom_loop(event_loop):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-@pytest.mark.asyncio
-async def test_async_on_connect_server(event_loop):
+def test_async_on_connect_server(event_loop):
num = 42
done = txaio.create_future()
@@ -65,7 +63,8 @@ async def on_connect(req):
b'\r\n', # last string doesn't get a \r\n from join()
])
server.processHandshake()
- await done
+
+ event_loop.run_until_complete(done)
assert len(values) == 1
assert values[0] == num * num
diff --git a/autobahn/wamp/test/test_wamp_component_aio.py b/autobahn/wamp/test/test_wamp_component_aio.py
index 2de9bf358..2393fd7c6 100644
--- a/autobahn/wamp/test/test_wamp_component_aio.py
+++ b/autobahn/wamp/test/test_wamp_component_aio.py
@@ -34,8 +34,7 @@
from autobahn.asyncio.component import Component
@pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+")
- @pytest.mark.asyncio(forbid_global_loop=True)
- async def test_asyncio_component(event_loop):
+ def test_asyncio_component(event_loop):
orig_loop = txaio.config.loop
txaio.config.loop = event_loop
@@ -72,11 +71,11 @@ def done(f):
txaio.config.loop = orig_loop
assert comp._done_f is None
f.add_done_callback(done)
- await finished
+
+ event_loop.run_until_complete(finished)
@pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+")
- @pytest.mark.asyncio(forbid_global_loop=True)
- async def test_asyncio_component_404(event_loop):
+ def test_asyncio_component_404(event_loop):
"""
If something connects but then gets aborted, it should still try
to re-connect (in real cases this could be e.g. wrong path,
@@ -151,4 +150,5 @@ def done(f):
finished.set_result(None)
txaio.config.loop = orig_loop
f.add_done_callback(done)
- await finished
+
+ event_loop.run_until_complete(finished)

305
use-plain-twisted.patch Normal file
View File

@@ -0,0 +1,305 @@
From e74b425e286aa72a59d36a7e6785731a8c023409 Mon Sep 17 00:00:00 2001
From: meejah <meejah@meejah.ca>
Date: Sat, 7 Jun 2025 20:39:27 -0600
Subject: [PATCH 1/2] Plain twisted utilities are sufficient
---
.../twisted/test/test_tx_websocket_agent.py | 5 ++--
autobahn/twisted/testing/__init__.py | 29 ++-----------------
2 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/autobahn/twisted/test/test_tx_websocket_agent.py b/autobahn/twisted/test/test_tx_websocket_agent.py
index c926cbefa..d65c3ca80 100644
--- a/autobahn/twisted/test/test_tx_websocket_agent.py
+++ b/autobahn/twisted/test/test_tx_websocket_agent.py
@@ -1,12 +1,13 @@
from twisted.trial import unittest
try:
- from autobahn.twisted.testing import create_memory_agent, MemoryReactorClockResolver, create_pumper
+ from autobahn.twisted.testing import create_memory_agent, create_pumper
HAVE_TESTING = True
except ImportError:
HAVE_TESTING = False
from twisted.internet.defer import inlineCallbacks
+from twisted.internet.testing import MemoryReactorClock
from autobahn.twisted.websocket import WebSocketServerProtocol
@@ -16,7 +17,7 @@ class TestAgent(unittest.TestCase):
def setUp(self):
self.pumper = create_pumper()
- self.reactor = MemoryReactorClockResolver()
+ self.reactor = MemoryReactorClock()
return self.pumper.start()
def tearDown(self):
diff --git a/autobahn/twisted/testing/__init__.py b/autobahn/twisted/testing/__init__.py
index 53d5f2d49..7926d79bb 100644
--- a/autobahn/twisted/testing/__init__.py
+++ b/autobahn/twisted/testing/__init__.py
@@ -73,32 +73,9 @@ def resolveHostName(self, receiver, hostName, portNumber=0):
receiver.resolutionComplete()
-@implementer(IReactorPluggableNameResolver)
-class _TestNameResolver(object):
- """
- A test version of IReactorPluggableNameResolver
- """
-
- _resolver = None
-
- @property
- def nameResolver(self):
- if self._resolver is None:
- self._resolver = _StaticTestResolver()
- return self._resolver
-
- def installNameResolver(self, resolver):
- old = self._resolver
- self._resolver = resolver
- return old
-
-
-class MemoryReactorClockResolver(MemoryReactorClock, _TestNameResolver):
- """
- Combine MemoryReactor, Clock and an IReactorPluggableNameResolver
- together.
- """
- pass
+# in previous revisions, we exported MemoryReactorClockResolver so
+# this maintains compatibility with any downstream code
+MemoryReactorClockResolver = MemoryReactorClock
class _TwistedWebMemoryAgent(IWebSocketClientAgent):
From 3067e1529d93855518c7a1c5bdc3b148e617d8cd Mon Sep 17 00:00:00 2001
From: meejah <meejah@meejah.ca>
Date: Sat, 7 Jun 2025 21:49:31 -0600
Subject: [PATCH 2/2] CI fixups
---
.github/workflows/main.yml | 15 +++++------
autobahn/asyncio/test/test_aio_rawsocket.py | 18 ++++++-------
autobahn/asyncio/test/test_aio_websocket.py | 8 +++---
autobahn/twisted/testing/__init__.py | 2 +-
autobahn/wamp/test/test_wamp_component_aio.py | 25 ++++++++++---------
tox.ini | 4 +++
6 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/autobahn/asyncio/test/test_aio_rawsocket.py b/autobahn/asyncio/test/test_aio_rawsocket.py
index 726a62420..42c00c304 100644
--- a/autobahn/asyncio/test/test_aio_rawsocket.py
+++ b/autobahn/asyncio/test/test_aio_rawsocket.py
@@ -11,7 +11,7 @@
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_sers(event_loop):
+def test_sers():
serializers = get_serializers()
assert len(serializers) > 0
m = serializers[0]().serialize(message.Abort('close'))
@@ -19,7 +19,7 @@ def test_sers(event_loop):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_prefix(event_loop):
+def test_prefix():
p = PrefixProtocol()
transport = Mock()
receiver = Mock()
@@ -62,7 +62,7 @@ def test_prefix(event_loop):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_is_closed(event_loop):
+def test_is_closed():
class CP(RawSocketClientProtocol):
@property
def serializer_id(self):
@@ -83,7 +83,7 @@ def serializer_id(self):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_server1(event_loop):
+def test_raw_socket_server1():
server = RawSocketServerProtocol()
ser = Mock(return_value=True)
@@ -108,7 +108,7 @@ def test_raw_socket_server1(event_loop):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_server_errors(event_loop):
+def test_raw_socket_server_errors():
server = RawSocketServerProtocol()
ser = Mock(return_value=True)
@@ -139,7 +139,7 @@ def test_raw_socket_server_errors(event_loop):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_client1(event_loop):
+def test_raw_socket_client1():
class CP(RawSocketClientProtocol):
@property
def serializer_id(self):
@@ -162,7 +162,7 @@ def serializer_id(self):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_raw_socket_client_error(event_loop):
+def test_raw_socket_client_error():
class CP(RawSocketClientProtocol):
@property
def serializer_id(self):
@@ -181,7 +181,7 @@ def serializer_id(self):
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_wamp_server(event_loop):
+def test_wamp_server():
transport = Mock(spec_set=('abort', 'close', 'write', 'get_extra_info'))
transport.write = Mock(side_effect=lambda m: messages.append(m))
server = Mock(spec=['onOpen', 'onMessage'])
@@ -209,7 +209,7 @@ def fact_server():
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_wamp_client(event_loop):
+def test_wamp_client():
transport = Mock(spec_set=('abort', 'close', 'write', 'get_extra_info'))
transport.write = Mock(side_effect=lambda m: messages.append(m))
client = Mock(spec=['onOpen', 'onMessage'])
diff --git a/autobahn/asyncio/test/test_aio_websocket.py b/autobahn/asyncio/test/test_aio_websocket.py
index afcbfcf9e..0c2f1ee0a 100644
--- a/autobahn/asyncio/test/test_aio_websocket.py
+++ b/autobahn/asyncio/test/test_aio_websocket.py
@@ -22,15 +22,15 @@ async def test_echo_async():
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_websocket_custom_loop(event_loop):
- factory = WebSocketServerFactory(loop=event_loop)
+def test_websocket_custom_loop():
+ factory = WebSocketServerFactory(loop=asyncio.new_event_loop())
server = factory()
transport = Mock()
server.connection_made(transport)
@pytest.mark.skipif(not os.environ.get('USE_ASYNCIO', False), reason='test runs on asyncio only')
-def test_async_on_connect_server(event_loop):
+def test_async_on_connect_server():
num = 42
done = txaio.create_future()
@@ -64,7 +64,7 @@ async def on_connect(req):
])
server.processHandshake()
- event_loop.run_until_complete(done)
+ asyncio.get_event_loop().run_until_complete(done)
assert len(values) == 1
assert values[0] == num * num
diff --git a/autobahn/twisted/testing/__init__.py b/autobahn/twisted/testing/__init__.py
index 7926d79bb..e014d3505 100644
--- a/autobahn/twisted/testing/__init__.py
+++ b/autobahn/twisted/testing/__init__.py
@@ -37,7 +37,7 @@
from twisted.internet.defer import Deferred
from twisted.internet.address import IPv4Address
from twisted.internet._resolver import HostResolution # "internal" class, but it's simple
-from twisted.internet.interfaces import ISSLTransport, IReactorPluggableNameResolver
+from twisted.internet.interfaces import ISSLTransport
try:
from twisted.internet.testing import MemoryReactorClock
except ImportError:
diff --git a/autobahn/wamp/test/test_wamp_component_aio.py b/autobahn/wamp/test/test_wamp_component_aio.py
index 2393fd7c6..971f8dddd 100644
--- a/autobahn/wamp/test/test_wamp_component_aio.py
+++ b/autobahn/wamp/test/test_wamp_component_aio.py
@@ -29,14 +29,15 @@
import unittest.mock as mock
import pytest
import txaio
+import asyncio
if os.environ.get('USE_ASYNCIO', False):
from autobahn.asyncio.component import Component
@pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+")
- def test_asyncio_component(event_loop):
+ def test_asyncio_component():
orig_loop = txaio.config.loop
- txaio.config.loop = event_loop
+ txaio.config.loop = asyncio.get_event_loop()
comp = Component(
transports=[
@@ -51,8 +52,8 @@ def test_asyncio_component(event_loop):
# if having trouble, try starting some logging (and use
# "py.test -s" to get real-time output)
# txaio.start_logging(level="debug")
- f = comp.start(loop=event_loop)
- txaio.config.loop = event_loop
+ f = comp.start(loop=asyncio.get_event_loop())
+ txaio.config.loop = asyncio.get_event_loop()
finished = txaio.create_future()
def fail():
@@ -72,17 +73,17 @@ def done(f):
assert comp._done_f is None
f.add_done_callback(done)
- event_loop.run_until_complete(finished)
+ asyncio.get_event_loop().run_until_complete(finished)
@pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+")
- def test_asyncio_component_404(event_loop):
+ def test_asyncio_component_404():
"""
If something connects but then gets aborted, it should still try
to re-connect (in real cases this could be e.g. wrong path,
TLS failure, WebSocket handshake failure, etc)
"""
orig_loop = txaio.config.loop
- txaio.config.loop = event_loop
+ txaio.config.loop = asyncio.get_event_loop()
class FakeTransport(object):
def close(self):
@@ -103,8 +104,8 @@ def create_connection(protocol_factory=None, server_hostname=None, host=None, po
else:
return txaio.create_future_error(RuntimeError("second connection fails completely"))
- with mock.patch.object(event_loop, 'create_connection', create_connection):
- event_loop.create_connection = create_connection
+ with mock.patch.object(txaio.config.loop, 'create_connection', create_connection):
+ txaio.config.loop.create_connection = create_connection
comp = Component(
transports=[
@@ -119,8 +120,8 @@ def create_connection(protocol_factory=None, server_hostname=None, host=None, po
# if having trouble, try starting some logging (and use
# "py.test -s" to get real-time output)
# txaio.start_logging(level="debug")
- f = comp.start(loop=event_loop)
- txaio.config.loop = event_loop
+ f = comp.start(loop=asyncio.get_event_loop())
+ txaio.config.loop = asyncio.get_event_loop()
# now that we've started connecting, we *should* be able
# to connetion_lost our transport .. but we do a
@@ -151,4 +152,4 @@ def done(f):
txaio.config.loop = orig_loop
f.add_done_callback(done)
- event_loop.run_until_complete(finished)
+ asyncio.get_event_loop().run_until_complete(finished)