about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyrevolve/default.nix
blob: 754baf91ad38c49a454f53edafefc9ddffd91759 (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
55
{ lib
, buildPythonPackage
, fetchFromGitHub
, contexttimer
, versioneer
, cython
, numpy
, pytest
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pyrevolve";
  version = "2.2.2";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "devitocodes";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-JLDn3WEBcdO8YYzt/MWOHB/1kcmbmZUsiH00/4Uwlxo=";
  };

  nativeBuildInputs = [
    versioneer
    cython
  ];

  propagatedBuildInputs = [
    contexttimer
    numpy
  ];

  nativeCheckInputs = [ pytest ];
  # Using approach bellow bcs the tests fail with the pytestCheckHook, throwing the following error
  # ImportError: cannot import name 'crevolve' from partially initialized module 'pyrevolve'
  # (most likely due to a circular import)
  checkPhase = ''
    pytest
  '';

  pythonImportsCheck = [
    "pyrevolve"
  ];

  meta = with lib; {
    homepage = "https://github.com/devitocodes/pyrevolve";
    changelog = "https://github.com/devitocodes/pyrevolve/releases/tag/v${version}";
    description = "Python library to manage checkpointing for adjoints";
    license = licenses.epl10;
    maintainers = with maintainers; [ atila ];
  };
}