From 03ce061cec6f19e46da3416bac2c2e595ba6fb4d Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Wed, 15 Jun 2022 10:38:41 -0700 Subject: [PATCH 1/2] pgcli: make it a package rather than an application pgcli has line magics integrating with ipython-sql, which require importing pgcli.magic. The current NixOS packaging doesn't allow this import to work. --- pkgs/development/tools/database/pgcli/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/database/pgcli/default.nix b/pkgs/development/tools/database/pgcli/default.nix index 40c204812887..6b9aeb9d41ed 100644 --- a/pkgs/development/tools/database/pgcli/default.nix +++ b/pkgs/development/tools/database/pgcli/default.nix @@ -1,5 +1,5 @@ { lib, stdenv -, buildPythonApplication +, buildPythonPackage , fetchPypi , isPy3k , cli-helpers @@ -18,7 +18,7 @@ , mock }: -buildPythonApplication rec { +buildPythonPackage rec { pname = "pgcli"; version = "3.4.1"; From 89fdc63965178d266653d087b02b795c9e892246 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Thu, 16 Jun 2022 14:13:14 -0700 Subject: [PATCH 2/2] Apply suggested changes --- .../{tools/database => python-modules}/pgcli/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) rename pkgs/development/{tools/database => python-modules}/pgcli/default.nix (91%) diff --git a/pkgs/development/tools/database/pgcli/default.nix b/pkgs/development/python-modules/pgcli/default.nix similarity index 91% rename from pkgs/development/tools/database/pgcli/default.nix rename to pkgs/development/python-modules/pgcli/default.nix index 6b9aeb9d41ed..70e52493315e 100644 --- a/pkgs/development/tools/database/pgcli/default.nix +++ b/pkgs/development/python-modules/pgcli/default.nix @@ -18,6 +18,8 @@ , mock }: +# this is a pythonPackage because of the ipython line magics in pgcli.magic +# integrating with ipython-sql buildPythonPackage rec { pname = "pgcli"; version = "3.4.1"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3f7b1251e0a5..677fa5040636 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16049,7 +16049,7 @@ with pkgs; peg = callPackage ../development/tools/parsing/peg { }; - pgcli = pkgs.python3Packages.pgcli; + pgcli = with pkgs.python3Packages; toPythonApplication pgcli; picotool = callPackage ../development/tools/picotool { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 872a35c0d357..135ba62b8e04 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6421,7 +6421,7 @@ in { pg8000 = callPackage ../development/python-modules/pg8000 { }; - pgcli = callPackage ../development/tools/database/pgcli { }; + pgcli = callPackage ../development/python-modules/pgcli { }; pglast = callPackage ../development/python-modules/pglast { };