1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 freezegun,
6 pytestCheckHook,
7 pythonAtLeast,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "python-json-logger";
13 version = "3.3.0";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "nhairs";
18 repo = "python-json-logger";
19 tag = "v${version}";
20 hash = "sha256-q1s+WRU5xTmF4YW20DrDnXbMeW6vGYzVekxxIDVt8gw=";
21 };
22
23 build-system = [ setuptools ];
24
25 nativeCheckInputs = [
26 freezegun
27 pytestCheckHook
28 ];
29
30 disabledTests =
31 lib.optionals (pythonAtLeast "3.12") [
32 # https://github.com/madzak/python-json-logger/issues/185
33 "test_custom_object_serialization"
34 "test_percentage_format"
35 "test_rename_reserved_attrs"
36 ]
37 ++ lib.optionals (pythonAtLeast "3.13") [
38 # https://github.com/madzak/python-json-logger/issues/198
39 "test_json_default_encoder_with_timestamp"
40 ];
41
42 meta = with lib; {
43 description = "Json Formatter for the standard python logger";
44 homepage = "https://github.com/madzak/python-json-logger";
45 license = licenses.bsdOriginal;
46 maintainers = [ ];
47 };
48}