nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchFromGitHub,
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.9.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "ESSS";
24 repo = "pytest-regressions";
25 tag = "v${version}";
26 hash = "sha256-pqlRfpi5Z9b6zrvU6M1sNRz5ltZLAFiJITFvex7YqcE=";
27 };
28
29 build-system = [ setuptools-scm ];
30
31 buildInputs = [ pytest ];
32
33 dependencies = [
34 pytest-datadir
35 pyyaml
36 ];
37
38 optional-dependencies = {
39 dataframe = [
40 pandas
41 numpy
42 ];
43 image = [
44 numpy
45 pillow
46 ];
47 num = [
48 numpy
49 pandas
50 ];
51 };
52
53 nativeCheckInputs = [
54 matplotlib
55 pandas
56 pytestCheckHook
57 ]
58 ++ lib.concatAttrValues optional-dependencies;
59
60 pytestFlags = [
61 "-Wignore::DeprecationWarning"
62 ];
63
64 disabledTests = [
65 # https://github.com/ESSS/pytest-regressions/issues/225
66 "test_categorical"
67 "test_dataframe_with"
68 "test_different_data_types"
69 "test_nonrange_index"
70 "test_string_array"
71 ]
72 ++ lib.optionals (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isBigEndian) [
73 # https://github.com/ESSS/pytest-regressions/issues/156
74 # i686-linux not listed in the report, but seems to have this issue as well
75 "test_different_data_types"
76 "test_common_case" # not listed in the issue, but fails after the above is skipped
77 ];
78
79 pythonImportsCheck = [
80 "pytest_regressions"
81 "pytest_regressions.plugin"
82 ];
83
84 meta = {
85 changelog = "https://github.com/ESSS/pytest-regressions/blob/${src.tag}/CHANGELOG.rst";
86 description = "Pytest fixtures to write regression tests";
87 longDescription = ''
88 pytest-regressions makes it simple to test general data, images,
89 files, and numeric tables by saving expected data in a data
90 directory (courtesy of pytest-datadir) that can be used to verify
91 that future runs produce the same data.
92 '';
93 homepage = "https://github.com/ESSS/pytest-regressions";
94 license = lib.licenses.mit;
95 maintainers = [ ];
96 };
97}