1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, pythonOlder
6, matplotlib
7, numpy
8, pandas
9, pillow
10, pytest
11, pytest-datadir
12, pytestCheckHook
13, pyyaml
14, setuptools-scm
15}:
16
17buildPythonPackage rec {
18 pname = "pytest-regressions";
19 version = "2.2.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.6";
23
24 src = fetchPypi {
25 inherit pname version;
26 sha256 = "15a71f77cb266dd4ca94331abe4c339ad056b2b2175e47442711c98cf6d65716";
27 };
28
29 patches = [
30 # Make pytest-regressions compatible with NumPy 1.20.
31 # Should be part of the next release.
32 (fetchpatch {
33 url = "https://github.com/ESSS/pytest-regressions/commit/ffad2c7fd1d110f420f4e3ca3d39d90cae18a972.patch";
34 sha256 = "sha256-bUna7MnMV6u9oEaZMsFnr4gE28rz/c0O2+Hyk291+l0=";
35 })
36 ];
37
38 nativeBuildInputs = [ setuptools-scm ];
39 buildInputs = [ pytest ];
40 propagatedBuildInputs = [ numpy pandas pillow pytest-datadir pyyaml ];
41
42 SETUPTOOLS_SCM_PRETEND_VERSION = version;
43
44 checkInputs = [ pytestCheckHook matplotlib ];
45 pythonImportsCheck = [ "pytest_regressions" "pytest_regressions.plugin" ];
46
47 meta = with lib; {
48 description = "Pytest fixtures to write regression tests";
49 longDescription = ''
50 pytest-regressions makes it simple to test general data, images,
51 files, and numeric tables by saving expected data in a data
52 directory (courtesy of pytest-datadir) that can be used to verify
53 that future runs produce the same data.
54 '';
55 homepage = "https://github.com/ESSS/pytest-regressions";
56 license = licenses.mit;
57 maintainers = with maintainers; [ AluisioASG ];
58 };
59}