From unknown Wed Jun 18 00:26:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#33046 <33046@debbugs.gnu.org> To: bug#33046 <33046@debbugs.gnu.org> Subject: Status: pypi importer doesn't print the correct source Reply-To: bug#33046 <33046@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:26:07 +0000 retitle 33046 pypi importer doesn't print the correct source reassign 33046 guix submitter 33046 Julien Lepiller severity 33046 normal tag 33046 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 15 09:39:41 2018 Received: (at submit) by debbugs.gnu.org; 15 Oct 2018 13:39:41 +0000 Received: from localhost ([127.0.0.1]:49940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC35x-0001tH-CS for submit@debbugs.gnu.org; Mon, 15 Oct 2018 09:39:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC35v-0001t1-UE for submit@debbugs.gnu.org; Mon, 15 Oct 2018 09:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gC35q-0003s9-1l for submit@debbugs.gnu.org; Mon, 15 Oct 2018 09:39:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gC35o-0003rm-Jh for submit@debbugs.gnu.org; Mon, 15 Oct 2018 09:39:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gC35n-00019q-ST for bug-guix@gnu.org; Mon, 15 Oct 2018 09:39:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gC35i-0003pr-00 for bug-guix@gnu.org; Mon, 15 Oct 2018 09:39:31 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:35346) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gC35g-0003m8-G6 for bug-guix@gnu.org; Mon, 15 Oct 2018 09:39:25 -0400 Received: from webmail.lepiller.eu (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 21e9f0d6 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 15 Oct 2018 13:38:45 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 15 Oct 2018 15:39:15 +0200 From: Julien Lepiller To: bug-guix@gnu.org Subject: pypi importer doesn't print the correct source Message-ID: X-Sender: julien@lepiller.eu User-Agent: Roundcube Webmail/1.3.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hi, I tried to use the importer to refresh python-twisted, and got this source: (uri (pypi-uri "twisted" version)) while the correct one should be (uri (pypi-uri "Twisted" version ".tar.bz2")) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 10:46:32 2019 Received: (at 33046) by debbugs.gnu.org; 31 Mar 2019 14:46:32 +0000 Received: from localhost ([127.0.0.1]:38394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAbjD-00019y-IA for submit@debbugs.gnu.org; Sun, 31 Mar 2019 10:46:32 -0400 Received: from mail-it1-f182.google.com ([209.85.166.182]:33125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAbj9-00011u-Ci for 33046@debbugs.gnu.org; Sun, 31 Mar 2019 10:46:28 -0400 Received: by mail-it1-f182.google.com with SMTP id v8so15190495itf.0 for <33046@debbugs.gnu.org>; Sun, 31 Mar 2019 07:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lSTPLlRfmlwOp3u6NR1Uj5E0KqRLij1Upf2SDoMUUBY=; b=kzIAtG9Crzq3//ImUTdBO5OSte1suRtKDYFY+93ne49tPEBEcuaWGkWq9hfYLJ61TR 9r0uz2CIwisVPgIMa+35H3TNBM7nSDMzJreJSv39PoLpFM11LIMHdWJy0IjTtQGGaNIQ X2mn0n7p09nRZJc2SK4sDf9nyjDtZ5wjnd+ZWwnxVDpfN3zY+3gKbQp/eGL11GhBdkNS kkUyGD83obcOMARfmdpMU3xO0nm/O8fF7WRdic9Nk6A0lXEAPUcjm29AKKYRQuwCrPaQ w1QgOKNV02ITYQ7AuLyxLwFTJDIGGFT5cYOCQj0bFy7hldvoNC6/ci31/TMoqypY0tKo BLOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=lSTPLlRfmlwOp3u6NR1Uj5E0KqRLij1Upf2SDoMUUBY=; b=Txe8llMVRiF9dPfixZoYp8lJKXVwa0X+qPK/7xkJVbXsFRkzyynOA/s1gfqlHH/Sp/ WbzJzVCz32NTtu3K5frNPwJNZhdXNdKeF+7s+FNdorHzKJ1ccGfsMQqcowtPfmMu/UZf NQmEe60k1Snqw0yPPmKay7jOHw+y6P6qZ4MQispTW5KJesfq2BNjN6WaK570Zcc6mTQG tCAvHw9nqkAtsnioPpJJCrrVw4WsehdWozk0xXZQ7PTAvNcs45h4gxTGbt7Eev0X8T9R F6rD/6nhkCaeiz1GOfTk7B0HvLS4kL4CMGb8XL3m+CThRoHDcJ6oa/Bc0o+1nRYHENiK +6YQ== X-Gm-Message-State: APjAAAWq+bynYo4R1+72LJdHL1G7vtp8pd7uc+VbkmUH7FH8LwJlyO4C npBY0D969AKdBXLI8iSxZHtAK5ZrDwQ= X-Google-Smtp-Source: APXvYqxh2o9V17geknC3lZBfkcnuzcq5lipQq8eGNX7AS0InCRT7hM55tfz/eIFoxf1P+KuerHKzXQ== X-Received: by 2002:a24:7d94:: with SMTP id b142mr1436125itc.167.1554043581455; Sun, 31 Mar 2019 07:46:21 -0700 (PDT) Received: from kwak ([2607:f2c0:94b4:fa00::235]) by smtp.gmail.com with ESMTPSA id o11sm4165855itb.33.2019.03.31.07.46.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 07:46:20 -0700 (PDT) From: Maxim Cournoyer To: Julien Lepiller Subject: Re: bug#33046: pypi importer doesn't print the correct source References: Date: Sun, 31 Mar 2019 10:46:18 -0400 In-Reply-To: (Julien Lepiller's message of "Mon, 15 Oct 2018 15:39:15 +0200") Message-ID: <87a7hb2jb9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33046 Cc: 33046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello! Julien Lepiller writes: > Hi, I tried to use the importer to refresh python-twisted, and got > this source: > > (uri (pypi-uri "twisted" version)) > > while the correct one should be > > (uri (pypi-uri "Twisted" version ".tar.bz2")) I believe the attached patch fixes this :-). It's based on the patch set attached to bug #24450 though, so that one should be reviewed/merged first. Here's the result, for a couple packages that were problematic in the mixed case regards: --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix import pypi Twisted Starting download of /tmp/guix-file.BdpmRc >From https://files.pythonhosted.org/packages/5d/0e/a72d85a55761c2c3ff1cb968= 143a2fd5f360220779ed90e0fadf4106d4f2/Twisted-18.9.0.tar.bz2... =E2=80=A69.0.tar.bz2 2.9MiB 1.5MiB/s 00:02 [#############= #####] 100.0% (package (name "python-twisted") (version "18.9.0") (source (origin (method url-fetch) (uri (pypi-uri "Twisted" version)) (sha256 (base32 "15d3gmkrg8g27hyd6ihawv2y2dv5gnpyg67wy9npgbl4pz3f4jr9")))) (build-system python-build-system) (propagated-inputs `(("python-attrs" ,python-attrs) ("python-automat" ,python-automat) ("python-constantly" ,python-constantly) ("python-hyperlink" ,python-hyperlink) ("python-incremental" ,python-incremental) ("python-pyhamcrest" ,python-pyhamcrest) ("python-zope.interface" ,python-zope.interface))) (native-inputs `(("python-pydoctor" ,python-pydoctor) ("python-pyflakes" ,python-pyflakes) ("python-sphinx" ,python-sphinx) ("python-subunit" ,python-subunit) ("python-towncrier" ,python-towncrier) ("python-twisted-dev-tools" ,python-twisted-dev-tools) ("python-twistedchecker" ,python-twistedchecker))) (home-page "http://twistedmatrix.com/") (synopsis "An asynchronous networking framework written in Python") (description "An asynchronous networking framework written in Python") (license license:expat)) --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix import pypi uWSGI Starting download of /tmp/guix-file.TNSMx7 >From https://files.pythonhosted.org/packages/e7/1e/3dcca007f974fe4eb369bf1b= 8629d5e342bb3055e2001b2e5340aaefae7a/uwsgi-2.0.18.tar.gz... =E2=80=A6.18.tar.gz 783KiB 751KiB/s 00:01 [#############= #####] 100.0% guix import: warning: Cannot guess requirements from source archive: no req= uires.txt file found. (package (name "python-uwsgi") (version "2.0.18") (source (origin (method url-fetch) (uri (pypi-uri "uwsgi" version)) (sha256 (base32 "10zmk4npknigmbqcq1wmhd461dk93159px172112vyq0i19sqwj9")))) (build-system python-build-system) (home-page "https://uwsgi-docs.readthedocs.io/en/latest/") (synopsis "The uWSGI server") (description "The uWSGI server") (license #f)) --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix import pypi Deprecated Starting download of /tmp/guix-file.cHmIDG >From https://files.pythonhosted.org/packages/2c/6a/f7c9d1db90d758a9dc21daaa= 5660a01b3ab22ca56533f6a62b24c0d113e6/Deprecated-1.2.5.tar.gz... =E2=80=A61.2.5.tar.gz 4.8MiB 1.2MiB/s 00:04 [#############= #####] 100.0% Starting download of /tmp/guix-file.Yj88Cr >From https://files.pythonhosted.org/packages/9f/7a/003fa432f1e4562562654972= 6c2fbb7a29baa764e9d1fdb2323a5d779f8a/Deprecated-1.2.5-py2.py3-none-any.whl.= .. =E2=80=A6y2.py3-none-any.whl 8KiB 2.1MiB/s 00:00 [#############= #####] 100.0% (package (name "python-deprecated") (version "1.2.5") (source (origin (method url-fetch) (uri (pypi-uri "Deprecated" version)) (sha256 (base32 "0mw5hv0bci5lzzi7ip62vm1ivmxhqj7zwc557p7iyjz3xsq3wa9g")))) (build-system python-build-system) (propagated-inputs `(("python-wrapt" ,python-wrapt))) (native-inputs `(("python-bumpversion" ,python-bumpversion) ("python-pytest" ,python-pytest) ("python-pytest-cov" ,python-pytest-cov) ("python-sphinx" ,python-sphinx) ("python-tox" ,python-tox))) (home-page "https://github.com/tantale/deprecated") (synopsis "Python @deprecated decorator to deprecate old python classes, function= s or methods.") (description "Python @deprecated decorator to deprecate old python classes, function= s or methods.") (license license:expat)) --8<---------------cut here---------------end--------------->8--- --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-import-pypi-Preserve-package-name-case-when-forming-.patch >From 1290f9d1f0d594fdd4723d76b94116be25da9dd5 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 30 Mar 2019 20:27:35 -0400 Subject: [PATCH] import: pypi: Preserve package name case when forming pypi-uri. Fixes issue: #33046. * guix/build-system/python.scm (pypi-uri): Update the host URI to "files.pythonhosted.org". * guix/import/pypi.scm (make-pypi-sexp): Preserve the package name case when the source URL calls for it. --- guix/build-system/python.scm | 2 +- guix/import/pypi.scm | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index b753940bad..e39c06528e 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -50,7 +50,7 @@ "Return a URI string for the Python package hosted on the Python Package Index (PyPI) corresponding to NAME and VERSION. EXTENSION is the file name extension, such as '.tar.gz'." - (string-append "https://pypi.org/packages/source/" + (string-append "https://files.pythonhosted.org/packages/source/" (string-take name 1) "/" name "/" name "-" version extension)) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index a2ce14b192..fecf95d0a7 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -371,15 +371,20 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." `(package (name ,(python->package-name name)) (version ,version) - (source (origin - (method url-fetch) - ;; Sometimes 'pypi-uri' doesn't quite work due to mixed - ;; cases in NAME, for instance, as is the case with - ;; "uwsgi". In that case, fall back to a full URL. - (uri (pypi-uri ,(string-downcase name) version)) - (sha256 - (base32 - ,(guix-hash-url temp))))) + (source + (origin + (method url-fetch) + ;; PyPI URL are case sensitive, but sometimes a project + ;; named using mixed case has a URL using lower case, so + ;; we must work around this inconsistency. For actual + ;; examples, compare the URLs of the "Deprecated" and + ;; "uWSGI" PyPI packages. + (uri ,(if (string-contains source-url name) + `(pypi-uri ,name version) + `(pypi-uri ,(string-downcase name) version))) + (sha256 + (base32 + ,(guix-hash-url temp))))) (build-system python-build-system) ,@(maybe-inputs required-inputs 'propagated-inputs) ,@(maybe-inputs test-inputs 'native-inputs) -- 2.20.1 --=-=-= Content-Type: text/plain Maxim --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 10:46:39 2019 Received: (at control) by debbugs.gnu.org; 31 Mar 2019 14:46:39 +0000 Received: from localhost ([127.0.0.1]:38397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAbjK-0001G3-BO for submit@debbugs.gnu.org; Sun, 31 Mar 2019 10:46:39 -0400 Received: from mail-it1-f179.google.com ([209.85.166.179]:35742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAbjH-00019A-VR for control@debbugs.gnu.org; Sun, 31 Mar 2019 10:46:36 -0400 Received: by mail-it1-f179.google.com with SMTP id w15so11128510itc.0 for ; Sun, 31 Mar 2019 07:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=W6v4MUh92nW105Woe9GkirKBpexxsg7JvZUtlmO58r8=; b=DKk7nMfSOZUA+PJf9MV4J+ItqiuxfYVkU1pLeHBPhBAYsdwRF/6DyvCNaSDBdJo/BN CLQ4oresnamBlzlJIIUQsJWtgm0FktbQ9DgIskJmUQBJI0+H/Oa1cmh13KZQotj9aFyr WKEzWHyNTljan0yfEhI3xwiS6wmRSIuPDS1k9VHQxjLBA+m0JrJVFjWrMig84SXb3/ND x1yTqqGyx2mPTfMsv5hW1A1/FJnM9bv5t1K9sHUBcWgnBJD79MqDxS2br8Fl0xWxQa75 7ZAk/KbeWNqsWCbGQ5g686sDWWJNWjdLNMkSIaHb+peZCSuqT5K871uufHQDMOd6UItS MD4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=W6v4MUh92nW105Woe9GkirKBpexxsg7JvZUtlmO58r8=; b=iLEe/8gb37S+/8+0eRnv5Yf1WLtjK6lkQaE9bDAol93b56hdKuRDTjbGIQciEc9XP+ 6ictAPTgDbXf303qK4iKoGYhg/5quIB9hHx/9ffrDa34foLmM2RjZ6f1wVsLkGWXemiP mGAK24aNAeziYhBsC+gvtMGjfquMrpcXl52dSw0+JF+0aebVHC6gCzEDtUHxvRSayKwF HjFHSW+KGyBh7tRnMeEXGvAvhYhVk1pA82ULsmEC9nb//1zrDkQ1gLT+nPZbIZhtYv2W fTvKI0siMjaIHQejStNHTl//LElv2zKAWLgwBRxBibcrcloE7iOtgjYq4vrt65le05iF yc8w== X-Gm-Message-State: APjAAAWGp33gj442d9T+1S7vJB+9744Xt03A2E+5tvfRJtbnYZZgbyds G2ozAfhPYHOCTe4R0oU1pG+/0MRst18= X-Google-Smtp-Source: APXvYqzGlq6HhG+wyiu/pzgq3m+SvfIJyhnId46TumoN9EJNaO6zD0zvG6C2bxv4fch8O+lSNq77DA== X-Received: by 2002:a24:6712:: with SMTP id u18mr11947809itc.144.1554043590226; Sun, 31 Mar 2019 07:46:30 -0700 (PDT) Received: from kwak ([2607:f2c0:94b4:fa00::235]) by smtp.gmail.com with ESMTPSA id l8sm4311566itl.26.2019.03.31.07.46.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 07:46:29 -0700 (PDT) Date: Sun, 31 Mar 2019 10:46:28 -0400 Message-Id: <878swv2jaz.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #33046 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 33046 patch From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 20:14:57 2019 Received: (at 33046) by debbugs.gnu.org; 1 Apr 2019 00:14:57 +0000 Received: from localhost ([127.0.0.1]:38650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAkbI-0000iW-TR for submit@debbugs.gnu.org; Sun, 31 Mar 2019 20:14:57 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:46748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAkbH-0000iI-At for 33046@debbugs.gnu.org; Sun, 31 Mar 2019 20:14:55 -0400 Received: by mail-io1-f52.google.com with SMTP id b9so6254072iot.13 for <33046@debbugs.gnu.org>; Sun, 31 Mar 2019 17:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rc+xjHDM7No8b3AMdy0BO9k8iyukZabP5yoWfCM8RJE=; b=d7dz90iT0dpD+KfCsF6CTi7+DZvzOJywKBKSwkeMau0ntqrnpbeUg9grJHV2aif5Ad zUeDtBXSl9ad12S6fRsyt6B8I3m0ANO+Dla6G7qSwx9gYhtLT6NK/E/ODnpmwoVvSdpk H8niaKem0ZR0Sk7gaBoNsXWRxxzRNMQ+t/ypYbQNZA8kV5r6TKmrD8lLR/R8PWVtazUv o4CBy6K2EKnWIPOxzQ8fVMg9jCUJYSxyQjMJXnWbgV1zsdZuoeaEtrmnX1FcFH1cSB5v fTTZ8u+PbGkO1aRaoSE8oPo0Ria0DAdgwS/jz1kClHRfYw65MYlGHx+TOhMEcY8cWHAb RliA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rc+xjHDM7No8b3AMdy0BO9k8iyukZabP5yoWfCM8RJE=; b=IXdxzIOIvmqbCrQamncxs6bkm+JZZr8o9FpmQOg0SlPBseTNmiwAtRZPexnMLYyoNJ 8gpv9MOf/d50uozDBNUQQ/GoBR9qT58njJQWEGCIC0YLS3XKQL51V+H4zVmhOjjtNxZY 1mohQ/qeEzlhD4xfm4l1o8OVjfZ4jbUAlRkgUuFqZNaOayhTkVfYRI5KubCFL3q+VZ4j Gxtu120IbTmTDXGgShHQ5a1HIKJYJQZAM8nwsA/KvBf/WiT4jv1tvgmT/JueUuAOTJkv GDFmS4QnXmBnLFYWO0SAiOgrvvt3bYAc6MPwuS78BqJ91b7q1QZM5jE0ATKzKUuJARCD Tp3g== X-Gm-Message-State: APjAAAVv8y5nTkqnFCdAsnTOhihvHY1TF76lzUvBRCjrUYY4i/TpMdw2 zk0P01SWQIo6Nf3cROgJPFaIP0XN X-Google-Smtp-Source: APXvYqwZ0g6ccIgmKei+6SHx/kzQVz50CMQOl0/gdCiHkdgL8190pl+RMhlzJtM4MNsg/Cbnx+gzng== X-Received: by 2002:a6b:8b50:: with SMTP id n77mr39643492iod.222.1554077689479; Sun, 31 Mar 2019 17:14:49 -0700 (PDT) Received: from kwak ([2607:f2c0:94b4:fa00::235]) by smtp.gmail.com with ESMTPSA id m25sm4635756iti.24.2019.03.31.17.14.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 17:14:48 -0700 (PDT) From: Maxim Cournoyer To: Julien Lepiller Subject: [PATCH v2] bug#33046: pypi importer doesn't print the correct source References: <87a7hb2jb9.fsf@gmail.com> Date: Sun, 31 Mar 2019 20:14:46 -0400 In-Reply-To: <87a7hb2jb9.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 31 Mar 2019 10:46:18 -0400") Message-ID: <874l7i37k9.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33046 Cc: 33046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello, I just noticed that by changing the PyPI URL, the PyPI updater coverage had gone from 15.3% to 0%! Luckily, the fix was trivial and is included in my v2 patch (attached). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-v2-import-pypi-Preserve-package-name-case-when-forming-.patch Content-Transfer-Encoding: quoted-printable From=203c9c4229c460b6fdf0da804dddcd3d2cdd3aec4b Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 30 Mar 2019 20:27:35 -0400 Subject: [PATCH] import: pypi: Preserve package name case when forming pypi-uri. Fixes issue: #33046. * guix/build-system/python.scm (pypi-uri): Update the host URI to "files.pythonhosted.org". * guix/import/pypi.scm (make-pypi-sexp): Preserve the package name case when the source URL calls for it. (pypi-package?): Augment to include new PyPI URL. =2D-- guix/build-system/python.scm | 2 +- guix/import/pypi.scm | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index b753940bad..e39c06528e 100644 =2D-- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -50,7 +50,7 @@ "Return a URI string for the Python package hosted on the Python Package Index (PyPI) corresponding to NAME and VERSION. EXTENSION is the file name extension, such as '.tar.gz'." =2D (string-append "https://pypi.org/packages/source/" + (string-append "https://files.pythonhosted.org/packages/source/" (string-take name 1) "/" name "/" name "-" version extension)) =20 diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index a2ce14b192..a02b718d39 100644 =2D-- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -371,15 +371,20 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION= , and LICENSE." `(package (name ,(python->package-name name)) (version ,version) =2D (source (origin =2D (method url-fetch) =2D ;; Sometimes 'pypi-uri' doesn't quite work = due to mixed =2D ;; cases in NAME, for instance, as is the c= ase with =2D ;; "uwsgi". In that case, fall back to a f= ull URL. =2D (uri (pypi-uri ,(string-downcase name) vers= ion)) =2D (sha256 =2D (base32 =2D ,(guix-hash-url temp))))) + (source + (origin + (method url-fetch) + ;; PyPI URL are case sensitive, but sometimes a proj= ect + ;; named using mixed case has a URL using lower case= , so + ;; we must work around this inconsistency. For actu= al + ;; examples, compare the URLs of the "Deprecated" and + ;; "uWSGI" PyPI packages. + (uri ,(if (string-contains source-url name) + `(pypi-uri ,name version) + `(pypi-uri ,(string-downcase name) version= ))) + (sha256 + (base32 + ,(guix-hash-url temp))))) (build-system python-build-system) ,@(maybe-inputs required-inputs 'propagated-inputs) ,@(maybe-inputs test-inputs 'native-inputs) @@ -437,7 +442,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, = and LICENSE." (define (pypi-url? url) (or (string-prefix? "https://pypi.org/" url) (string-prefix? "https://pypi.python.org/" url) =2D (string-prefix? "https://pypi.org/packages" url))) + (string-prefix? "https://pypi.org/packages" url) + (string-prefix? "https://files.pythonhosted.org" url))) =20 (let ((source-url (and=3D> (package-source package) origin-uri)) (fetch-method (and=3D> (package-source package) origin-method))) =2D-=20 2.20.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAlyhV/YACgkQEmDkZILm NWIEmRAAkvxEpyijUdX2p1XQwpPlNzvDt53ckZq27jxeDYpOuoQxoJbBidLtWJe9 9wpzytySLjnigPLM3wlf5b9tHXXA2DLKXPSHaBdMk/7WP6p/PMnXRVcBbYL9w2yK O7uATab+gbj5iHccsVX8c2IWe/ikt2xb2G4BcsFkaYBr3tC9zunMuS+aLP4cIQcu sV9ANM2ScSuKCvA/6AywHHc1IQlIsifJRv2ZPSmArjh56hcFHuiPE1DuwDYDmolq faZx6Y51EoFpJ8CaRBYRUxSdfjkOTjTHz2ZY/G+9z4lc9ywJOwuL3RSxU1JtesX6 LdSfk+/f58OSvYtJ/6b+WKR/q4zWPKf/luw8wcTYsQw8GwZ4BkZxlqfGeF/tdvBL 93LfihOJum1lMKolD4hgvcPKTeif5O8IGUJvIZECSKVPRznQ8MJYQfQjd8Nyechi 2AqLGFm1Ftax1t0JkGtIJUnhjN24yLZfzioLyaslWgAi8EaT5bYZKGIC8AsGt6Q2 iGSJfEq2KO4YHbrTDPD9sUeWsk4s4ymJIF9o8v6T6QAEPP8o82hERrZEGzPJ4kjF DdZ71z7PIF3Wjfvmda8hNz3PkAzULtAmQSYbNA6AoBKdXkTwt4u1x4mfIYwHC9g8 GeX47jScvJBCiln6lcbnXeQFlplmCIsJAuoPPmH2hRGbD5H0oVw= =XhQH -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 01 22:06:47 2019 Received: (at 33046-done) by debbugs.gnu.org; 2 Jul 2019 02:06:47 +0000 Received: from localhost ([127.0.0.1]:46399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hi8Bz-0007be-0c for submit@debbugs.gnu.org; Mon, 01 Jul 2019 22:06:47 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:47046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hi8Bx-0007bR-0N for 33046-done@debbugs.gnu.org; Mon, 01 Jul 2019 22:06:45 -0400 Received: by mail-pf1-f181.google.com with SMTP id 81so7435801pfy.13 for <33046-done@debbugs.gnu.org>; Mon, 01 Jul 2019 19:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:in-reply-to:message-id:user-agent:mime-version; bh=U/Jv+Ji2UrASfA+rkM89NiMt9Y60xIbIzcFq8M7J1mg=; b=iOWsh6h5kvLDevNRgx32u0t9qG3ovYNlpDUh1MZ+N/KKH+3n9WDMqPUvRNPSlkxtTw NsgCkAr/YjSMunYYegeaRjYvWIcgzvSvf6ZfCqsKqThljYmQgm0WpaQ/g1dctAFE/qbF 8NRfpwbZT+zdjNZJ5yy2a8hl39y++JKZBP55XwL43uH7LO60Bnumsq4F6Eov1hFXr3CL lYpsG8HCw5xLjoIaQehy+XkEAGbVYCvEb7xFKozILUONvSIeS7DENakilND9kVoHZtcm TwKbC6smulNgI4Bq6jzYDOqrN4FKuZyY05n6db1r7gfL81j7kPsGuizqLP61ALK0c5lp GcyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:in-reply-to:message-id :user-agent:mime-version; bh=U/Jv+Ji2UrASfA+rkM89NiMt9Y60xIbIzcFq8M7J1mg=; b=Qcm42amqYh4o74fZ2n4chS1LuOmt7pAD63A6lQZxPIhYLZRTkdS8f+c8xL8miebNZj JrLwduldvidIeTiugIbJiXDmsmmC3uaLCPPx9fPqLBNHVKSO8Aq20wI+MYS/9ha2vfgS Hf5iAFNAFLKhyny56JpgkJb1mZAKxlqtG5v2uFhuNkDxgCFiN6H8FaOiaYpXUpHzUJsi FI2+VKkhFwciVtbQqyOk0q75dTtp3Vyx0ki7nMvWWbXHrkogfwgW865IwY8nMRaPtd/m 1gX5la3Al/RhTUVTiildUKbeyDzY+azVag0DkMIkEJTfe41FI8+kAva+vqxO4i1yAzOt w+5Q== X-Gm-Message-State: APjAAAUmiAM4AAejAtcI+3ns6/uYt2DejsVAMvraCtv5HpJ1PEBzpG3v GYMSGg/QylzG3RObwEWjEXMbxJgXCu8= X-Google-Smtp-Source: APXvYqxGz0Le41gSCt9heyA8mzYUceEOL3sTpXraaIZnxcNQWiJ418yIVzF03LrlAIB31G4Z3IaJuw== X-Received: by 2002:a17:90a:ac13:: with SMTP id o19mr2595622pjq.143.1562033199006; Mon, 01 Jul 2019 19:06:39 -0700 (PDT) Received: from kwak ([240f:c7:38e9:1:766b:a43b:9222:c603]) by smtp.gmail.com with ESMTPSA id e6sm11936455pfn.71.2019.07.01.19.06.37 for <33046-done@debbugs.gnu.org> (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Jul 2019 19:06:38 -0700 (PDT) From: Maxim Cournoyer To: 33046-done@debbugs.gnu.org Subject: Re: Status: pypi importer doesn't print the correct source Date: Tue, 02 Jul 2019 11:06:35 +0900 In-Reply-To: bug's message of "Tue\, 02 Jul 2019 02\:05\:06 +0000" Message-ID: <877e91tck4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33046-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Fixed per commit 4b60ab8c006964d026dee8cf5f1260eba0b2bb81. Closing. Thanks! Maxim From unknown Wed Jun 18 00:26:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 30 Jul 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator