1{ stdenv, buildPythonPackage, fetchFromGitHub, isPy3k, numpy, pytest }:
2
3buildPythonPackage rec {
4 pname = "pycm";
5 version = "2.5";
6
7 disabled = !isPy3k;
8
9 src = fetchFromGitHub {
10 owner = "sepandhaghighi";
11 repo = pname;
12 rev = "v${version}";
13 sha256 = "0zfv20hd7zq95sflsivjk47b0sm7q76w7fv2i2mafn83ficzx0p0";
14 };
15
16 # remove a trivial dependency on the author's `art` Python ASCII art library
17 postPatch = ''
18 rm pycm/__main__.py
19 substituteInPlace setup.py --replace '=get_requires()' '=[]'
20 '';
21
22 checkInputs = [ pytest ];
23 propagatedBuildInputs = [ numpy ];
24
25 checkPhase = ''
26 pytest Test/
27 '';
28
29 meta = with stdenv.lib; {
30 description = "Multiclass confusion matrix library";
31 homepage = "https://pycm.ir";
32 license = licenses.mit;
33 maintainers = with maintainers; [ bcdarwin ];
34 };
35}