1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools-scm, 6 pytest, 7 decopatch, 8 makefun, 9 six, 10 pytestCheckHook, 11 numpy, 12 pandas, 13 tabulate, 14 pytest-cases, 15 pythonOlder, 16}: 17 18buildPythonPackage rec { 19 pname = "pytest-harvest"; 20 version = "1.10.5"; 21 pyproject = true; 22 23 disabled = pythonOlder "3.6"; 24 25 src = fetchFromGitHub { 26 owner = "smarie"; 27 repo = "python-pytest-harvest"; 28 tag = version; 29 hash = "sha256-s8QiuUFRTTRhSpLa0DHScKFC9xdu+w2rssWCg8sIjsg="; 30 }; 31 32 # create file, that is created by setuptools_scm 33 # we disable this file creation as it touches internet 34 postPatch = '' 35 echo "version = '${version}'" > pytest_harvest/_version.py 36 37 substituteInPlace pytest_harvest/tests/test_lazy_and_harvest.py \ 38 --replace-fail "from distutils.version import LooseVersion" "from packaging.version import parse" \ 39 --replace-fail "LooseVersion" "parse" 40 ''; 41 42 nativeBuildInputs = [ 43 setuptools-scm 44 ]; 45 46 buildInputs = [ pytest ]; 47 48 propagatedBuildInputs = [ 49 decopatch 50 makefun 51 six 52 ]; 53 54 nativeCheckInputs = [ 55 pytestCheckHook 56 numpy 57 pandas 58 tabulate 59 pytest-cases 60 ]; 61 62 pythonImportsCheck = [ "pytest_harvest" ]; 63 64 meta = with lib; { 65 description = "Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes"; 66 homepage = "https://github.com/smarie/python-pytest-harvest"; 67 changelog = "https://github.com/smarie/python-pytest-harvest/releases/tag/${version}"; 68 license = licenses.bsd3; 69 maintainers = with maintainers; [ mbalatsko ]; 70 }; 71}