apteryx pushed a commit to branch master
in repository guix.

commit 5af2a0c3905f9f9074596f1e8d7bdce1ef8d7ebd
Author: Maxim Cournoyer <maxim.courno...@gmail.com>
AuthorDate: Mon Apr 7 16:20:29 2025 +0900

    import/pypi: Improve renaming procedure.
    
    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 @@ or #f if there isn't any."
 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)))))

Reply via email to