1{ lib
2, buildPythonPackage
3, fetchPypi
4, curtsies
5, greenlet
6, jedi
7, pygments
8, pyxdg
9, requests
10, substituteAll
11, urwid
12, watchdog
13, which
14}:
15
16buildPythonPackage rec {
17 pname = "bpython";
18 version = "0.21";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "88aa9b89974f6a7726499a2608fa7ded216d84c69e78114ab2ef996a45709487";
23 };
24
25 patches = [ (substituteAll {
26 src = ./clipboard-make-which-substitutable.patch;
27 which = "${which}/bin/which";
28 })];
29
30 propagatedBuildInputs = [
31 curtsies
32 greenlet
33 pygments
34 pyxdg
35 requests
36 urwid
37 ];
38
39 postInstall = ''
40 substituteInPlace "$out/share/applications/org.bpython-interpreter.bpython.desktop" \
41 --replace "Exec=/usr/bin/bpython" "Exec=$out/bin/bpython"
42 '';
43
44 checkInputs = [ jedi watchdog ];
45 pythonImportsCheck = [ "bpython" ];
46
47 meta = with lib; {
48 description = "A fancy curses interface to the Python interactive interpreter";
49 homepage = "https://bpython-interpreter.org/";
50 license = licenses.mit;
51 maintainers = with maintainers; [ flokli ];
52 };
53}