about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-harvest/default.nix
blob: 3cfcd663599750b2b631c7b63b5a2d730e61d242 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools-scm
, pytest-runner
, pytest
, decopatch
, makefun
, six
, pytestCheckHook
, numpy
, pandas
, tabulate
, pytest-cases
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pytest-harvest";
  version = "1.10.5";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "smarie";
    repo = "python-pytest-harvest";
    rev = "refs/tags/${version}";
    hash = "sha256-s8QiuUFRTTRhSpLa0DHScKFC9xdu+w2rssWCg8sIjsg=";
  };

  # create file, that is created by setuptools_scm
  # we disable this file creation as it touches internet
  postPatch = ''
    echo "version = '${version}'" > pytest_harvest/_version.py
  '';

  nativeBuildInputs = [
    setuptools-scm
    pytest-runner
  ];

  buildInputs = [ pytest ];

  propagatedBuildInputs = [
    decopatch
    makefun
    six
  ];

  nativeCheckInputs = [
    pytestCheckHook
    numpy
    pandas
    tabulate
    pytest-cases
  ];

  pythonImportsCheck = [ "pytest_harvest" ];

  meta = with lib; {
    description = "Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes";
    homepage = "https://github.com/smarie/python-pytest-harvest";
    changelog = "https://github.com/smarie/python-pytest-harvest/releases/tag/${src.rev}";
    license = licenses.bsd3;
    maintainers = with maintainers; [ mbalatsko ];
  };
}