GNU bug report logs -
#53395
Fix pypi import for flake8-array-spacing
Previous Next
Full log
View this message in rfc822 format
Hello!
Vivien Kraus <vivien <at> planete-kraus.eu> skribis:
> From d8923c394fbe2e8eedf6fa548455d398f0caa022 Mon Sep 17 00:00:00 2001
> From: Vivien Kraus <vivien <at> planete-kraus.eu>
> Date: Thu, 20 Jan 2022 20:11:56 +0100
> Subject: [PATCH] pypi importer: Convert - to _ in pypi urls if needed.
>
> * guix/import/pypi.scm (find-project-url): New function.
> (make-pypi-sexp): Use find-project-url.
[...]
> +(define (find-project-url name pypi-url)
> + "Try different project name substitution until the result is found in
> +pypi-url. Downcase is required for \"Deprecated\" and \"uWSGI\", and
> +underscores are required for flake8-array-spacing."
> + (or (find (cut string-contains pypi-url <>)
> + (list name
> + (string-downcase name)
> + (string-replace-substring name "-" "_")))
> + (begin
> + (warning (G_ "The project name `~a' does not appear in the pypi URL; you might need to fix the pypi-url declaration in the generated package. The URL is: ~a~%")
> + name pypi-url)
> + name)))
As a rule of thumb, warnings are one-line messages (not sentences)
describing the problem. Here you could emit such a warning, followed by
a call to ‘display-hint’, which accepts Texinfo markup.
Could you adjust accordingly?
Also, what about adding a unit test?
Thanks,
Ludo’.
This bug report was last modified 3 years and 113 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.