all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#39443] [PATCH] import: pypi: Support exporting packages with .zip source.
@ 2020-02-05 18:45 Jakub Kądziołka
  2020-02-05 21:04 ` bug#39443: " Marius Bakke
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kądziołka @ 2020-02-05 18:45 UTC (permalink / raw)
  To: 39443

* guix/import/pypi.scm (make-pypi-sexp): Rename test-inputs to
  native-inputs. Restructure the way pypi-uri parameters are generated.
  Use pypi-uri's extension parameter when required. Add "unzip" to
  native inputs when the package source is a zip file.
---
 guix/import/pypi.scm | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9c4c..a02644ff55 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -363,7 +363,11 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
           (receive (guix-dependencies upstream-dependencies)
               (compute-inputs source-url wheel-url temp)
             (match guix-dependencies
-              ((required-inputs test-inputs)
+              ((required-inputs native-inputs)
+               (when (string-suffix? ".zip" source-url)
+                 (set! native-inputs (cons
+                                     '("unzip" ,unzip)
+                                     native-inputs)))
                (values
                 `(package
                    (name ,(python->package-name name))
@@ -371,20 +375,29 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
                    (source
                     (origin
                       (method url-fetch)
-                      ;; PyPI URL are case sensitive, but sometimes a project
-                      ;; named using mixed case has a URL using lower case, so
-                      ;; we must work around this inconsistency.  For actual
-                      ;; examples, compare the URLs of the "Deprecated" and
-                      ;; "uWSGI" PyPI packages.
-                      (uri ,(if (string-contains source-url name)
-                                `(pypi-uri ,name version)
-                                `(pypi-uri ,(string-downcase name) version)))
+                      (uri (pypi-uri
+                             ;; PyPI URL are case sensitive, but sometimes
+                             ;; a project named using mixed case has a URL
+                             ;; using lower case, so we must work around this
+                             ;; inconsistency.  For actual examples, compare
+                             ;; the URLs of the "Deprecated" and "uWSGI" PyPI
+                             ;; packages.
+                             ,(if (string-contains source-url name)
+                                  name
+                                  (string-downcase name))
+                             version
+                             ;; Some packages have been released as `.zip`
+                             ;; instead of the more common `.tar.gz`. For
+                             ;; example, see "path-and-address".
+                             ,@(if (string-suffix? ".zip" source-url)
+                                   '(".zip")
+                                   '())))
                       (sha256
                        (base32
                         ,(guix-hash-url temp)))))
                    (build-system python-build-system)
                    ,@(maybe-inputs required-inputs 'propagated-inputs)
-                   ,@(maybe-inputs test-inputs 'native-inputs)
+                   ,@(maybe-inputs native-inputs 'native-inputs)
                    (home-page ,home-page)
                    (synopsis ,synopsis)
                    (description ,description)
-- 
2.25.0

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

* bug#39443: [PATCH] import: pypi: Support exporting packages with .zip source.
  2020-02-05 18:45 [bug#39443] [PATCH] import: pypi: Support exporting packages with .zip source Jakub Kądziołka
@ 2020-02-05 21:04 ` Marius Bakke
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Bakke @ 2020-02-05 21:04 UTC (permalink / raw)
  To: Jakub Kądziołka, 39443-done

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

Jakub Kądziołka <kuba@kadziolka.net> writes:

> * guix/import/pypi.scm (make-pypi-sexp): Rename test-inputs to
>   native-inputs. Restructure the way pypi-uri parameters are generated.
>   Use pypi-uri's extension parameter when required. Add "unzip" to
>   native inputs when the package source is a zip file.

Applied, thanks!  I also added a copyright line for you.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2020-02-05 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-05 18:45 [bug#39443] [PATCH] import: pypi: Support exporting packages with .zip source Jakub Kądziołka
2020-02-05 21:04 ` bug#39443: " Marius Bakke

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.