[arch-commits] Commit in python-beaker/trunk (PKGBUILD)

Felix Yan felixonmars at archlinux.org
Thu Feb 7 11:21:16 UTC 2019


    Date: Thursday, February 7, 2019 @ 11:21:15
  Author: felixonmars
Revision: 345432

upgpkg: python-beaker 1.10.0-3

- remove pycryptodomex hack as we have pycryptodome now
- fake mongodb to pass tests

Modified:
  python-beaker/trunk/PKGBUILD

----------+
 PKGBUILD |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-02-07 11:21:10 UTC (rev 345431)
+++ PKGBUILD	2019-02-07 11:21:15 UTC (rev 345432)
@@ -5,7 +5,7 @@
 pkgbase=python-beaker
 pkgname=('python-beaker' 'python2-beaker')
 pkgver=1.10.0
-pkgrel=2
+pkgrel=3
 arch=('any')
 license=('custom')
 pkgdesc="Caching and sessions WSGI middleware for use with web applications and stand-alone Python scripts and applications"
@@ -12,17 +12,20 @@
 url="http://beaker.groovie.org/"
 makedepends=('python-setuptools' 'python2-setuptools' 'python2-funcsigs')
 checkdepends=('python-nose' 'python2-nose' 'python-mock' 'python2-mock' 'python-sqlalchemy'
-              'python2-sqlalchemy' 'python-pycryptodomex' 'python2-pycryptodomex' 'python-coverage'
+              'python2-sqlalchemy' 'python-pycryptodome' 'python2-pycryptodome' 'python-coverage'
               'python2-coverage' 'python-webtest' 'python2-webtest' 'python-redis' 'python2-redis'
               'python-pymongo' 'python2-pymongo' 'python-pylibmc' 'python2-pylibmc' 'redis'
               'python-cryptography' 'python2-cryptography' 'python-memcached' 'python2-memcached'
-              'memcached' 'mongodb' 'pifpaf')
+              'memcached' 'pifpaf' 'python-mongomock' 'python2-mongomock')
 source=("$pkgbase-$pkgver.tar.gz::https://github.com/bbangert/beaker/archive/$pkgver.tar.gz")
 sha512sums=('2a8a6e10f771aaa33190598a52bf1110f1ae1116828c1e9cd42aeceb3dc7a9af896f20c809f165c50940de44d48628d6cacb6f2b480a128bae05f902898ed2b5')
 
 prepare() {
-  sed -i "s/'pycryptodome'/'pycryptodomex'/g" beaker-$pkgver/setup.py
-  sed -i 's/from Crypto./from Cryptodome./' beaker-$pkgver/beaker/crypto/*.py
+  # Use a fake MongoDB for tests
+  sed -e '/class TestMongoDB/i import mongomock' \
+      -e "s|'mongodb://localhost:27017/beaker_testdb'|mongomock.MongoClient('mongodb://localhost:27017/beaker_testdb')|" \
+      -i beaker-$pkgver/tests/test_managers/test_ext_mongodb.py
+
   cp -a beaker-$pkgver{,-py2}
 
   sed -i "s#/usr/bin/python#/usr/bin/python3#" beaker-$pkgver/beaker/crypto/pbkdf2.py
@@ -39,10 +42,10 @@
 
 check() {
   cd "$srcdir"/beaker-$pkgver
-  pifpaf run memcached --port 11211 -- pifpaf run mongodb --port 27017 -- pifpaf run redis python setup.py nosetests || warning "Tests failed"
+  pifpaf run memcached --port 11211 -- pifpaf run redis python setup.py nosetests || warning "Tests failed"
 
   cd "$srcdir"/beaker-$pkgver-py2
-  pifpaf run memcached --port 11211 -- pifpaf run mongodb --port 27017 -- pifpaf run redis python2 setup.py nosetests
+  pifpaf run memcached --port 11211 -- pifpaf run redis python2 setup.py nosetests
 }
 
 package_python-beaker() {



More information about the arch-commits mailing list