summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/nimfa/default.nix
blob: b2009ba24b7de6b6fc5e83d612d38b3a0deedaa3 (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
{
  lib,
  buildPythonPackage,
  fetchPypi,
  isPy3k,
  numpy,
  scipy,
  matplotlib,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "nimfa";
  version = "1.4.0";
  format = "setuptools";
  setuptools = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-Oc/yuGhW0Dyoo9nDhZgDTs8adowyX9OnKLuerbjGuRk=";
  };

  dependencies = [
    numpy
    scipy
  ];

  nativeCheckInputs = [
    matplotlib
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail "import imp" "" \
      --replace-fail "os.path.exists('.git')" "True" \
      --replace-fail "GIT_REVISION = git_version()" "GIT_REVISION = 'v${version}'"
  '';

  doCheck = !isPy3k; # https://github.com/marinkaz/nimfa/issues/42

  meta = {
    description = "Nonnegative matrix factorization library";
    homepage = "http://nimfa.biolab.si";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ ashgillman ];
  };
}