2020-12-01 02:03:58 +00:00
|
|
|
{ buildPythonApplication, lib, fetchPypi, isPy3k, fetchpatch
|
2019-10-05 19:48:36 +00:00
|
|
|
, cli-helpers, click, configobj, humanize, prompt_toolkit, psycopg2
|
|
|
|
, pygments, sqlparse, pgspecial, setproctitle, keyring, pytest, mock
|
|
|
|
}:
|
2017-05-24 03:12:55 +00:00
|
|
|
|
2019-10-05 19:48:36 +00:00
|
|
|
buildPythonApplication rec {
|
2018-11-07 03:37:44 +00:00
|
|
|
pname = "pgcli";
|
2020-04-13 03:56:25 +00:00
|
|
|
version = "3.0.0";
|
2017-05-24 03:12:55 +00:00
|
|
|
|
2019-10-05 19:48:36 +00:00
|
|
|
disabled = !isPy3k;
|
2018-11-30 07:19:51 +00:00
|
|
|
|
2019-10-05 19:48:36 +00:00
|
|
|
src = fetchPypi {
|
2018-11-07 03:37:44 +00:00
|
|
|
inherit pname version;
|
2020-04-13 03:56:25 +00:00
|
|
|
sha256 = "10j01bd031fys1vcihibsi5rrfd8w1kgahpcsbk4l07871c24829";
|
2017-05-24 03:12:55 +00:00
|
|
|
};
|
|
|
|
|
2019-10-05 19:48:36 +00:00
|
|
|
propagatedBuildInputs = [
|
2018-11-04 02:03:40 +00:00
|
|
|
cli-helpers click configobj humanize prompt_toolkit psycopg2
|
2018-09-18 11:01:44 +00:00
|
|
|
pygments sqlparse pgspecial setproctitle keyring
|
2017-05-24 03:12:55 +00:00
|
|
|
];
|
|
|
|
|
2020-12-01 02:03:58 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "enable-sqlparse-4.patch";
|
|
|
|
url = "https://github.com/dbcli/pgcli/pull/1224/commits/55d534d41051887c637b6300e08a9f70e6656020.patch";
|
|
|
|
sha256 = "01r8qc7qzb6mz0xq2xnrgyackbapf43ng6l88qpzd9lw2pwksc8w";
|
|
|
|
includes = [ "pgcli/packages/parseutils/ctes.py" "tests/test_sqlcompletion.py" "setup.py" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-12-21 06:19:54 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "prompt_toolkit>=2.0.6,<3.0.0" "prompt_toolkit"
|
|
|
|
'';
|
|
|
|
|
2019-10-05 19:48:36 +00:00
|
|
|
checkInputs = [ pytest mock ];
|
2018-11-07 03:37:44 +00:00
|
|
|
|
2019-12-05 05:01:00 +00:00
|
|
|
# `test_application_name_db_uri` fails: https://github.com/dbcli/pgcli/issues/1104
|
|
|
|
checkPhase = ''
|
|
|
|
pytest --deselect=tests/test_main.py::test_application_name_db_uri
|
|
|
|
'';
|
2018-11-07 03:37:44 +00:00
|
|
|
|
2017-05-24 03:12:55 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Command-line interface for PostgreSQL";
|
|
|
|
longDescription = ''
|
|
|
|
Rich command-line interface for PostgreSQL with auto-completion and
|
|
|
|
syntax highlighting.
|
|
|
|
'';
|
2020-04-13 03:56:25 +00:00
|
|
|
homepage = "https://pgcli.com";
|
2017-05-24 03:12:55 +00:00
|
|
|
license = licenses.bsd3;
|
2018-09-18 11:01:44 +00:00
|
|
|
maintainers = with maintainers; [ dywedir ];
|
2017-05-24 03:12:55 +00:00
|
|
|
};
|
|
|
|
}
|