1{
2 lib,
3 asttokens,
4 black,
5 buildPythonPackage,
6 click,
7 dirty-equals,
8 executing,
9 fetchFromGitHub,
10 freezegun,
11 hatchling,
12 hypothesis,
13 pydantic,
14 pyright,
15 pytest-freezer,
16 pytest-mock,
17 pytest-subtests,
18 pytest-xdist,
19 pytestCheckHook,
20 pythonOlder,
21 rich,
22 time-machine,
23 toml,
24 types-toml,
25 typing-extensions,
26}:
27
28buildPythonPackage rec {
29 pname = "inline-snapshot";
30 version = "0.21.3";
31 pyproject = true;
32
33 disabled = pythonOlder "3.10";
34
35 src = fetchFromGitHub {
36 owner = "15r10nk";
37 repo = "inline-snapshot";
38 tag = version;
39 hash = "sha256-ll2wSSTr2QEUXE5liYw+JhcYsTEcJCWWTFXRagd6fCw=";
40 };
41
42 build-system = [ hatchling ];
43
44 dependencies =
45 [
46 asttokens
47 black
48 click
49 executing
50 rich
51 typing-extensions
52 ]
53 ++ lib.optionals (pythonOlder "3.11") [
54 types-toml
55 toml
56 ];
57
58 nativeCheckInputs = [
59 dirty-equals
60 freezegun
61 hypothesis
62 pydantic
63 pyright
64 pytest-freezer
65 pytest-mock
66 pytest-subtests
67 pytest-xdist
68 pytestCheckHook
69 time-machine
70 ];
71
72 pythonImportsCheck = [ "inline_snapshot" ];
73
74 disabledTestPaths = [
75 # Tests don't play nice with pytest-xdist
76 "tests/test_typing.py"
77 ];
78
79 disabledTests = [
80 # Tests for precise formatting
81 "test_empty_sub_snapshot"
82 ];
83
84 meta = with lib; {
85 description = "Create and update inline snapshots in Python tests";
86 homepage = "https://github.com/15r10nk/inline-snapshot/";
87 changelog = "https://github.com/15r10nk/inline-snapshot/blob/${src.tag}/CHANGELOG.md";
88 license = licenses.mit;
89 maintainers = with maintainers; [ fab ];
90 };
91}