summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/logutils/default.nix
blob: fb12cdd2e39ae2163f72de5c2358b23fa586b800 (plain)
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
61
62
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchPypi,
  pytestCheckHook,
  pythonAtLeast,
  valkey,
  redis,
  setuptools,
}:

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

  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'" "'${valkey}/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 = [
    # Disable redis tests on all systems for now
    "tests/test_redis.py"
  ]
  # lib.optionals (stdenv.hostPlatform.isDarwin) [
  #   # Exception: unable to connect to Redis server
  #   "tests/test_redis.py"
  # ]
  ++ lib.optionals (pythonAtLeast "3.13") [
    "tests/test_dictconfig.py"
  ];

  pythonImportsCheck = [ "logutils" ];

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