1{
2 lib,
3 antlr4-python3-runtime,
4 asciimatics,
5 buildPythonPackage,
6 click,
7 dacite,
8 decorator,
9 fetchFromGitHub,
10 future,
11 first,
12 jsonpath-ng,
13 loguru,
14 overrides,
15 pillow,
16 ply,
17 pyfiglet,
18 pyperclip,
19 pytestCheckHook,
20 pythonOlder,
21 antlr4,
22 pyyaml,
23 setuptools,
24 six,
25 urwid,
26 parameterized,
27 wcwidth,
28 yamale,
29}:
30
31buildPythonPackage rec {
32 pname = "python-fx";
33 version = "0.3.1";
34 format = "setuptools";
35
36 disabled = pythonOlder "3.8";
37
38 src = fetchFromGitHub {
39 owner = "cielong";
40 repo = "pyfx";
41 rev = "refs/tags/v${version}";
42 hash = "sha256-BXKH3AlYMNbMREW5Qx72PrbuZdXlmVS+knWWu/y9PsA=";
43 };
44
45 postPatch = ''
46 rm src/pyfx/model/common/jsonpath/*.{g4,interp,tokens}
47 antlr -Dlanguage=Python3 -visitor -o src/pyfx/model/common/jsonpath/ *.g4
48 '';
49
50 pythonRelaxDeps = true;
51
52 nativeBuildInputs = [
53 antlr4
54 setuptools
55 ];
56
57 propagatedBuildInputs = [
58 antlr4-python3-runtime
59 asciimatics
60 click
61 dacite
62 decorator
63 first
64 future
65 jsonpath-ng
66 loguru
67 overrides
68 pillow
69 ply
70 pyfiglet
71 pyperclip
72 pyyaml
73 six
74 urwid
75 wcwidth
76 yamale
77 ];
78
79 nativeCheckInputs = [
80 pytestCheckHook
81 parameterized
82 ];
83
84 # antlr4 issue prevents us from running the tests
85 # https://github.com/antlr/antlr4/issues/4041
86 doCheck = false;
87
88 # pythonImportsCheck = [
89 # "pyfx"
90 # ];
91
92 meta = with lib; {
93 description = "Module to view JSON in a TUI";
94 mainProgram = "pyfx";
95 homepage = "https://github.com/cielong/pyfx";
96 changelog = "https://github.com/cielong/pyfx/releases/tag/v${version}";
97 license = with licenses; [ mit ];
98 maintainers = with maintainers; [ fab ];
99 };
100}