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.
This commit is contained in:
parent
a537620054
commit
4b60ab8c00
|
@ -368,15 +368,20 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
|
||||||
`(package
|
`(package
|
||||||
(name ,(python->package-name name))
|
(name ,(python->package-name name))
|
||||||
(version ,version)
|
(version ,version)
|
||||||
(source (origin
|
(source
|
||||||
(method url-fetch)
|
(origin
|
||||||
;; Sometimes 'pypi-uri' doesn't quite work due to mixed
|
(method url-fetch)
|
||||||
;; cases in NAME, for instance, as is the case with
|
;; PyPI URL are case sensitive, but sometimes a project
|
||||||
;; "uwsgi". In that case, fall back to a full URL.
|
;; named using mixed case has a URL using lower case, so
|
||||||
(uri (pypi-uri ,(string-downcase name) version))
|
;; we must work around this inconsistency. For actual
|
||||||
(sha256
|
;; examples, compare the URLs of the "Deprecated" and
|
||||||
(base32
|
;; "uWSGI" PyPI packages.
|
||||||
,(guix-hash-url temp)))))
|
(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)
|
(build-system python-build-system)
|
||||||
,@(maybe-inputs required-inputs 'propagated-inputs)
|
,@(maybe-inputs required-inputs 'propagated-inputs)
|
||||||
,@(maybe-inputs test-inputs 'native-inputs)
|
,@(maybe-inputs test-inputs 'native-inputs)
|
||||||
|
|
Loading…
Reference in New Issue