From d94b1138592bbb63d72d7e23c021b69b07357352 Mon Sep 17 00:00:00 2001 From: Philipp Volguine Date: Sun, 24 Mar 2019 20:21:27 -0400 Subject: [PATCH] pythonPackages.beaker: 1.8.0 -> 1.10.1 - The aim was to get this building on hydra - Midway I discovered a PR by Mic92 that bumps the version to 1.10.0, I have included some of his fixes to run tests correctly: - remove testing memcached (it tries to connect on import) - don't run external tests or a failing test on darwin (see https://github.com/bbangert/beaker/issues/166) - run nosetests rather than setup.py test because we need to specify exclude options. --- .../python-modules/beaker/default.nix | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/beaker/default.nix b/pkgs/development/python-modules/beaker/default.nix index 7a17fd0f1d0a..3882af3a67df 100644 --- a/pkgs/development/python-modules/beaker/default.nix +++ b/pkgs/development/python-modules/beaker/default.nix @@ -2,42 +2,75 @@ , buildPythonPackage , fetchFromGitHub , nose +, pylibmc +, memcached +, redis +, pymongo , mock , webtest , sqlalchemy , pycrypto +, cryptography , isPy27 +, isPy3k , funcsigs , pycryptopp }: buildPythonPackage rec { pname = "Beaker"; - version = "1.8.0"; + version = "1.10.1"; # The pypy release do not contains the tests src = fetchFromGitHub { owner = "bbangert"; repo = "beaker"; rev = "${version}"; - sha256 = "17yfr7a307n8rdl09was4j60xqk2s0hk0hywdkigrpj4qnw0is7g"; + sha256 = "0xrvg503xmi28w0hllr4s7fkap0p09fgw2wax3p1s2r6b3xjvbz7"; }; - buildInputs = - [ nose - mock - webtest - ]; propagatedBuildInputs = [ sqlalchemy pycrypto + cryptography ] ++ lib.optionals (isPy27) [ funcsigs pycryptopp ]; + checkInputs = [ + nose + mock + webtest + pylibmc + memcached + redis + pymongo + ]; + + + # Can not run memcached tests because it immediately tries to connect + postPatch = lib.optionalString isPy3k '' + substituteInPlace setup.py \ + --replace "python-memcached" "python3-memcached" + '' + '' + + rm tests/test_memcached.py + ''; + + # Disable external tests because they need to connect to a live database. + # Also disable a test in test_cache.py called "test_upgrade" because + # it currently fails on darwin. + # Please see issue https://github.com/bbangert/beaker/issues/166 + checkPhase = '' + nosetests \ + -e ".*test_ext_.*" \ + -e "test_upgrade" \ + -vv tests + ''; + meta = { description = "A Session and Caching library with WSGI Middleware"; maintainers = with lib.maintainers; [ garbas domenkozar ]; }; -} \ No newline at end of file +}