1{
2 lib,
3 fetchFromGitHub,
4 fetchpatch,
5 # Python bits:
6 buildPythonPackage,
7 pytest,
8 responses,
9 docopt,
10 flask,
11 markdown,
12 path-and-address,
13 pygments,
14 requests,
15 tabulate,
16}:
17
18buildPythonPackage rec {
19 pname = "grip";
20 version = "4.6.1";
21 format = "setuptools";
22
23 src = fetchFromGitHub {
24 owner = "joeyespo";
25 repo = "grip";
26 rev = "v${version}";
27 hash = "sha256-CHL2dy0H/i0pLo653F7aUHFvZHTeZA6jC/rwn1KrEW4=";
28 };
29
30 patches = [
31 # https://github.com/NixOS/nixpkgs/issues/288478
32 (fetchpatch {
33 name = "set-default-encoding.patch";
34 url = "https://github.com/joeyespo/grip/commit/2784eb2c1515f1cdb1554d049d48b3bff0f42085.patch";
35 hash = "sha256-veVJKJtt8mP1jmseRD7pNR3JgIxX1alYHyQok/rBpiQ=";
36 })
37 ];
38
39 nativeCheckInputs = [
40 pytest
41 responses
42 ];
43
44 propagatedBuildInputs = [
45 docopt
46 flask
47 markdown
48 path-and-address
49 pygments
50 requests
51 tabulate
52 ];
53
54 checkPhase = ''
55 export PATH="$PATH:$out/bin"
56 py.test -xm "not assumption"
57 '';
58
59 meta = with lib; {
60 description = "Preview GitHub Markdown files like Readme locally before committing them";
61 mainProgram = "grip";
62 homepage = "https://github.com/joeyespo/grip";
63 license = licenses.mit;
64 maintainers = with maintainers; [ koral ];
65 };
66}