[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/16: import: pypi: Support exporting packages with .zip source.
From: |
guix-commits |
Subject: |
16/16: import: pypi: Support exporting packages with .zip source. |
Date: |
Wed, 5 Feb 2020 16:08:02 -0500 (EST) |
mbakke pushed a commit to branch master
in repository guix.
commit 9d0dfd9a9a7c43363a4e140c20d49f119fe6f2e3
Author: Jakub Kądziołka <address@hidden>
AuthorDate: Wed Feb 5 19:45:48 2020 +0100
import: pypi: Support exporting packages with .zip source.
* 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.
Signed-off-by: Marius Bakke <address@hidden>
---
guix/import/pypi.scm | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9..6897f42 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
;;; Copyright © 2018 Ricardo Wurmus <address@hidden>
;;; Copyright © 2019 Maxim Cournoyer <address@hidden>
+;;; Copyright © 2020 Jakub Kądziołka <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -363,7 +364,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 +376,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)
- 01/16: gnu: ppp: Update to 2.4.8., (continued)
- 01/16: gnu: ppp: Update to 2.4.8., guix-commits, 2020/02/05
- 07/16: gnu: libmtp: Update to 1.1.17., guix-commits, 2020/02/05
- 06/16: gnu: libmtp: Do not build the static library., guix-commits, 2020/02/05
- 09/16: gnu: zrythm: Update to 0.7.474., guix-commits, 2020/02/05
- 08/16: gnu: elfutils: Update synopsis and description, guix-commits, 2020/02/05
- 10/16: gnu: gpodder: Update to 3.10.13., guix-commits, 2020/02/05
- 12/16: gnu: lxqt-config: Fixing keyboard layout., guix-commits, 2020/02/05
- 11/16: gnu: streamlink: Update to 1.3.1., guix-commits, 2020/02/05
- 13/16: gnu: python-tomlkit: Update to 0.5.8., guix-commits, 2020/02/05
- 14/16: gnu: python-clikit: Update to 0.4.1., guix-commits, 2020/02/05
- 16/16: import: pypi: Support exporting packages with .zip source.,
guix-commits <=
- 15/16: gnu: python-cleo: Update to 0.7.6., guix-commits, 2020/02/05