1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 matplotlib,
6 numpy,
7 pytestCheckHook,
8 pythonOlder,
9 seaborn,
10}:
11
12buildPythonPackage rec {
13 pname = "pycm";
14 version = "4.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "sepandhaghighi";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-GyH06G7bArFBTzV/Sx/KmoJvcoed0sswW7qGqsSULHo=";
24 };
25
26 propagatedBuildInputs = [
27 matplotlib
28 numpy
29 seaborn
30 ];
31
32 nativeCheckInputs = [ pytestCheckHook ];
33
34 disabledTests = [
35 # Minor tolerance issues with Python 3.12; should be fixed in next release
36 # (see https://github.com/sepandhaghighi/pycm/pull/528)
37 "verified_test"
38 "function_test"
39 ];
40
41 postPatch = ''
42 # Remove a trivial dependency on the author's `art` Python ASCII art library
43 rm pycm/__main__.py
44 # Also depends on python3Packages.notebook
45 rm Otherfiles/notebook_check.py
46 substituteInPlace setup.py \
47 --replace-fail '=get_requires()' '=[]'
48 '';
49
50 pythonImportsCheck = [ "pycm" ];
51
52 meta = with lib; {
53 description = "Multiclass confusion matrix library";
54 homepage = "https://pycm.io";
55 license = licenses.mit;
56 maintainers = with maintainers; [ bcdarwin ];
57 };
58}