Commits

Philip Jenvey committed 9e5c21d Merge

Comments (0)

Files changed (2)

beaker/crypto/pbkdf2.py

 
     def __init__(self, passphrase, salt, iterations=1000,
                  digestmodule=SHA1, macmodule=HMAC):
-        # Support both sha/md5 style modules and hashlib functions
         if not callable(macmodule):
             macmodule = macmodule.new
-        if not callable(digestmodule):
-            digestmodule = digestmodule.new
         self.__macmodule = macmodule
         self.__digestmodule = digestmodule
         self._setup(passphrase, salt, iterations, self._pseudorandom)
+import sys
+
 from setuptools import setup, find_packages
 
 version = '1.0.2'
 
+pycryptopp = 'pycryptopp>=0.3.0'
+tests_require = ['nose', 'python-memcached', 'webtest']
+if not sys.platform.startswith('java') and not sys.platform == 'cli':
+    tests_require.extend([pycryptopp, 'SQLALchemy'])
+    try:
+        import sqlite3
+    except ImportError:
+        tests_require.append('pysqlite')
+
 setup(name='Beaker',
       version=version,
       description="A Session and Caching library with WSGI Middleware",
       zip_safe=False,
       install_requires=[],
       extras_require={
-          'crypto':["pycryptopp>=0.3.0"]
+          'crypto':[pycryptopp]
       },
       test_suite='nose.collector',
-      tests_require=['nose', 'webtest'],
+      tests_require=tests_require,
       entry_points="""
           [paste.filter_factory]
           beaker_session = beaker.middleware:session_filter_factory