2022-01-05 14:24:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, matplotlib
|
|
|
|
, numpy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, seaborn
|
|
|
|
}:
|
2020-01-06 22:26:35 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycm";
|
2023-06-13 03:29:02 +00:00
|
|
|
version = "4.0";
|
2022-01-05 14:24:38 +00:00
|
|
|
format = "setuptools";
|
2020-01-06 22:26:35 +00:00
|
|
|
|
2022-01-05 14:24:38 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-01-06 22:26:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-05 14:24:38 +00:00
|
|
|
owner = "sepandhaghighi";
|
|
|
|
repo = pname;
|
2022-04-28 03:30:40 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-06-13 03:29:02 +00:00
|
|
|
hash = "sha256-GyH06G7bArFBTzV/Sx/KmoJvcoed0sswW7qGqsSULHo=";
|
2020-01-06 22:26:35 +00:00
|
|
|
};
|
|
|
|
|
2022-01-05 14:24:38 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
seaborn
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-05 14:24:38 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2020-01-06 22:26:35 +00:00
|
|
|
postPatch = ''
|
2022-01-05 14:24:38 +00:00
|
|
|
# Remove a trivial dependency on the author's `art` Python ASCII art library
|
2020-01-06 22:26:35 +00:00
|
|
|
rm pycm/__main__.py
|
2022-01-05 14:24:38 +00:00
|
|
|
# Also depends on python3Packages.notebook
|
|
|
|
rm Otherfiles/notebook_check.py
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '=get_requires()' '=[]'
|
2020-01-06 22:26:35 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-15 15:33:47 +00:00
|
|
|
# https://github.com/sepandhaghighi/pycm/issues/488
|
|
|
|
pytestFlagsArray = [ "Test" ];
|
2022-01-05 14:24:38 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pycm"
|
|
|
|
];
|
2020-01-06 22:26:35 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-01-06 22:26:35 +00:00
|
|
|
description = "Multiclass confusion matrix library";
|
2023-03-15 15:33:47 +00:00
|
|
|
homepage = "https://pycm.io";
|
2020-01-06 22:26:35 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|