import: pypi: Enforce home-page https prefix.

* guix/import/pypi.scm (make-pypi-sexp): Improve home-page handling to
enforce an https:// prefix, even in the case where upstream uses http://.

Change-Id: Iff4164a5f1ddc96af67ca7b092d3b9bbd6e2a827
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-09-20 01:28:30 +02:00 committed by Sharlatan Hellseher
parent 73fe38fd56
commit d66e9698a1
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -601,7 +601,12 @@ VERSION."
(sha256 (or (and=> sha256 bytevector->nix-base32-string)
(guix-hash-url (with-store store
(download-to-store store source-url)))))
(source (pypi-package->upstream-source pypi-package version)))
(source (pypi-package->upstream-source pypi-package version))
(home-page (project-info-home-page info))
(home-page (if (and (string? home-page)
(string-prefix? "http://" home-page))
(string-append "https" (string-drop home-page 4))
home-page)))
(values
`(package
(name ,(python->package-name name))
@ -626,7 +631,7 @@ VERSION."
'propagated-inputs)
,@(maybe-inputs (upstream-source-native-inputs source)
'native-inputs)
(home-page ,(project-info-home-page info))
(home-page ,home-page)
(synopsis ,(project-info-summary info))
(description ,(and=> (non-empty-string-or-false
(project-info-summary info))