all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / Atom feed
* [bug#52064] [PATCH] gnu: Add python-sodapy.
@ 2021-11-23 19:22 Luis Felipe via Guix-patches via
  2021-11-24 16:20 ` Luis Felipe via Guix-patches via
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luis Felipe via Guix-patches via @ 2021-11-23 19:22 UTC (permalink / raw)
  To: 52064


[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]

Hi, this is a new package pretty much imported by Guix from Pypi. I installed it, tried it out with the following code in a Python interpreter, and it worked.

~~~
from sodapy import Socrata

client = Socrata("www.datos.gov.co", None)

# First 100 results, returned as JSON from API / converted to Python list of
# dictionaries by sodapy.
results = client.get("gt2j-8ykr", limit=100)

results
~~~

I then generated the attached patch by following the packaging videos (https://guix.gnu.org/en/videos/2020/packaging-part-one/).

I hope it works (but I can make changes if it doesn't),

---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-python-sodapy.patch --]
[-- Type: text/x-patch; filename="0001-gnu-Add-python-sodapy.patch"; name="0001-gnu-Add-python-sodapy.patch", Size: 1696 bytes --]

From 8f605da8ac3157b467cc2fcc6b5ec83cfa436daf Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
Date: Tue, 23 Nov 2021 13:30:04 -0500
Subject: [PATCH] gnu: Add python-sodapy.

* gnu/packages/python-web.scm (python-sodapy): New variable.
---
 gnu/packages/python-web.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4ddf89c207..71fc0549aa 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -46,6 +46,7 @@
 ;;; Copyright © 2021 Pradana Aumars <paumars@courrier.dev>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Luis Felipe López Acevedo <luis-felipe@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -6348,3 +6349,20 @@ (define-public python-flask-combo-jsonapi
 Flask-RESTful to quickly build APIs that fit the complexity of existing
 real-life projects with legacy data and diverse storage providers.")
     (license license:expat)))
+
+(define-public python-sodapy
+  (package
+    (name "python-sodapy")
+    (version "2.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "sodapy" version))
+       (sha256
+        (base32 "03ywf14fplgrz15ci6lvj1kmbrd0sghvcmjbnarx4036q7ph3rs4"))))
+    (build-system python-build-system)
+    (propagated-inputs `(("python-requests" ,python-requests)))
+    (home-page "https://github.com/xmunoz/sodapy")
+    (synopsis "Python library for the Socrata Open Data API")
+    (description "Python library for the Socrata Open Data API.")
+    (license license:expat)))
-- 
2.33.0


[-- Attachment #1.3: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#52064] [PATCH] gnu: Add python-sodapy.
  2021-11-23 19:22 [bug#52064] [PATCH] gnu: Add python-sodapy Luis Felipe via Guix-patches via
@ 2021-11-24 16:20 ` Luis Felipe via Guix-patches via
  2021-11-24 23:31 ` Luis Felipe via Guix-patches via
  2021-11-25 18:14 ` Luis Felipe via Guix-patches via
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Felipe via Guix-patches via @ 2021-11-24 16:20 UTC (permalink / raw)
  To: 52064


[-- Attachment #1.1: Type: text/plain, Size: 112 bytes --]

I wrote my email incorrectly in the initial patch. This new patch fixes that.

---
Luis Felipe López Acevedo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-python-sodapy.patch --]
[-- Type: text/x-patch; filename="0001-gnu-Add-python-sodapy.patch"; name="0001-gnu-Add-python-sodapy.patch", Size: 1699 bytes --]

From b2fbb0f91fe4bcddb50ebd7accdd9c239b03a3b1 Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
Date: Tue, 23 Nov 2021 13:30:04 -0500
Subject: [PATCH] gnu: Add python-sodapy.

* gnu/packages/python-web.scm (python-sodapy): New variable.
---
 gnu/packages/python-web.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4ddf89c207..867a00a1bb 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -46,6 +46,7 @@
 ;;; Copyright © 2021 Pradana Aumars <paumars@courrier.dev>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -6348,3 +6349,20 @@ (define-public python-flask-combo-jsonapi
 Flask-RESTful to quickly build APIs that fit the complexity of existing
 real-life projects with legacy data and diverse storage providers.")
     (license license:expat)))
+
+(define-public python-sodapy
+  (package
+    (name "python-sodapy")
+    (version "2.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "sodapy" version))
+       (sha256
+        (base32 "03ywf14fplgrz15ci6lvj1kmbrd0sghvcmjbnarx4036q7ph3rs4"))))
+    (build-system python-build-system)
+    (propagated-inputs `(("python-requests" ,python-requests)))
+    (home-page "https://github.com/xmunoz/sodapy")
+    (synopsis "Python library for the Socrata Open Data API")
+    (description "Python library for the Socrata Open Data API.")
+    (license license:expat)))
-- 
2.33.0


[-- Attachment #1.3: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#52064] [PATCH] gnu: Add python-sodapy.
  2021-11-23 19:22 [bug#52064] [PATCH] gnu: Add python-sodapy Luis Felipe via Guix-patches via
  2021-11-24 16:20 ` Luis Felipe via Guix-patches via
@ 2021-11-24 23:31 ` Luis Felipe via Guix-patches via
  2021-11-25 18:14 ` Luis Felipe via Guix-patches via
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Felipe via Guix-patches via @ 2021-11-24 23:31 UTC (permalink / raw)
  To: 52064


[-- Attachment #1.1: Type: text/plain, Size: 213 bytes --]

Actually, with the initial definition of this package the test suite is not run, so I'm going to change the method to get the source and replace the check phase to run the tests.

---
Luis Felipe López Acevedo

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#52064] [PATCH] gnu: Add python-sodapy.
  2021-11-23 19:22 [bug#52064] [PATCH] gnu: Add python-sodapy Luis Felipe via Guix-patches via
  2021-11-24 16:20 ` Luis Felipe via Guix-patches via
  2021-11-24 23:31 ` Luis Felipe via Guix-patches via
@ 2021-11-25 18:14 ` Luis Felipe via Guix-patches via
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Felipe via Guix-patches via @ 2021-11-25 18:14 UTC (permalink / raw)
  To: 52064


[-- Attachment #1.1: Type: text/plain, Size: 98 bytes --]

Hi. Here's the new package definition with check phase enabled.

---
Luis Felipe López Acevedo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-python-sodapy.patch --]
[-- Type: text/x-patch; filename="0001-gnu-Add-python-sodapy.patch"; name="0001-gnu-Add-python-sodapy.patch", Size: 2472 bytes --]

From d7daf5771d02378606437c3b725e1229d405eeaa Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
Date: Tue, 23 Nov 2021 13:30:04 -0500
Subject: [PATCH] gnu: Add python-sodapy.

* gnu/packages/python-web.scm (python-sodapy): New variable.
---
 gnu/packages/python-web.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4ddf89c207..d82edfa525 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -46,6 +46,7 @@
 ;;; Copyright © 2021 Pradana Aumars <paumars@courrier.dev>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -6348,3 +6349,38 @@ (define-public python-flask-combo-jsonapi
 Flask-RESTful to quickly build APIs that fit the complexity of existing
 real-life projects with legacy data and diverse storage providers.")
     (license license:expat)))
+
+(define-public python-sodapy
+  (package
+    (name "python-sodapy")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/xmunoz/sodapy")
+             (commit (string-append version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "011gmxrnzipa9s6h2m9n9z60l2xb4bnsc983ixylffw8482j3qcx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             ;; Add current working directory to PYTHONPATH so that
+             ;; the tests can find the sodapy package.
+             (setenv "PYTHONPATH"
+                     (string-append (getcwd) ":"
+                                    (getenv "PYTHONPATH")))
+             (when tests?
+               (invoke "pytest" "-vv")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-requests-mock" ,python-requests-mock)))
+    (propagated-inputs `(("python-requests" ,python-requests)))
+    (home-page "https://github.com/xmunoz/sodapy")
+    (synopsis "Python library for the Socrata Open Data API")
+    (description "Python library for the Socrata Open Data API.")
+    (license license:expat)))
-- 
2.33.0


[-- Attachment #1.3: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-25 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 19:22 [bug#52064] [PATCH] gnu: Add python-sodapy Luis Felipe via Guix-patches via
2021-11-24 16:20 ` Luis Felipe via Guix-patches via
2021-11-24 23:31 ` Luis Felipe via Guix-patches via
2021-11-25 18:14 ` Luis Felipe via Guix-patches via

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.