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
* 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(-) 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
* gnu/packages/databases.scm (python-pgspecial): New variable. --- gnu/packages/databases.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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
* gnu/packages/python-xyz.scm (python-ipython-sql): New variable. --- gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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
* gnu/packages/databases.scm (pgcli): New variable. --- gnu/packages/databases.scm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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
Hello,
Foo Chuan Wei <chuanwei.foo@hotmail.com> writes:
> 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