about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/logbook/default.nix
blob: c58f617b10f8659918b1d3bea5b0e35f9628d0af (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ lib
, brotli
, buildPythonPackage
, cython
, execnet
, fetchFromGitHub
, jinja2
, pytestCheckHook
, pythonOlder
, pyzmq
, redis
, setuptools
, sqlalchemy
}:

buildPythonPackage rec {
  pname = "logbook";
  version = "1.7.0.post0";
  format = "setuptools";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "getlogbook";
    repo = "logbook";
    rev = "refs/tags/${version}";
    hash = "sha256-bqfFSd7CPYII/3AJCMApqmAYrAWjecOb3JA17FPFMIc=";
  };

  nativeBuildInputs = [
    cython
    setuptools
  ];

  passthru.optional-dependencies = {
    execnet = [
      execnet
    ];
    sqlalchemy = [
      sqlalchemy
    ];
    redis = [
      redis
    ];
    zmq = [
      pyzmq
    ];
    compression = [
      brotli
    ];
    jinja = [
      jinja2
    ];
    all = [
      brotli
      execnet
      jinja2
      pyzmq
      redis
      sqlalchemy
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  # Some of the tests use localhost networking.
  __darwinAllowLocalNetworking = true;

  pythonImportsCheck = [
    "logbook"
  ];

  disabledTests = [
    # Test require Redis instance
    "test_redis_handler"
  ];

  meta = with lib; {
    description = "A logging replacement for Python";
    homepage = "https://logbook.readthedocs.io/";
    changelog = "https://github.com/getlogbook/logbook/blob/${version}/CHANGES";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}