unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Munyoki Kilyungi <me@bonfacemunyoki.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: 56433@debbugs.gnu.org
Subject: [bug#56433] [PATCH] import: pypi: Add special treatment for Tryton package names,
Date: Fri, 08 Jul 2022 13:36:20 +0300	[thread overview]
Message-ID: <86a69jq4bf.fsf@bonfacemunyoki.com> (raw)
In-Reply-To: <026f292cc13e95239135786a8ad830a29d483e41.1657187223.git.h.goebel@crazy-compilers.com> (Hartmut Goebel's message of "Thu, 7 Jul 2022 11:47:10 +0200")

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]


Hartmut Goebel <h.goebel@crazy-compilers.com>
anaandika:

> 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)))))
>

In this case shouldn't you use an "else" at the
very end of this 'cond'?

>  (define (guix-package->pypi-name package)
>    "Given a Python PACKAGE built from pypi.org, return the name of the
>
> base-commit: 2b883504288fc48ed1ae80620e664fe5216766c7


-- 
(Life is like a pencil that will surely run out,
    but will leave the beautiful writing of life.)
(D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
    (hkp://keys.gnupg.net))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]

  reply	other threads:[~2022-07-08 10:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  9:47 [bug#56433] [PATCH] import: pypi: Add special treatment for Tryton package names, Hartmut Goebel
2022-07-08 10:36 ` Munyoki Kilyungi [this message]
2022-07-08 11:30   ` Hartmut Goebel
2022-07-08 21:36     ` Ludovic Courtès
2022-07-08 21:37 ` Ludovic Courtès
2022-07-11 13:49   ` Hartmut Goebel
2022-07-11 19:54     ` Ludovic Courtès
2022-07-15 19:16       ` bug#56433: " Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a69jq4bf.fsf@bonfacemunyoki.com \
    --to=me@bonfacemunyoki.com \
    --cc=56433@debbugs.gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).