1{ lib, pythonPackages, fetchFromGitHub }:
2
3pythonPackages.buildPythonApplication rec {
4 name = "pgcli-${version}";
5 version = "1.6.0";
6
7 src = fetchFromGitHub {
8 sha256 = "0f1zv4kwi2991pclf8chrhgjwf8jkqxdh5ndc9qx6igh56iyyncz";
9 rev = "v${version}";
10 repo = "pgcli";
11 owner = "dbcli";
12 };
13
14 buildInputs = with pythonPackages; [ pytest mock ];
15 checkPhase = ''
16 mkdir /tmp/homeless-shelter
17 HOME=/tmp/homeless-shelter py.test tests -k 'not test_missing_rc_dir and not test_quoted_db_uri and not test_port_db_uri'
18 '';
19
20 propagatedBuildInputs = with pythonPackages; [
21 click configobj humanize prompt_toolkit psycopg2
22 pygments sqlparse pgspecial setproctitle
23 ];
24
25 postPatch = ''
26 substituteInPlace setup.py --replace "==" ">="
27 rm tests/test_rowlimit.py
28 '';
29
30 meta = with lib; {
31 description = "Command-line interface for PostgreSQL";
32 longDescription = ''
33 Rich command-line interface for PostgreSQL with auto-completion and
34 syntax highlighting.
35 '';
36 homepage = https://pgcli.com;
37 license = licenses.bsd3;
38 maintainers = with maintainers; [ nckx ];
39 };
40}