bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44030: [PATCH] guix: import: Add versioning syntax to pypi importer.


From: Lulu
Subject: bug#44030: [PATCH] guix: import: Add versioning syntax to pypi importer.
Date: Sun, 25 Oct 2020 23:04:32 +0300 (TRT)

Ah, heck, I used an old revision of the file when I generated the diff.
Sorry about that. Here's the properly working patch:


diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 15116e349d..1ec1ecbfa1 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -118,13 +118,15 @@
 
 (define (pypi-fetch name)
   "Return a <pypi-project> record for package NAME, or #f on failure."
-  (and=> (json-fetch (string-append "https://pypi.org/pypi/"; name "/json"))
-         json->pypi-project))
+  ;; Convert @ in package name to / to access the correct URL.
+  (let ((versioned-name (string-join (string-split name #\@) "/")))
+    (and=> (json-fetch (string-append "https://pypi.org/pypi/"; versioned-name 
"/json"))
+           json->pypi-project)))
 
 ;; For packages found on PyPI that lack a source distribution.
 (define-condition-type &missing-source-error &error
   missing-source-error?
-  (package  missing-source-error-package))
+  (package missing-source-error-package))
 
 (define (latest-source-release pypi-package)
   "Return the latest source release for PYPI-PACKAGE."
@@ -371,7 +373,7 @@ be extracted in a temporary directory."
                  (invoke "tar" "xf" archive "-C" dir)))
            (let ((requires.txt-files
                   (find-files dir (lambda (abs-file-name _)
-                                   (string-match "\\.egg-info/requires.txt$"
+                                    (string-match "\\.egg-info/requires.txt$"
                                                   abs-file-name)))))
              (match requires.txt-files
                (()





reply via email to

[Prev in Thread] Current Thread [Next in Thread]