From: Lulu <me@erkin.party>
To: "guix-patches@gnu.org" <guix-patches@gnu.org>
Subject: bug#44030: [PATCH] import: pypi: Add '@' syntax for specifying the package version.
Date: Wed, 28 Oct 2020 22:32:27 +0300 (TRT) [thread overview]
Message-ID: <1052540792.123562.1603913548037@office.mailbox.org> (raw)
In-Reply-To: <86wnzqz3h8.fsf@gmail.com>
* 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
next prev parent reply other threads:[~2020-10-28 19:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 13:48 bug#44030: guix import pypi foo@1.2.3 breaks zimoun
2020-10-25 19:09 ` bug#44030: [PATCH] guix: import: Add versioning syntax to pypi importer Lulu
2020-10-25 20:04 ` Lulu
2020-10-26 15:49 ` zimoun
2020-10-25 20:50 ` bug#44030: guix import pypi foo@1.2.3 breaks Lulu
2020-10-26 15:58 ` zimoun
2020-10-28 19:32 ` Lulu [this message]
2020-10-29 22:09 ` Lulu
2020-11-02 12:15 ` zimoun
2021-11-21 6:14 ` Maxim Cournoyer
2021-11-22 9:07 ` zimoun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1052540792.123562.1603913548037@office.mailbox.org \
--to=me@erkin.party \
--cc=guix-patches@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).