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