@@ -0,0 +1,34 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, stdenv, isPy3k, fetchpatch, humanfriendly, verboselogs, capturer, pytest, mock, utillinux }:
2+
3+buildPythonPackage rec {
4+ pname = "coloredlogs";
5+ version = "10.0";
6+
7+ src = fetchFromGitHub {
8+ owner = "xolox";
9+ repo = "python-coloredlogs";
10+ rev = version;
11+ sha256 = "0rdvp4dfvzhx7z7s2jdl3fv7x1hazgpy5gc7bcf05bnbv2iia54a";
12+ };
13+
14+ # patch by risicle
15+ patches = lib.optional (stdenv.isDarwin && isPy3k) (fetchpatch {
16+ name = "darwin-py3-capture-fix.patch";
17+ url = "https://github.com/xolox/python-coloredlogs/pull/74.patch";
18+ sha256 = "0pk7k94iz0gdripw623vzdl4hd83vwhsfzshl8pbvh1n6swi0xx9";
19+ });
20+
21+ checkPhase = ''
22+ PATH=$PATH:$out/bin pytest . -k "not test_plain_text_output_format"
23+ '';
24+ checkInputs = [ pytest mock utillinux ];
25+
26+ propagatedBuildInputs = [ humanfriendly verboselogs capturer ];
27+
28+ meta = with lib; {
29+ description = "Colored stream handler for Python's logging module";
30+ homepage = https://github.com/xolox/python-coloredlogs;
31+ license = licenses.mit;
32+ maintainers = with maintainers; [ eyjhb ];
33+ };
34+}