1{
2 lib,
3 brotli,
4 buildPythonPackage,
5 cython,
6 execnet,
7 fetchFromGitHub,
8 jinja2,
9 pytestCheckHook,
10 pytest-rerunfailures,
11 pythonOlder,
12 pyzmq,
13 redis,
14 setuptools,
15 sqlalchemy,
16}:
17
18buildPythonPackage rec {
19 pname = "logbook";
20 version = "1.8.2";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "getlogbook";
27 repo = "logbook";
28 tag = version;
29 hash = "sha256-21323iXtjyUAxAEFMsU6t1/nNLEN5G3jHcubNCEYQ3c=";
30 };
31
32 nativeBuildInputs = [
33 cython
34 setuptools
35 ];
36
37 optional-dependencies = {
38 execnet = [ execnet ];
39 sqlalchemy = [ sqlalchemy ];
40 redis = [ redis ];
41 zmq = [ pyzmq ];
42 compression = [ brotli ];
43 jinja = [ jinja2 ];
44 all = [
45 brotli
46 execnet
47 jinja2
48 pyzmq
49 redis
50 sqlalchemy
51 ];
52 };
53
54 nativeCheckInputs = [
55 pytestCheckHook
56 pytest-rerunfailures
57 ]
58 ++ lib.flatten (builtins.attrValues optional-dependencies);
59
60 # Some of the tests use localhost networking.
61 __darwinAllowLocalNetworking = true;
62
63 pythonImportsCheck = [ "logbook" ];
64
65 disabledTests = [
66 # Test require Redis instance
67 "test_redis_handler"
68 ];
69
70 meta = with lib; {
71 description = "Logging replacement for Python";
72 homepage = "https://logbook.readthedocs.io/";
73 changelog = "https://github.com/getlogbook/logbook/blob/${src.tag}/CHANGES";
74 license = licenses.bsd3;
75 maintainers = [ ];
76 };
77}