[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/12: import: pypi: Preserve package name case when forming pypi-uri.
From: |
guix-commits |
Subject: |
12/12: import: pypi: Preserve package name case when forming pypi-uri. |
Date: |
Mon, 1 Jul 2019 21:43:05 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit 4b60ab8c006964d026dee8cf5f1260eba0b2bb81
Author: Maxim Cournoyer <address@hidden>
Date: Sat Mar 30 20:27:35 2019 -0400
import: pypi: Preserve package name case when forming pypi-uri.
Fixes <https://bugs.gnu.org/33046>.
* guix/build-system/python.scm (pypi-uri): Update the host URI to
"files.pythonhosted.org".
* guix/import/pypi.scm (make-pypi-sexp): Preserve the package name case when
the source URL calls for it.
---
guix/import/pypi.scm | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 537431d..ab7a024 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -368,15 +368,20 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION,
and LICENSE."
`(package
(name ,(python->package-name name))
(version ,version)
- (source (origin
- (method url-fetch)
- ;; Sometimes 'pypi-uri' doesn't quite work due to
mixed
- ;; cases in NAME, for instance, as is the case
with
- ;; "uwsgi". In that case, fall back to a full
URL.
- (uri (pypi-uri ,(string-downcase name) version))
- (sha256
- (base32
- ,(guix-hash-url temp)))))
+ (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)))
+ (sha256
+ (base32
+ ,(guix-hash-url temp)))))
(build-system python-build-system)
,@(maybe-inputs required-inputs 'propagated-inputs)
,@(maybe-inputs test-inputs 'native-inputs)
- branch master updated (0f06512 -> 4b60ab8), guix-commits, 2019/07/01
- 03/12: import: pypi: Do not parse optional requirements from source., guix-commits, 2019/07/01
- 02/12: tests: pypi: Mute the output of tar., guix-commits, 2019/07/01
- 06/12: import: pypi: Support more types of archives., guix-commits, 2019/07/01
- 12/12: import: pypi: Preserve package name case when forming pypi-uri.,
guix-commits <=
- 01/12: import: pypi: Do not consider requirements.txt files., guix-commits, 2019/07/01
- 05/12: import: pypi: Deduplicate requirements., guix-commits, 2019/07/01
- 04/12: import: pypi: Improve parsing of requirement specifications., guix-commits, 2019/07/01
- 11/12: import: pypi: Update the host URI., guix-commits, 2019/07/01
- 08/12: import: pypi: Fix typo in docstring., guix-commits, 2019/07/01
- 09/12: import: pypi: Completely mute the output of the "unzip" command., guix-commits, 2019/07/01
- 07/12: import: pypi: Parse wheel METADATA instead of metadata.json., guix-commits, 2019/07/01
- 10/12: import: pypi: Include optional test inputs as native-inputs., guix-commits, 2019/07/01