summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/bpython/default.nix
blob: 64fe3c455ee59b15e3ac6ae2361c3e26548780c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, buildPythonPackage
, fetchPypi
, curtsies
, greenlet
, jedi
, pygments
, pyxdg
, requests
, substituteAll
, urwid
, watchdog
, which
}:

buildPythonPackage rec {
  pname = "bpython";
  version = "0.21";

  src = fetchPypi {
    inherit pname version;
    sha256 = "88aa9b89974f6a7726499a2608fa7ded216d84c69e78114ab2ef996a45709487";
  };

  patches = [ (substituteAll {
    src = ./clipboard-make-which-substitutable.patch;
    which = "${which}/bin/which";
  })];

  propagatedBuildInputs = [
    curtsies
    greenlet
    pygments
    pyxdg
    requests
    urwid
  ];

  postInstall = ''
    substituteInPlace "$out/share/applications/org.bpython-interpreter.bpython.desktop" \
      --replace "Exec=/usr/bin/bpython" "Exec=$out/bin/bpython"
  '';

  checkInputs = [ jedi watchdog ];
  pythonImportsCheck = [ "bpython" ];

  meta = with lib; {
    description = "A fancy curses interface to the Python interactive interpreter";
    homepage = "https://bpython-interpreter.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ flokli ];
  };
}