From 97dccd6449aba9d44175960081411c1e57247308 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 12 Dec 2024 22:04:30 +0900 Subject: import/pypi: Fix project URL discovery when the project name contains periods. * guix/import/pypi.scm (find-project-url): Add an extra candidate rewriting periods to underscores in the project name. Change-Id: I7e3afc63bcc87fafa40fcff2b394b90633d23067 --- guix/import/pypi.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 7b9f54a200..479b4684a3 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2015-2017, 2019-2024 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2018, 2023 Ricardo Wurmus -;;; Copyright © 2019 Maxim Cournoyer +;;; Copyright © 2019, 2024 Maxim Cournoyer ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020 Lars-Dominik Braun ;;; Copyright © 2020 Arun Isaac @@ -457,10 +457,13 @@ (define (find-project-url name pypi-url) "Try different project name substitution until the result is found in pypi-uri. Downcase is required for \"uWSGI\", and underscores are required for flake8-array-spacing." + ;; XXX: Each tool producing wheels and sdists appear to have their own, + ;; distinct, naming scheme. (or (find (cut string-contains pypi-url <>) (list name (string-downcase name) - (string-replace-substring name "-" "_"))) + (string-replace-substring name "-" "_") + (string-replace-substring name "." "_"))) (begin (warning (G_ "project name ~a does not appear verbatim in the PyPI URI~%") -- cgit v1.2.3