summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-04-07 16:20:29 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-04-14 13:34:00 +0900
commit5af2a0c3905f9f9074596f1e8d7bdce1ef8d7ebd (patch)
tree919bdd82ef0586d64e86d379300ba4b015fde87a
parent19de75a16532c95f9ef8755e115f2f7bb89cad27 (diff)
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
-rw-r--r--guix/import/pypi.scm2
1 files changed, 2 insertions, 0 deletions
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)))))