1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, glibcLocales
6, nose
7, pylibmc
8, python-memcached
9, redis
10, pymongo
11, mock
12, webtest
13, sqlalchemy
14, pycrypto
15, cryptography
16, isPy27
17, isPy3k
18, funcsigs ? null
19, pycryptopp ? null
20}:
21
22buildPythonPackage rec {
23 pname = "Beaker";
24 version = "1.11.0";
25
26 # The pypy release do not contains the tests
27 src = fetchFromGitHub {
28 owner = "bbangert";
29 repo = "beaker";
30 rev = version;
31 sha256 = "059sc7iar90lc2y9mppdis5ddfcxyirz03gmsfb0307f5dsa1dhj";
32 };
33
34 propagatedBuildInputs = [
35 sqlalchemy
36 pycrypto
37 cryptography
38 ] ++ lib.optionals (isPy27) [
39 funcsigs
40 pycryptopp
41 ];
42
43 checkInputs = [
44 glibcLocales
45 python-memcached
46 mock
47 nose
48 pylibmc
49 pymongo
50 redis
51 webtest
52 ];
53
54 # Can not run memcached tests because it immediately tries to connect
55 postPatch = ''
56 rm tests/test_memcached.py
57 '';
58
59 # Disable external tests because they need to connect to a live database.
60 # Also disable a test in test_cache.py called "test_upgrade" because
61 # it currently fails on darwin.
62 # Please see issue https://github.com/bbangert/beaker/issues/166
63 checkPhase = ''
64 nosetests \
65 -e ".*test_ext_.*" \
66 -e "test_upgrade" \
67 ${lib.optionalString (!stdenv.isLinux) ''-e "test_cookie_expires_different_locale"''} \
68 -vv tests
69 '';
70
71 meta = {
72 description = "A Session and Caching library with WSGI Middleware";
73 homepage = "https://github.com/bbangert/beaker";
74 license = lib.licenses.bsd3;
75 maintainers = with lib.maintainers; [ domenkozar ];
76 knownVulnerabilities = [
77 "CVE-2013-7489"
78 ];
79 };
80}