GNU bug report logs - #56433
[PATCH] import: pypi: Add special treatment for Tryton package names,

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Thu, 7 Jul 2022 09:48:01 UTC

Severity: normal

Tags: patch

Done: Hartmut Goebel <h.goebel <at> crazy-compilers.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: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Subject: bug#56433: closed (Re: bug#56433: [PATCH] import: pypi: Add
 special treatment for Tryton package names,)
Date: Fri, 15 Jul 2022 19:17:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#56433: [PATCH] import: pypi: Add special treatment for Tryton package names, 

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 56433 <at> debbugs.gnu.org.

-- 
56433: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56433
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 56433-close <at> debbugs.gnu.org
Subject: Re: bug#56433: [PATCH] import: pypi: Add special treatment for Tryton
 package names,
Date: Fri, 15 Jul 2022 21:16:15 +0200
Thanks for the review. As you suggested, I added an example and pushed 
as 2e0b7867fe89fcfb0523a85635ecc3e1f9484fcd

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[Message part 3 (message/rfc822, inline)]
From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] import: pypi: Add special treatment for Tryton package names, 
Date: Thu,  7 Jul 2022 11:47:10 +0200
While Trytond modules are Python package, they don't have the "python-"
prefix (see also https://issues.guix.gnu.org/46057#1).  This patch disables
adding the prefix for Trytond modules when importing and updating, thus
inhibiting irritating messages like „consider removing this propagated input:
trytond-party, consider adding this propagated input: python-trytond-party“.

Handling this a 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 130ec769b3..ee74f6065c 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -162,9 +162,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

base-commit: 2b883504288fc48ed1ae80620e664fe5216766c7
-- 
2.30.4




This bug report was last modified 2 years and 313 days ago.

Previous Next


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