[PATCH] gnu: Add python-sodapy.

  • Done
  • quality assurance status badge
Details
2 participants
  • Luis Felipe
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Luis Felipe
Severity
normal
L
L
Luis Felipe wrote on 23 Nov 2021 20:22
(name . Luis Felipe via Guix-patches)(address . guix-patches@gnu.org)
qH5fB6I_4GIBHC43qYg95kvvLatr5GxbENUDfkxcazsr4UEOY0UH5cv0NzwrVsBtWqIScC67gr44qlrAzD0Z7jINkwuTZJiDnFUtb4f9caM=@protonmail.com
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
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(+)

Toggle diff (35 lines)
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: signature.asc
L
L
Luis Felipe wrote on 24 Nov 2021 17:20
(name . 52064@debbugs.gnu.org)(address . 52064@debbugs.gnu.org)
Q4sVKQKoq114Vzb1ZGDorZxtowR512yFqeiOkIoJ0eT3UaBEeSCzWyloo16GDvfbT6I9bA1SYdN4hNs57bgxch-FKvAN0ZoQF706hQUaLgo=@protonmail.com
I wrote my email incorrectly in the initial patch. This new patch fixes that.

---
Luis Felipe López Acevedo
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(+)

Toggle diff (35 lines)
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: signature.asc
L
L
Luis Felipe wrote on 25 Nov 2021 00:31
(name . 52064@debbugs.gnu.org)(address . 52064@debbugs.gnu.org)
bfwsHSA2zFFa6jVwiWkFqQobfAbbwbBqvAttmMqIqeSvA7rJcnqwnl6ybqypikcouvXnd0YDPqVNb8VhZRJ8CWO9T-lUvvCqJMa90ePtak4=@protonmail.com
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: signature.asc
L
L
Luis Felipe wrote on 25 Nov 2021 19:14
(name . 52064@debbugs.gnu.org)(address . 52064@debbugs.gnu.org)
G2tTpXOZFA9mOE-JxQJ4kmaAhSiDWG8lANC5lqpLTjnuIEW_jv7Qlx3iBQzxWuuTo2D48AXfFtfzkxkDamNwCuq2uHVgO2cjmhTStshhY-U=@protonmail.com
Hi. Here's the new package definition with check phase enabled.

---
Luis Felipe López Acevedo
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(+)

Toggle diff (53 lines)
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: signature.asc
M
M
Maxim Cournoyer wrote on 4 Jan 2023 02:08
(name . Luis Felipe)(address . luis.felipe.la@protonmail.com)(address . 52064-done@debbugs.gnu.org)
87v8lnw1hg.fsf_-_@gmail.com
Hi Luis Felipe,

Unfortunately sodapy is not maintained anymore (see:
https://github.com/xmunoz/sodapy),so I think it'd be best to not
include it at this time.

I'll close this issue, but if you know of a maintained fork, feel free
to re-open it!

--
Thanks,
Maxim
Closed
?