1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 colorama,
6 exceptiongroup,
7 fetchFromGitHub,
8 flit-core,
9 freezegun,
10 pytest-mypy-plugins,
11 pytest-xdist,
12 pytestCheckHook,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "loguru";
18 version = "0.7.3";
19
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "Delgan";
26 repo = "loguru";
27 tag = version;
28 hash = "sha256-tccEzzs9TtFAZM9s43cskF9llc81Ng28LqedjLiE1m4=";
29 };
30
31 build-system = [ flit-core ];
32
33 nativeCheckInputs = [
34 pytestCheckHook
35 pytest-xdist # massive speedup, not tested by upstream
36 colorama
37 freezegun
38 pytest-mypy-plugins
39 ]
40 ++ lib.optional (pythonOlder "3.10") exceptiongroup;
41
42 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_multiprocessing.py" ];
43
44 disabledTests = [
45 # fails on some machine configurations
46 # AssertionError: assert '' != ''
47 "test_file_buffering"
48 # Slow test
49 "test_time_rotation"
50 # broken on latest mypy, fixed upstream, but does not apply cleanly
51 # https://github.com/Delgan/loguru/commit/7608a014df0fa5c3322dec032345482aa5305a56
52 # FIXME: remove in next update
53 "typesafety"
54 ]
55 ++ lib.optionals stdenv.hostPlatform.isDarwin [
56 "test_rotation_and_retention"
57 "test_rotation_and_retention_timed_file"
58 "test_renaming"
59 "test_await_complete_inheritance"
60 ];
61
62 pythonImportsCheck = [ "loguru" ];
63
64 meta = {
65 description = "Python logging made (stupidly) simple";
66 homepage = "https://github.com/Delgan/loguru";
67 changelog = "https://github.com/delgan/loguru/releases/tag/${version}";
68 license = lib.licenses.mit;
69 maintainers = with lib.maintainers; [
70 jakewaksbaum
71 rmcgibbo
72 ];
73 };
74}