about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/coloredlogs/default.nix
blob: 48d13ab49dd2ee87556682683d4a3d4c7832fffc (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
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, humanfriendly
, verboselogs
, capturer
, pytest
, mock
, util-linux
, isPy38
}:

buildPythonPackage rec {
  pname = "coloredlogs";
  version = "14.0";

  src = fetchFromGitHub {
    owner = "xolox";
    repo = "python-coloredlogs";
    rev = version;
    sha256 = "0rnmxwrim4razlv4vi3krxk5lc5ksck6h5374j8avqwplika7q2x";
  };

  # capturer is broken on darwin / py38, so we skip the test until a fix for
  # https://github.com/xolox/python-capturer/issues/10 is released.
  doCheck = !(isPy38 && stdenv.isDarwin);
  checkPhase = ''
    PATH=$PATH:$out/bin pytest . -k "not test_plain_text_output_format \
                                     and not test_auto_install"
  '';
  checkInputs = [ pytest mock util-linux verboselogs capturer ];

  pythonImportsCheck = [ "coloredlogs" ];

  propagatedBuildInputs = [ humanfriendly ];

  meta = with lib; {
    description = "Colored stream handler for Python's logging module";
    homepage = "https://github.com/xolox/python-coloredlogs";
    license = licenses.mit;
    maintainers = with maintainers; [ eyjhb ];
  };
}