From d66e9698a18a6be2d6b670f5a31c23f87afece68 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sat, 20 Sep 2025 01:28:30 +0200 Subject: [PATCH] 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 --- guix/import/pypi.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 5f274aac0fc..1e8825af781 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -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))