From: zimoun <zimon.toutoune@gmail.com>
To: Lulu <me@erkin.party>, "guix-patches@gnu.org" <guix-patches@gnu.org>
Subject: bug#44030: [PATCH] guix: import: Add versioning syntax to pypi importer.
Date: Mon, 26 Oct 2020 16:49:14 +0100 [thread overview]
Message-ID: <86y2jt3s3p.fsf@gmail.com> (raw)
In-Reply-To: <1085530218.67944.1603656272351@office.mailbox.org>
Hi,
Thank you for working on this.
On Sun, 25 Oct 2020 at 23:04, Lulu <me@erkin.party> wrote:
> Ah, heck, I used an old revision of the file when I generated the diff.
> Sorry about that. Here's the properly working patch:
That’s fine. Usually to ease the reading, it is a good habit to
increase the version of the patch, (see the option ’reroll-count’ of
git-format-patch).
However, the 2 patches are not proper commit, right? You can locally
commit your changes and send them. Basically, it means the same thing
but including the commit message. Here it looks like:
--8<---------------cut here---------------start------------->8---
import: pypi: Allow ’@’ for specifying the version.
Fixes <https://bugs.gnu.org/44030>.
* guix/import/pypi.json (pypi-fetch): Allow ’@’ for specifying the
version.
--8<---------------cut here---------------end--------------->8---
Well, I let you find more inspiration in previous commit messages. ;-)
> 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)))
If you feel adventurous, you could try to add a test in the file
“tests/pypi.scm”. :-)
> ;; 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))
Why is this line modified?
> (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$"
Idem.
All the best,
simon
next prev parent reply other threads:[~2020-10-26 15:51 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 [this message]
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 ` bug#44030: [PATCH] import: pypi: Add '@' syntax for specifying the package version Lulu
2020-10-29 22:09 ` bug#44030: guix import pypi foo@1.2.3 breaks 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=86y2jt3s3p.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=guix-patches@gnu.org \
--cc=me@erkin.party \
/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).