1{ lib
2, buildPythonPackage
3, fetchPypi
4, curtsies
5, cwcwidth
6, dataclasses
7, greenlet
8, jedi
9, pygments
10, pytestCheckHook
11, pythonOlder
12, pyperclip
13, pyxdg
14, requests
15, substituteAll
16, typing-extensions
17, urwid
18, watchdog
19}:
20
21buildPythonPackage rec {
22 pname = "bpython";
23 version = "0.23";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.6";
27
28 src = fetchPypi {
29 inherit pname version;
30 hash = "sha256-nwB4q8iHxIrwiGkeL2R5fWyplKwPS8A8ONBvZX18BSo=";
31 };
32
33 propagatedBuildInputs = [
34 curtsies
35 cwcwidth
36 greenlet
37 jedi
38 pygments
39 pyperclip
40 pyxdg
41 requests
42 typing-extensions
43 urwid
44 watchdog
45 ] ++ lib.optionals (pythonOlder "3.7") [
46 dataclasses
47 ];
48
49 postInstall = ''
50 substituteInPlace "$out/share/applications/org.bpython-interpreter.bpython.desktop" \
51 --replace "Exec=/usr/bin/bpython" "Exec=$out/bin/bpython"
52 '';
53
54 checkInputs = [
55 pytestCheckHook
56 ];
57
58 pythonImportsCheck = [
59 "bpython"
60 ];
61
62 disabledTests = [
63 # Check for syntax error ends with an AssertionError
64 "test_syntaxerror"
65 ];
66
67 meta = with lib; {
68 description = "A fancy curses interface to the Python interactive interpreter";
69 homepage = "https://bpython-interpreter.org/";
70 license = licenses.mit;
71 maintainers = with maintainers; [ flokli dotlambda ];
72 };
73}