2019-03-11 17:30:13 -07:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, fetchpatch }:
|
2017-05-23 20:12:55 -07:00
|
|
|
|
2018-11-29 23:19:51 -08:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2018-11-06 19:37:44 -08:00
|
|
|
pname = "pgcli";
|
2019-01-07 02:42:13 -08:00
|
|
|
version = "2.0.2";
|
2017-05-23 20:12:55 -07:00
|
|
|
|
2018-11-29 23:19:51 -08:00
|
|
|
# Python 2 won't have prompt_toolkit 2.x.x
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/blob/f49e2ad3657dede09dc998a4a98fd5033fb52243/pkgs/top-level/python-packages.nix#L3408
|
|
|
|
disabled = python3Packages.isPy27;
|
|
|
|
|
|
|
|
src = python3Packages.fetchPypi {
|
2018-11-06 19:37:44 -08:00
|
|
|
inherit pname version;
|
2019-01-07 02:42:13 -08:00
|
|
|
sha256 = "1p4j2dbcfxd3kz86qi519jkqjx1mg5wdgn1gxdjx3lk1vpsd7x04";
|
2017-05-23 20:12:55 -07:00
|
|
|
};
|
|
|
|
|
2019-03-11 17:30:13 -07:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# TODO: Remove with next pgcli release. Fixes TypeError in tests
|
|
|
|
# https://github.com/dbcli/pgcli/pull/1006
|
|
|
|
url = https://github.com/dbcli/pgcli/commit/351135b61ef9ad3184c49a406544708daf589fe3.patch;
|
|
|
|
sha256 = "08131y0lv1v760i0ypcx2hljx066ks93kp96xkv3bycxnavvcl53";
|
|
|
|
excludes = [ "changelog.rst" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-11-29 23:19:51 -08:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2018-11-03 19:03:40 -07:00
|
|
|
cli-helpers click configobj humanize prompt_toolkit psycopg2
|
2018-09-18 04:01:44 -07:00
|
|
|
pygments sqlparse pgspecial setproctitle keyring
|
2017-05-23 20:12:55 -07:00
|
|
|
];
|
|
|
|
|
2018-11-29 23:19:51 -08:00
|
|
|
checkInputs = with python3Packages; [ pytest mock ];
|
2018-11-06 19:37:44 -08:00
|
|
|
|
|
|
|
checkPhase = ''
|
2018-11-29 23:19:51 -08:00
|
|
|
pytest
|
2018-11-06 19:37:44 -08:00
|
|
|
'';
|
|
|
|
|
2017-05-23 20:12:55 -07:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Command-line interface for PostgreSQL";
|
|
|
|
longDescription = ''
|
|
|
|
Rich command-line interface for PostgreSQL with auto-completion and
|
|
|
|
syntax highlighting.
|
|
|
|
'';
|
|
|
|
homepage = https://pgcli.com;
|
|
|
|
license = licenses.bsd3;
|
2018-09-18 04:01:44 -07:00
|
|
|
maintainers = with maintainers; [ dywedir ];
|
2017-05-23 20:12:55 -07:00
|
|
|
};
|
|
|
|
}
|