guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: import: pypi: Add special treatment for Tryton pa


From: guix-commits
Subject: branch master updated: import: pypi: Add special treatment for Tryton package names,
Date: Fri, 15 Jul 2022 15:15:02 -0400

This is an automated email from the git hooks/post-receive script.

htgoebel pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 2e0b7867fe import: pypi: Add special treatment for Tryton package 
names,
2e0b7867fe is described below

commit 2e0b7867fe89fcfb0523a85635ecc3e1f9484fcd
Author: Hartmut Goebel <h.goebel@crazy-compilers.com>
AuthorDate: Thu Jul 7 11:28:45 2022 +0200

    import: pypi: Add special treatment for Tryton package names,
    
    Trytond modules are Python packages, and treated like this in guix.  Anyhow,
    since they are add-ons for the “Trytond“ application, their guix package 
name
    do not get the "python-" prefix like other Python modules, (see also
    https://issues.guix.gnu.org/46057#1).  This change disables adding the
    "python-" prefix to the guix package name for Trytond modules when importing
    and updating, thus inhibiting irritating messages like in this example:
    
      $ guix refresh -u trytond-party
      …
      trytond-party: consider adding this propagated input: 
python-trytond-country
      trytond-party: consider removing this propagated input: trytond-country
    
    Handling this special case seems appropriate since (as of now) there are
    about 165 packages for Trytond and the number is growing.
    
    * guix/import/pypi.scm(python->package-name): Don't add "python-" prefix for
      trytond packages.
---
 guix/import/pypi.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 392fc9700b..2cb270620e 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -161,9 +161,11 @@ or #f if there isn't any."
 (define (python->package-name name)
   "Given the NAME of a package on PyPI, return a Guix-compliant name for the
 package."
-  (if (string-prefix? "python-" name)
-      (snake-case name)
-      (string-append "python-" (snake-case name))))
+  (cond
+   ((string-prefix? "python-" name) (snake-case name))
+   ((or (string=? "trytond" name)
+        (string-prefix? "trytond-" name)) (snake-case name))
+   (#t (string-append "python-" (snake-case name)))))
 
 (define (guix-package->pypi-name package)
   "Given a Python PACKAGE built from pypi.org, return the name of the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]