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