Chih-Hsuan Yen pushed to branch main at Arch Linux / Packaging / Packages / 
python-autobahn


Commits:
0bbaca53 by Chih-Hsuan Yen at 2024-03-08T01:55:14+08:00
Allow tests to pass with newer pytest-asyncio

- - - - -


3 changed files:

- + .SRCINFO
- PKGBUILD
- + pytest-asyncio-0.23.diff


Changes:

=====================================
.SRCINFO
=====================================
@@ -0,0 +1,55 @@
+pkgbase = python-autobahn
+       pkgdesc = Real-time framework for Web, Mobile & Internet of Things
+       pkgver = 23.6.2
+       pkgrel = 1
+       url = https://github.com/crossbario/autobahn-python/
+       arch = x86_64
+       license = MIT
+       checkdepends = python-pytest
+       checkdepends = python-pytest-asyncio
+       makedepends = python-argon2_cffi
+       makedepends = python-cbor2
+       makedepends = python-flatbuffers
+       makedepends = python-msgpack
+       makedepends = python-passlib
+       makedepends = python-pynacl
+       makedepends = python-pytrie
+       makedepends = python-setuptools
+       makedepends = python-ubjson
+       makedepends = python-u-msgpack
+       makedepends = python-ujson
+       makedepends = python-qrcode
+       makedepends = python-pyopenssl
+       makedepends = python-snappy
+       makedepends = python-click
+       makedepends = python-txtorcon
+       depends = glibc
+       depends = python
+       depends = python-cffi
+       depends = python-twisted
+       depends = python-txaio
+       depends = python-wsaccel
+       depends = python-cryptography
+       depends = python-hyperlink
+       depends = python-zope-interface
+       optdepends = python-cbor2: CBOR serializer support
+       optdepends = python-flatbuffers: FlatBuffers serializer support
+       optdepends = python-msgpack: MsgPack serializer support
+       optdepends = python-u-msgpack: pure-python alternative to 
python-msgpack for MsgPack serializer support
+       optdepends = python-ubjson: UBJSON serializer support
+       optdepends = python-ujson: accelerated JSON serializer support
+       optdepends = python-argon2_cffi: WAMP-SCRAM authentication support
+       optdepends = python-passlib: WAMP-SCRAM authentication support
+       optdepends = python-pynacl: WAMP-cryptosign and WAMP-cryptobox support
+       optdepends = python-pytrie: WAMP-cryptobox support
+       optdepends = python-qrcode: support QR codes in WAMP
+       optdepends = python-pyopenssl: SSL/TLS support
+       optdepends = python-snappy: snappy compression suppport for WebSocket 
messages
+       optdepends = python-click: for text highlights
+       optdepends = python-txtorcon: connections to Tor Onion services
+       source = 
https://files.pythonhosted.org/packages/source/a/autobahn/autobahn-23.6.2.tar.gz
+       source = pytest-asyncio-0.23.diff
+       sha256sums = 
ec9421c52a2103364d1ef0468036e6019ee84f71721e86b36fe19ad6966c1181
+       sha256sums = 
99f95a0d0729d96a834b60d44ab3f60d2f91f7cfd47b78d0d6febd23f2286a6c
+
+pkgname = python-autobahn


=====================================
PKGBUILD
=====================================
@@ -36,8 +36,10 @@ optdepends=(
   'python-txtorcon: connections to Tor Onion services'
 )
 
-source=(https://files.pythonhosted.org/packages/source/a/autobahn/autobahn-$pkgver.tar.gz)
-sha256sums=('ec9421c52a2103364d1ef0468036e6019ee84f71721e86b36fe19ad6966c1181')
+source=(https://files.pythonhosted.org/packages/source/a/autobahn/autobahn-$pkgver.tar.gz
+        pytest-asyncio-0.23.diff)
+sha256sums=('ec9421c52a2103364d1ef0468036e6019ee84f71721e86b36fe19ad6966c1181'
+            '99f95a0d0729d96a834b60d44ab3f60d2f91f7cfd47b78d0d6febd23f2286a6c')
 
 prepare() {
   cd "$srcdir/autobahn-$pkgver"
@@ -46,6 +48,10 @@ prepare() {
   # replaced with -march=nehalem so that the SSE 4.1 implementation is built
   # [1] 
https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0002-march.rst
   sed -i "s#, '-march=native'##" autobahn/nvx/_utf8validator.py
+
+  # Allow tests to pass with newer pytest-asyncio
+  # See discussions in https://github.com/crossbario/autobahn-python/pull/1628
+  patch -Np1 -i ../pytest-asyncio-0.23.diff
 }
 
 build() {


=====================================
pytest-asyncio-0.23.diff
=====================================
@@ -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 168933ea..2de9bf35 100644
+--- a/autobahn/wamp/test/test_wamp_component_aio.py
++++ b/autobahn/wamp/test/test_wamp_component_aio.py
+@@ -35,7 +35,7 @@ if os.environ.get('USE_ASYNCIO', False):
+ 
+     @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 @@ if os.environ.get('USE_ASYNCIO', False):
+             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 @@ if os.environ.get('USE_ASYNCIO', False):
+                 finished.set_result(None)
+                 txaio.config.loop = orig_loop
+             f.add_done_callback(done)
+-            return finished
++            await finished



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/python-autobahn/-/commit/0bbaca5325d33a65a3f335b552a80d8b73ba153c

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/python-autobahn/-/commit/0bbaca5325d33a65a3f335b552a80d8b73ba153c
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to