nixpkgs/pkgs/development/python-modules/pycm/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.1 KiB
Nix
Raw Normal View History

{ 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";
format = "setuptools";
2020-01-06 22:26:35 +00:00
disabled = pythonOlder "3.5";
2020-01-06 22:26:35 +00:00
src = fetchFromGitHub {
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
};
propagatedBuildInputs = [
matplotlib
numpy
seaborn
];
nativeCheckInputs = [
pytestCheckHook
];
2020-01-06 22:26:35 +00:00
postPatch = ''
# 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
# Also depends on python3Packages.notebook
rm Otherfiles/notebook_check.py
substituteInPlace setup.py \
--replace '=get_requires()' '=[]'
2020-01-06 22:26:35 +00:00
'';
# https://github.com/sepandhaghighi/pycm/issues/488
pytestFlagsArray = [ "Test" ];
pythonImportsCheck = [
"pycm"
];
2020-01-06 22:26:35 +00:00
meta = with lib; {
2020-01-06 22:26:35 +00:00
description = "Multiclass confusion matrix library";
homepage = "https://pycm.io";
2020-01-06 22:26:35 +00:00
license = licenses.mit;
maintainers = with maintainers; [ bcdarwin ];
};
}