GNU bug report logs -
#44030
guix import pypi foo@1.2.3 breaks
Previous Next
Reported by: zimoun <zimon.toutoune <at> gmail.com>
Date: Fri, 16 Oct 2020 13:49:01 UTC
Severity: normal
Tags: easy
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi,
Thank you for working on this.
On Sun, 25 Oct 2020 at 23:04, Lulu <me <at> 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
This bug report was last modified 3 years and 242 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.