summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pycm/default.nix
blob: 416bd18a2c371f3ffa0030576ccee3ed3111aec6 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  matplotlib,
  numpy,
  pytestCheckHook,
  pytest-cov-stub,
  seaborn,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pycm";
  version = "4.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "sepandhaghighi";
    repo = pname;
    tag = "v${version}";
    hash = "sha256-JX75UEaONL+2n6xePE2hbIEMmnt0RknWNWgpbMwNyhw=";
  };

  build-system = [ setuptools ];

  dependencies = [
    matplotlib
    numpy
    seaborn
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
    matplotlib
  ];

  disabledTests = [
    "plot_error_test" # broken doctest (expects matplotlib import exception)
  ];

  postPatch = ''
    # Remove a trivial dependency on the author's `art` Python ASCII art library
    rm pycm/__main__.py
    substituteInPlace setup.py \
      --replace-fail '=get_requires()' '=[]'
  '';

  pythonImportsCheck = [ "pycm" ];

  meta = {
    description = "Multiclass confusion matrix library";
    homepage = "https://pycm.io";
    changelog = "https://github.com/sepandhaghighi/pycm/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}