Subject: [bug#44030] [PATCH] import: pypi: Add '@' syntax for specifying the package version.

From: Lulu <[email-masked]>
Date: Wed, 28 Oct 2020 22:32:27 +0300 (TRT)

* guix/import/pypi.scm (pypi-fetch): Add ’@’ syntax for specifying the package version.
---
  guix/import/pypi.scm | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 15116e349d..559be4a98b 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -118,8 +118,10 @@
  
  (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
-- 
2.29.1