1{
2 lib,
3 stdenv,
4 antlr4-python3-runtime,
5 asciimatics,
6 buildPythonPackage,
7 click,
8 dacite,
9 decorator,
10 fetchFromGitHub,
11 future,
12 first,
13 jsonpath-ng,
14 loguru,
15 overrides,
16 pillow,
17 ply,
18 pyfiglet,
19 pyperclip,
20 pytestCheckHook,
21 pythonOlder,
22 antlr4,
23 pyyaml,
24 setuptools,
25 urwid,
26 parameterized,
27 wcwidth,
28 yamale,
29}:
30
31buildPythonPackage rec {
32 pname = "python-fx";
33 version = "0.3.2";
34 pyproject = true;
35
36 disabled = pythonOlder "3.8";
37
38 src = fetchFromGitHub {
39 owner = "cielong";
40 repo = "pyfx";
41 tag = "v${version}";
42 hash = "sha256-Q5ihWnoa7nf4EkrY4SgrwjaNvTva4RdW9GRbnbsPXPc=";
43 };
44
45 postPatch = ''
46 rm src/pyfx/model/common/jsonpath/*.py # upstream checks in generated files, remove to ensure they were regenerated
47 antlr -Dlanguage=Python3 -visitor src/pyfx/model/common/jsonpath/*.g4
48 rm src/pyfx/model/common/jsonpath/*.{g4,interp,tokens} # no need to install
49 '';
50
51 pythonRelaxDeps = true;
52
53 build-system = [ setuptools ];
54
55 nativeBuildInputs = [ antlr4 ];
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 urwid
74 wcwidth
75 yamale
76 ];
77
78 nativeCheckInputs = [
79 pytestCheckHook
80 parameterized
81 ];
82
83 # FAILED tests/test_event_loops.py::TwistedEventLoopTest::test_run - AssertionError: 'callback called with future outcome: True' not found in ['...
84 doCheck = !stdenv.hostPlatform.isDarwin;
85
86 pythonImportsCheck = [ "pyfx" ];
87
88 meta = with lib; {
89 description = "Module to view JSON in a TUI";
90 homepage = "https://github.com/cielong/pyfx";
91 changelog = "https://github.com/cielong/pyfx/releases/tag/v${version}";
92 license = with licenses; [ mit ];
93 maintainers = with maintainers; [ fab ];
94 mainProgram = "pyfx";
95 };
96}