about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/energyflow/default.nix
blob: 5f89337f0de22bb5468683b011919ab92255e716 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, h5py
, numpy
, six
, wasserstein
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "EnergyFlow";
  version = "1.3.2";

  src = fetchFromGitHub {
    owner = "pkomiske";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-fjT8c0ZTjdufP334upPzRVdTJDIBs84I7PkFu4CMcQw=";
  };

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "setup_requires=" "" \
      --replace "pytest-runner" ""
  '';

  propagatedBuildInputs = [
    h5py
    numpy
    six
    wasserstein
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];
  pytestFlagsArray = [
    "energyflow/tests"
  ];
  disabledTestPaths = [
    "energyflow/tests/test_archs.py" # requires tensorflow
    "energyflow/tests/test_emd.py" # requires "ot"
  ];

  pythonImportsCheck = [ "energyflow" ];

  meta = with lib; {
    description = "Python package for the EnergyFlow suite of tools";
    homepage = "https://energyflow.network/";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ veprbl ];
  };
}