[arch-commits] Commit in python-autobahn/trunk (2 files)

Chih-Hsuan Yen yan12125 at archlinux.org
Fri Mar 22 17:12:09 UTC 2019


    Date: Friday, March 22, 2019 @ 17:12:08
  Author: yan12125
Revision: 443156

upgpkg: python-autobahn 19.3.2-1

* Drop python2-autobahn
* Enable tests
* wsaccel is optional (in extras_require). I place it in `depends` as check()
  runs with wsaccel available, and thus the pure Python validation algorithm
  is not tested, and it's better to use the same implementation for production.

Added:
  python-autobahn/trunk/skip-test-missing-serializers.patch
Modified:
  python-autobahn/trunk/PKGBUILD

-------------------------------------+
 PKGBUILD                            |   47 ++++++++++++++++++----------------
 skip-test-missing-serializers.patch |   34 ++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 22 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-03-22 17:10:19 UTC (rev 443155)
+++ PKGBUILD	2019-03-22 17:12:08 UTC (rev 443156)
@@ -1,44 +1,47 @@
 # Maintainer: Morten Linderud <foxboron at archlinux.org>
+# Maintainer: Chih-Hsuan Yen <yan12125 at archlinux.org>
 # Maintainer: Anatol Pomozov
 
-pkgbase=python-autobahn
-pkgname=(python-autobahn python2-autobahn)
-pkgver=19.1.1
+pkgname=python-autobahn
+pkgver=19.3.2
 pkgrel=1
 pkgdesc='Real-time framework for Web, Mobile & Internet of Things'
 arch=(any)
 url='https://crossbar.io/autobahn/'
 license=(MIT)
-makedepends=(python-setuptools python2-setuptools python-twisted python-six python-txaio python2-twisted python2-six python2-txaio)
-checkdepends=(python2-unittest2)
-source=(https://pypi.io/packages/source/a/autobahn/autobahn-$pkgver.tar.gz)
-sha256sums=('aebbadb700c13792a2967c79002855d1153b9ec8f2949d169e908388699596ff')
+depends=(python-twisted python-six python-txaio python-wsaccel)
+makedepends=(python-setuptools python-argon2_cffi python-msgpack python-passlib python-pynacl)
+checkdepends=(python-mock python-pytest python-pytest-asyncio)
+optdepends=(
+  'python-msgpack: MsgPack serializer support'
+  'python-argon2_cffi: WAMP-SCRAM authentication support'
+  'python-passlib: WAMP-SCRAM authentication support'
+  'python-pynacl: WAMP-cryptosign support'
+)
 
+source=(https://pypi.io/packages/source/a/autobahn/autobahn-$pkgver.tar.gz
+        skip-test-missing-serializers.patch)
+sha256sums=('70a221d5e01923ea81457de04a3270ea2de376a759345ec4e8693db216c603a9'
+            '2d4ec4300f98cddd13c3a4d70e6ae4934a98f17b04628cadfd18654172d04f92')
+
+prepare() {
+  cd "$srcdir/autobahn-$pkgver"
+  patch -Np1 -i ../skip-test-missing-serializers.patch
+}
+
 build() {
   cd "$srcdir/autobahn-$pkgver"
   python setup.py build
-  python2 setup.py build
 }
 
 check() {
   cd "$srcdir/autobahn-$pkgver"
-  #It requires python-unittest2 in [community]
-  #python setup.py test
-  #python2 setup.py test
+  USE_TWISTED=1 PYTHONPATH=. pytest -v autobahn
+  USE_ASYNCIO=1 PYTHONPATH=. pytest -v autobahn
 }
 
-package_python-autobahn() {
-  depends=(python python-twisted python-six python-txaio)
-
+package() {
   cd "$srcdir/autobahn-$pkgver"
   python setup.py install --root="$pkgdir" --optimize=1 --skip-build
   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
-
-package_python2-autobahn() {
-  depends=(python2 python2-twisted python2-six python2-txaio)
-
-  cd "$srcdir/autobahn-$pkgver"
-  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
-  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}

Added: skip-test-missing-serializers.patch
===================================================================
--- skip-test-missing-serializers.patch	                        (rev 0)
+++ skip-test-missing-serializers.patch	2019-03-22 17:12:08 UTC (rev 443156)
@@ -0,0 +1,34 @@
+diff --git a/autobahn/wamp/test/test_serializer.py b/autobahn/wamp/test/test_serializer.py
+index 8e47805c..117df18d 100644
+--- a/autobahn/wamp/test/test_serializer.py
++++ b/autobahn/wamp/test/test_serializer.py
+@@ -129,11 +129,17 @@ def create_serializers():
+     _serializers.append(serializer.MsgPackSerializer())
+     _serializers.append(serializer.MsgPackSerializer(batched=True))
+ 
+-    _serializers.append(serializer.CBORSerializer())
+-    _serializers.append(serializer.CBORSerializer(batched=True))
++    try:
++        _serializers.append(serializer.CBORSerializer())
++        _serializers.append(serializer.CBORSerializer(batched=True))
++    except AttributeError:
++        pass
+ 
+-    _serializers.append(serializer.UBJSONSerializer())
+-    _serializers.append(serializer.UBJSONSerializer(batched=True))
++    try:
++        _serializers.append(serializer.UBJSONSerializer())
++        _serializers.append(serializer.UBJSONSerializer(batched=True))
++    except AttributeError:
++        pass
+ 
+     # FIXME: implement full FlatBuffers serializer for WAMP
+     if six.PY3:
+@@ -146,6 +152,7 @@ def create_serializers():
+ 
+ 
+ @unittest.skipIf(not six.PY3, 'WAMP-FlatBuffers currently only supports Python 3')
++ at unittest.skipIf(not hasattr(serializer, 'FlatBuffersSerializer'), 'FlatBuffers support missing')
+ class TestFlatBuffersSerializer(unittest.TestCase):
+ 
+     def test_basic(self):



More information about the arch-commits mailing list