summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyrevolve/default.nix
blob: 012ce50dc62eda73d1e88469e67973cab533ea3f (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  contexttimer,
  setuptools,
  versioneer,
  cython_0,
  numpy,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "pyrevolve";
  version = "2.2.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "devitocodes";
    repo = pname;
    tag = "v${version}";
    hash = "sha256-jjiFOlxXjaa4L4IEtojeeS0jx4GsftAeIGBpJLhUcY4=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace ', "flake8"' ""
  '';

  nativeBuildInputs = [
    cython_0
    setuptools
    versioneer
  ];

  propagatedBuildInputs = [
    contexttimer
    numpy
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  preCheck = ''
    rm -rf pyrevolve
  '';

  pythonImportsCheck = [ "pyrevolve" ];

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