1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 python,
6 poetry-core,
7 pytest,
8 pytest-xdist,
9 invoke,
10}:
11
12buildPythonPackage rec {
13 pname = "syrupy";
14 version = "4.8.0";
15 pyproject = true;
16
17 disabled = lib.versionOlder python.version "3.8.1";
18
19 src = fetchFromGitHub {
20 owner = "syrupy-project";
21 repo = "syrupy";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-IifGufCUhjbl8Tqvcjm8XF4QPvOsRacPWxI1yT79eNs=";
24 };
25
26 build-system = [ poetry-core ];
27
28 buildInputs = [ pytest ];
29
30 nativeCheckInputs = [
31 invoke
32 pytest
33 pytest-xdist
34 ];
35
36 checkPhase = ''
37 runHook preCheck
38 # https://github.com/tophat/syrupy/blob/main/CONTRIBUTING.md#local-development
39 invoke test
40 runHook postCheck
41 '';
42
43 pythonImportsCheck = [ "syrupy" ];
44
45 meta = {
46 changelog = "https://github.com/syrupy-project/syrupy/blob/${src.rev}/CHANGELOG.md";
47 description = "Pytest Snapshot Test Utility";
48 homepage = "https://github.com/syrupy-project/syrupy";
49 license = lib.licenses.asl20;
50 maintainers = with lib.maintainers; [ dotlambda ];
51 };
52}