1{ buildPythonApplication, lib, fetchPypi, isPy3k
2, cli-helpers, click, configobj, humanize, prompt_toolkit, psycopg2
3, pygments, sqlparse, pgspecial, setproctitle, keyring, pytest, mock
4}:
5
6buildPythonApplication rec {
7 pname = "pgcli";
8 version = "3.0.0";
9
10 disabled = !isPy3k;
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "10j01bd031fys1vcihibsi5rrfd8w1kgahpcsbk4l07871c24829";
15 };
16
17 propagatedBuildInputs = [
18 cli-helpers click configobj humanize prompt_toolkit psycopg2
19 pygments sqlparse pgspecial setproctitle keyring
20 ];
21
22 postPatch = ''
23 substituteInPlace setup.py \
24 --replace "prompt_toolkit>=2.0.6,<3.0.0" "prompt_toolkit"
25 '';
26
27 checkInputs = [ pytest mock ];
28
29 # `test_application_name_db_uri` fails: https://github.com/dbcli/pgcli/issues/1104
30 checkPhase = ''
31 pytest --deselect=tests/test_main.py::test_application_name_db_uri
32 '';
33
34 meta = with lib; {
35 description = "Command-line interface for PostgreSQL";
36 longDescription = ''
37 Rich command-line interface for PostgreSQL with auto-completion and
38 syntax highlighting.
39 '';
40 homepage = "https://pgcli.com";
41 license = licenses.bsd3;
42 maintainers = with maintainers; [ dywedir ];
43 };
44}