1{
2 lib,
3 atomicwrites,
4 buildPythonPackage,
5 fetchFromGitHub,
6 ruamel-yaml,
7 poetry-core,
8 pytest,
9 pytestCheckHook,
10 pythonOlder,
11 testfixtures,
12}:
13
14buildPythonPackage rec {
15 pname = "pytest-golden";
16 version = "0.2.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "oprypin";
23 repo = "pytest-golden";
24 tag = "v${version}";
25 hash = "sha256-l5fXWDK6gWJc3dkYFTokI9tWvawMRnF0td/lSwqkYXE=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail "poetry>=0.12" poetry-core \
31 --replace-fail poetry.masonry.api poetry.core.masonry.api
32 '';
33
34 pythonRelaxDeps = [ "testfixtures" ];
35
36 build-system = [
37 # hatchling used for > 0.2.2
38 poetry-core
39 ];
40
41 buildInputs = [ pytest ];
42
43 dependencies = [
44 atomicwrites
45 ruamel-yaml
46 testfixtures
47 ];
48
49 nativeCheckInputs = [ pytestCheckHook ];
50
51 pythonImportsCheck = [ "pytest_golden" ];
52
53 meta = with lib; {
54 description = "Plugin for pytest that offloads expected outputs to data files";
55 homepage = "https://github.com/oprypin/pytest-golden";
56 license = licenses.mit;
57 maintainers = with maintainers; [ fab ];
58 };
59}