GNU bug report logs - #77600
[PATCH] import/pypi: Improve renaming procedure.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Mon, 7 Apr 2025 07:22:01 UTC

Severity: normal

Tags: patch

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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: bug#77600: closed (Re: [bug#77600] [PATCH] import/pypi: Improve
 renaming procedure.)
Date: Mon, 14 Apr 2025 06:42:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#77600: [PATCH] import/pypi: Improve renaming procedure.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 77600 <at> debbugs.gnu.org.

-- 
77600: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77600
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Cc: 77600-done <at> debbugs.gnu.org
Subject: Re: [bug#77600] [PATCH] import/pypi: Improve renaming procedure.
Date: Mon, 14 Apr 2025 15:40:33 +0900
Hi,

Sharlatan Hellseher <sharlatanus <at> gmail.com> writes:

> Hi,
>
> The change looks reasonable.
>
> Some side note on PyPI source archive naming, they started forcing
> users to rename them to lower case only and _

OK, thanks for looking.  About the later naming, that's something to
handle in `guix-package->pypi-name', right?  I'm not sure this happens
*everywhere* for new releases now, on only in packages using modern
packaging tools such PEP 517 builders, though?

I've now applied this one.

-- 
Thanks,
Maxim

[Message part 3 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH] import/pypi: Improve renaming procedure.
Date: Mon,  7 Apr 2025 16:20:29 +0900
A package named upstream like 'tmdb-python' now gets named 'python-tmdb'
instead of 'python-tmdb-python', which is ugly and doesn't match our
convention (info "(guix) Python Modules").

* guix/import/pypi.scm (python->package-name): Turn a -python suffix into a
python- prefix.

Change-Id: I7c0227d569c0afe6b16329d7cedb51728e4365b0
---
 guix/import/pypi.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index dd43ebdcf3..5e2c6ec9ff 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -179,6 +179,8 @@ (define (python->package-name name)
 package."
   (cond
    ((string-prefix? "python-" name) (snake-case name))
+   ((string-suffix? "-python" name)
+    (string-append "python-" (string-drop-right name 7)))
    ((or (string=? "trytond" name)
         (string-prefix? "trytond-" name)) (snake-case name))
    (else (string-append "python-" (snake-case name)))))

base-commit: e2f37229e5e7f6e73806d8087faf9e1e94ea9acf
-- 
2.49.0




This bug report was last modified 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.