guix_mirror_bot pushed a commit to branch master
in repository guix.

commit d66e9698a18a6be2d6b670f5a31c23f87afece68
Author: Nicolas Graves <[email protected]>
AuthorDate: Sat Sep 20 01:28:30 2025 +0200

    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 <[email protected]>
---
 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 5f274aac0f..1e8825af78 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))

Reply via email to