Subject: bug#77600: closed (Re: [bug#77600] [PATCH] import/pypi: Improve renaming procedure.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 14 Apr 2025 06:42:02 +0000

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 [email-masked].

-- 
77600: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77600
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#77600] [PATCH] import/pypi: Improve renaming procedure.
From: Maxim Cournoyer <[email-masked]>
To: Sharlatan Hellseher <[email-masked]>
Cc: [email-masked]
Date: Mon, 14 Apr 2025 15:40:33 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Sharlatan Hellseher <[email-masked]> 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

Subject: [PATCH] import/pypi: Improve renaming procedure.
From: Maxim Cournoyer <[email-masked]>
To: [email-masked]
Cc: Maxim Cournoyer <[email-masked]>
Date: Mon, 7 Apr 2025 16:20:29 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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