1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 cli-helpers,
7 click,
8 configobj,
9 prompt-toolkit,
10 psycopg,
11 pygments,
12 sqlparse,
13 pgspecial,
14 setproctitle,
15 keyring,
16 pendulum,
17 pytestCheckHook,
18 setuptools,
19 sshtunnel,
20 mock,
21 tzlocal,
22}:
23
24# this is a pythonPackage because of the ipython line magics in pgcli.magic
25# integrating with ipython-sql
26buildPythonPackage rec {
27 pname = "pgcli";
28 version = "4.3.0";
29 pyproject = true;
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-dlrhVQxVCKSB8Z8WqZcWwlP+ka+yVXl63S1jXaILau8=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 cli-helpers
40 click
41 configobj
42 prompt-toolkit
43 psycopg
44 pygments
45 sqlparse
46 pgspecial
47 setproctitle
48 keyring
49 pendulum
50 sshtunnel
51 tzlocal
52 ];
53
54 nativeCheckInputs = [
55 pytestCheckHook
56 mock
57 ];
58
59 disabledTests = [
60 # requires running postgres
61 "test_application_name_in_env"
62 ]
63 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_application_name_db_uri" ];
64
65 meta = with lib; {
66 description = "Command-line interface for PostgreSQL";
67 mainProgram = "pgcli";
68 longDescription = ''
69 Rich command-line interface for PostgreSQL with auto-completion and
70 syntax highlighting.
71 '';
72 homepage = "https://pgcli.com";
73 changelog = "https://github.com/dbcli/pgcli/raw/v${version}/changelog.rst";
74 license = licenses.bsd3;
75 maintainers = with maintainers; [
76 SuperSandro2000
77 ];
78 };
79}