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