1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonAtLeast,
6 pythonOlder,
7 matplotlib,
8 numpy,
9 pandas,
10 pillow,
11 pytest,
12 pytest-datadir,
13 pytestCheckHook,
14 pyyaml,
15 setuptools-scm,
16}:
17
18buildPythonPackage rec {
19 pname = "pytest-regressions";
20 version = "2.5.0";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.6";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-gYx4hMHP87q/ie67AsvCezB4VrGYVCfCTVLLgSoQb9k=";
28 };
29
30 nativeBuildInputs = [ setuptools-scm ];
31
32 buildInputs = [ pytest ];
33
34 propagatedBuildInputs = [
35 pytest-datadir
36 pyyaml
37 ];
38
39 nativeCheckInputs = [
40 matplotlib
41 pandas
42 pytestCheckHook
43 ];
44
45 pytestFlagsArray = [
46 "-W"
47 "ignore::DeprecationWarning"
48 ];
49
50 disabledTestPathss = lib.optionals (pythonAtLeast "3.12") [
51 # AttributeError: partially initialized module 'pandas' has no attribute '_pandas_datetime_CAPI' (most likely due to a circular import)
52 "tests/test_num_regression.py"
53 ];
54
55 pythonImportsCheck = [
56 "pytest_regressions"
57 "pytest_regressions.plugin"
58 ];
59
60 passthru.optional-dependencies = {
61 dataframe = [
62 pandas
63 numpy
64 ];
65 image = [
66 numpy
67 pillow
68 ];
69 num = [
70 numpy
71 pandas
72 ];
73 };
74
75 meta = with lib; {
76 description = "Pytest fixtures to write regression tests";
77 longDescription = ''
78 pytest-regressions makes it simple to test general data, images,
79 files, and numeric tables by saving expected data in a data
80 directory (courtesy of pytest-datadir) that can be used to verify
81 that future runs produce the same data.
82 '';
83 homepage = "https://github.com/ESSS/pytest-regressions";
84 license = licenses.mit;
85 maintainers = with maintainers; [ AluisioASG ];
86 };
87}