1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchPypi, 6 pytestCheckHook, 7 pythonAtLeast, 8 pythonOlder, 9 valkey, 10 redis, 11 setuptools, 12}: 13 14buildPythonPackage rec { 15 pname = "logutils"; 16 version = "0.3.5"; 17 pyproject = true; 18 19 disabled = pythonOlder "3.7"; 20 21 src = fetchPypi { 22 inherit pname version; 23 hash = "sha256-vAWKJdXCCUYfE04fA8q2N9ZqelzMEuWT21b7snmJmoI="; 24 }; 25 26 postPatch = '' 27 substituteInPlace tests/test_dictconfig.py \ 28 --replace-fail "assertEquals" "assertEqual" 29 substituteInPlace tests/test_redis.py \ 30 --replace-fail "'redis-server'" "'${valkey}/bin/redis-server'" 31 ''; 32 33 build-system = [ setuptools ]; 34 35 dependencies = [ 36 pytestCheckHook 37 redis 38 ]; 39 40 disabledTests = [ 41 # https://bitbucket.org/vinay.sajip/logutils/issues/4/035-pytest-test-suite-warnings-and-errors 42 "test_hashandlers" 43 ]; 44 45 disabledTestPaths = 46 lib.optionals (stdenv.hostPlatform.isDarwin) [ 47 # Exception: unable to connect to Redis server 48 "tests/test_redis.py" 49 ] 50 ++ lib.optionals (pythonAtLeast "3.13") [ 51 "tests/test_dictconfig.py" 52 ]; 53 54 pythonImportsCheck = [ "logutils" ]; 55 56 meta = with lib; { 57 description = "Logging utilities"; 58 homepage = "https://bitbucket.org/vinay.sajip/logutils/"; 59 license = licenses.bsd0; 60 maintainers = [ ]; 61 }; 62}