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