[PATCH 0/4] gnu: Add pgcli.

DoneSubmitted by Foo Chuan Wei.
Details
2 participants
  • Foo Chuan Wei
  • Nicolas Goaziou
Owner
unassigned
Severity
normal
F
F
Foo Chuan Wei wrote on 19 Nov 2021 06:41
(address . guix-patches@gnu.org)
PU1PR01MB2155E250F97582738ED2FDD38D9C9@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
Foo Chuan Wei (4):
gnu: python-pendulum: Add setup.py to fix build.
gnu: Add python-pgspecial.
gnu: Add python-ipython-sql.
gnu: Add pgcli.

gnu/packages/databases.scm | 55 +++++++++++++++++++++++++++++++++++++
gnu/packages/python-xyz.scm | 34 +++++++++++++++++++++++
gnu/packages/time.scm | 26 ++++++++++++++++--
3 files changed, 112 insertions(+), 3 deletions(-)


base-commit: 188e3e2e6878346b0bdc8b46084f458abe86826c
--
2.25.1
F
F
Foo Chuan Wei wrote on 19 Nov 2021 06:58
[PATCH 1/4] gnu: python-pendulum: Add setup.py to fix build.
(address . 51963@debbugs.gnu.org)
PU1PR01MB2155F73AEE9B507D30E40C9E8D9C9@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
* gnu/packages/time.scm (python-pendulum)[arguments]: Add setup.py
to fix build.
---
gnu/packages/time.scm | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/time.scm b/gnu/packages/time.scm
index b60fab5db5..7585a665d3 100644
--- a/gnu/packages/time.scm
+++ b/gnu/packages/time.scm
@@ -155,9 +155,29 @@ saving time.  Almost all of the Olson timezones are supported.")
        (sha256
         (base32 "01zjc245w08j0xryrgrq9vng59q1cl5ry0hcpw5rj774pyhhqsmh"))))
     (build-system python-build-system)
-    ;; XXX: The PyPI distribution lacks tests, and the upstream repository
-    ;; lacks a setup.py!
-    (arguments '(#:tests? #f))
+    (arguments `(#:phases
+                 (modify-phases %standard-phases
+                   ;; Add setup.py to fix the build. Otherwise, the build will
+                   ;; fail with "no setup.py found".
+                   ;;
+                   ;; Upstream uses Poetry to build python-pendulum, including
+                   ;; parts written in C. Here, we simply add a setup.py file
+                   ;; and do not build the parts written in C. This is possible
+                   ;; because python-pendulum falls back on pure Python code
+                   ;; when the C parts are not available (reference: build.py).
+                   (add-after 'unpack 'add-setup.py
+                     (lambda _
+                       (call-with-output-file "setup.py"
+                         (lambda (port)
+                           (format port
+                                   "from setuptools import find_packages, setup
+setup(name='pendulum',
+      version='~a',
+      packages=find_packages())
+"
+                                   ,version))))))
+                 ;; XXX: The PyPI distribution lacks tests.
+                 #:tests? #f))
     (propagated-inputs
      `(("python-dateutil" ,python-dateutil)
        ("python-pytzdata" ,python-pytzdata)))
-- 
2.25.1
F
F
Foo Chuan Wei wrote on 19 Nov 2021 06:59
[PATCH 2/4] gnu: Add python-pgspecial.
(address . 51963@debbugs.gnu.org)
PU1PR01MB2155E9F45C26072BBA36F3DA8D9C9@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
* gnu/packages/databases.scm (python-pgspecial): New variable.
---
gnu/packages/databases.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index de161e1864..5636d717b6 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
 ;;; Copyright © 2021 Alexandre Hannud Abdo <abdo@member.fsf.org>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -615,6 +616,29 @@ replacement for the code@{python-memcached} library.")
 (define-public python2-pylibmc
   (package-with-python2 python-pylibmc))
 
+(define-public python-pgspecial
+  (package
+    (name "python-pgspecial")
+    (version "1.13.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pgspecial" version))
+       (sha256
+        (base32 "00ddkf565rjcxmfml1z4mmkns1aq8x5s5g85xmnz2scln42y4irq"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-click" ,python-click)
+       ("python-sqlparse" ,python-sqlparse)
+       ("python-psycopg2" ,python-psycopg2)))
+    (home-page "https://github.com/dbcli/pgspecial")
+    (synopsis
+     "Python implementation of PostgreSQL meta commands (backslash commands)")
+    (description
+     "This Python package provides an API to execute meta-commands (AKA
+\"special\", or \"backslash commands\") on PostgreSQL.")
+    (license license:bsd-3)))
+
 (define-public mycli
   (package
     (name "mycli")
-- 
2.25.1
F
F
Foo Chuan Wei wrote on 19 Nov 2021 07:00
[PATCH 3/4] gnu: Add python-ipython-sql.
(address . 51963@debbugs.gnu.org)
PU1PR01MB2155AEF341240DC3E01C1BC08D9C9@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
* gnu/packages/python-xyz.scm (python-ipython-sql): New variable.
---
gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a6f8b10bf7..f8313742c5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8303,6 +8303,40 @@ profile, launches a cluster and returns a view.  On program exit it shuts the
 cluster down and deletes the throwaway profile.")
     (license license:expat)))
 
+(define-public python-ipython-sql
+  (package
+    (name "python-ipython-sql")
+    (version "0.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ipython-sql" version))
+       (sha256
+        (base32 "0v74ayc6vw98f4jljmwy45qpqbcbhlrb4g1qdyypq9sppxcqx21y"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-build
+           (lambda _
+             ;; The "NEWS.rst" file is missing from the PyPI distribution.
+             ;; (see: https://github.com/catherinedevlin/ipython-sql/issues/164)
+             (substitute* "setup.py"
+               (("NEWS = [^\n]*") "")
+               (("long_description=README \\+ '\\\\n\\\\n' \\+ NEWS,")
+                "long_description=README,")))))))
+    (propagated-inputs
+     `(("python-ipython" ,python-ipython)
+       ("python-ipython-genutils" ,python-ipython-genutils)
+       ("python-prettytable" ,python-prettytable)
+       ("python-six" ,python-six)
+       ("python-sqlalchemy" ,python-sqlalchemy)
+       ("python-sqlparse" ,python-sqlparse)))
+    (home-page "https://github.com/catherinedevlin/ipython-sql")
+    (synopsis "RDBMS access via IPython")
+    (description "%sql and %%sql magic for IPython.")
+    (license license:expat)))
+
 (define-public python-traitlets
   (package
     (name "python-traitlets")
-- 
2.25.1
F
F
Foo Chuan Wei wrote on 19 Nov 2021 07:00
[PATCH 4/4] gnu: Add pgcli.
(address . 51963@debbugs.gnu.org)
PU1PR01MB2155A4BD24BA6D00F43ED2AD8D9C9@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
* gnu/packages/databases.scm (pgcli): New variable.
---
gnu/packages/databases.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5636d717b6..ee5ca569d9 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -639,6 +639,37 @@ replacement for the code@{python-memcached} library.")
 \"special\", or \"backslash commands\") on PostgreSQL.")
     (license license:bsd-3)))
 
+(define-public pgcli
+  (package
+    (name "pgcli")
+    (version "3.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pgcli" version))
+       (sha256
+        (base32 "1dy6yzak696107pqv83296h0xhc3ahlfaydm80593gwn37krgpkc"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-cli-helpers" ,python-cli-helpers)
+       ("python-click" ,python-click)
+       ("python-configobj" ,python-configobj)
+       ("python-pendulum" ,python-pendulum)
+       ("python-pgspecial" ,python-pgspecial)
+       ("python-prompt-toolkit" ,python-prompt-toolkit)
+       ("python-psycopg2" ,python-psycopg2)
+       ("python-pygments" ,python-pygments)
+       ("python-setproctitle" ,python-setproctitle)
+       ("python-sqlparse" ,python-sqlparse)))
+    (native-inputs
+     `(("python-ipython-sql" ,python-ipython-sql)))
+    (home-page "https://www.pgcli.com")
+    (synopsis "PostgreSQL CLI with autocompletion and syntax highlighting")
+    (description
+     "@code{pgcli} is a command line interface for PostgreSQL with
+autocompletion and syntax highlighting.")
+    (license license:bsd-3)))
+
 (define-public mycli
   (package
     (name "mycli")
-- 
2.25.1
N
N
Nicolas Goaziou wrote on 14 Jan 10:20 +0100
Re: [bug#51963] [PATCH 0/4] gnu: Add pgcli.
(address . 51963-done@debbugs.gnu.org)
87y23i4qsk.fsf@nicolasgoaziou.fr
Hello,

Foo Chuan Wei <chuanwei.foo@hotmail.com> writes:

Toggle quote (6 lines)
> Foo Chuan Wei (4):
> gnu: python-pendulum: Add setup.py to fix build.
> gnu: Add python-pgspecial.
> gnu: Add python-ipython-sql.
> gnu: Add pgcli.

I tried to expound python-ipython-sql description, I moved everything to
new package style, then I applied the patch set.

Thank you.

Regards,
--
Nicolas Goaziou
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 51963@debbugs.gnu.org