PyPI importer gives null at home-page for some packages

  • Open
  • quality assurance status badge
Details
2 participants
  • Evgeny Pisemsky
  • Simon Tournier
Owner
unassigned
Submitted by
Evgeny Pisemsky
Severity
normal
E
E
Evgeny Pisemsky wrote on 17 Sep 13:23 +0200
(address . bug-guix@gnu.org)
87plp2o76x.fsf@pisemsky.site
For example, this command:

guix import pypi snitun@0.35.0
S
S
Simon Tournier wrote on 20 Sep 19:02 +0200
87a5g2s1gf.fsf@gmail.com
Hi,

On mar., 17 sept. 2024 at 14:23, Evgeny Pisemsky <mail@pisemsky.site> wrote:
Toggle quote (4 lines)
> For example, this command:
>
> guix import pypi snitun@0.35.0

That’s probably because the JSON file metadata stored in PyPI does not
have the information.

Well, do you prefer #false in order to be consistent with the rest, as
license for instance?

Cheers,
simon
E
E
Evgeny Pisemsky wrote on 22 Sep 09:00 +0200
(name . Simon Tournier)(address . zimon.toutoune@gmail.com)(address . 73314@debbugs.gnu.org)
87h6a8b2av.fsf@pisemsky.site
Hi, actually I was thinking about empty string, because the package
record type definition in (guix packages) has explicit comment:

(home-page package-home-page) ; string

But #f also works, and grep'ing shows that a lot of packages and even
tests use it, so let it be #f, with changing the comment above to:

string | #f
E
E
Evgeny Pisemsky wrote on 22 Nov 17:38 +0100
[PATCH] Fix null at home-page in PyPI importer
875xofrzom.fsf@pisemsky.site
Here is the fix that works for me.
From b3a7c4fb23dafe9ae3103c206a1cfc0a6676a0fc Mon Sep 17 00:00:00 2001
Message-ID: <b3a7c4fb23dafe9ae3103c206a1cfc0a6676a0fc.1732292783.git.mail@pisemsky.site>
From: Evgeny Pisemsky <mail@pisemsky.site>
Date: Fri, 22 Nov 2024 19:19:50 +0300
Subject: [PATCH] Fix null at home-page in PyPI importer

Change-Id: I501582988cf58b00bd201c12ad47e9b095988fae
---
guix/import/pypi.scm | 4 ++--
guix/packages.scm | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

Toggle diff (32 lines)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 7b9f54a200..397ae5d5fd 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -114,8 +114,8 @@ (define-json-mapping <project-info> make-project-info project-info?
(license project-info-license) ;string
(download-url project-info-download-url ;string | #f
"download_url" non-empty-string-or-false)
- (home-page project-info-home-page ;string
- "home_page")
+ (home-page project-info-home-page ;string | #f
+ "home_page" non-empty-string-or-false)
(url project-info-url "project_url") ;string
(release-url project-info-release-url "release_url") ;string
(version project-info-version)) ;string
diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..950e262274 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -648,7 +648,7 @@ (define-record-type* <package>
(sanitize validate-texinfo)) ; one or two paragraphs
(license package-license ; (list of) <license>
(sanitize validate-license))
- (home-page package-home-page) ; string
+ (home-page package-home-page) ; string | #f
(supported-systems package-supported-systems ; list of strings
(default %supported-systems))

base-commit: 2fec407b2745898d0a304c172a27dfe0a8787122
--
2.46.0
S
S
Simon Tournier wrote on 10 Dec 17:48 +0100
control message for bug #73314
(address . control@debbugs.gnu.org)
878qsnxz55.fsf@gmail.com
tags 73314 + patch
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73314@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73314
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch