about summary refs log tree commit diff
path: root/pkgs/development/python-modules/logutils/default.nix
blob: b46ff4b13442476753d551ee166cf0f724f80015 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, pythonOlder
, redis
, redis-server
, setuptools
}:

buildPythonPackage rec {
  pname = "logutils";
  version = "0.3.5";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-vAWKJdXCCUYfE04fA8q2N9ZqelzMEuWT21b7snmJmoI=";
  };

  postPatch = ''
    substituteInPlace tests/test_dictconfig.py \
      --replace-fail "assertEquals" "assertEqual"
    substituteInPlace tests/test_redis.py \
      --replace-fail "'redis-server'" "'${redis-server}/bin/redis-server'"
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    pytestCheckHook
    redis
  ];

  disabledTests = [
    # https://bitbucket.org/vinay.sajip/logutils/issues/4/035-pytest-test-suite-warnings-and-errors
    "test_hashandlers"
  ];

  disabledTestPaths = lib.optionals (stdenv.isDarwin) [
    # Exception: unable to connect to Redis server
    "tests/test_redis.py"
  ];

  pythonImportsCheck = [
    "logutils"
  ];

  meta = with lib; {
    description = "Logging utilities";
    homepage = "https://bitbucket.org/vinay.sajip/logutils/";
    license = licenses.bsd0;
    maintainers = with maintainers; [ ];
  };
}