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 # Disable redis tests on all systems for now
47 "tests/test_redis.py"
48 ]
49 # lib.optionals (stdenv.hostPlatform.isDarwin) [
50 # # Exception: unable to connect to Redis server
51 # "tests/test_redis.py"
52 # ]
53 ++ lib.optionals (pythonAtLeast "3.13") [
54 "tests/test_dictconfig.py"
55 ];
56
57 pythonImportsCheck = [ "logutils" ];
58
59 meta = with lib; {
60 description = "Logging utilities";
61 homepage = "https://bitbucket.org/vinay.sajip/logutils/";
62 license = licenses.bsd0;
63 maintainers = [ ];
64 };
65}