From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8DH4K0RTmF+2XQAA0tVLHw (envelope-from ) for ; Tue, 27 Oct 2020 17:05:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WH3QJ0RTmF8eBQAA1q6Kng (envelope-from ) for ; Tue, 27 Oct 2020 17:05:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 233559405D2 for ; Tue, 27 Oct 2020 17:05:08 +0000 (UTC) Received: from localhost ([::1]:50974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXSPC-0004TX-86 for larch@yhetil.org; Tue, 27 Oct 2020 13:05:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXSOa-0004RC-E4 for guix-devel@gnu.org; Tue, 27 Oct 2020 13:04:28 -0400 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]:39504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXSOR-0006J9-55 for guix-devel@gnu.org; Tue, 27 Oct 2020 13:04:26 -0400 Received: by mail-ej1-x641.google.com with SMTP id bn26so3278957ejb.6 for ; Tue, 27 Oct 2020 10:04:18 -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:content-transfer-encoding; bh=D7yJe8ubEt1xj+uBtoIXHDRPNWKKf2DYCUUG/XqxEjE=; b=ejYF+KoM1E8dEvUPjQI4yFuypNvXm8/dnRNSQy4xOpRt/1mA/pGoZAzkSVhRXgU/R4 Uqluke/d+oKzwAU3/nAw8pQifu2imW+oy8c9M5kQTKmE97x/6mbz0Vsk5wFREPi9UuMz yy3NYT5BgbcM481MXDa7qCgNV2DXPAOcgYAdgC8lUZzWa2ymYRnmbjdtS13fRa+jYCBY 5wtvb0uCJv3Mha/BNQO+mIoqfr3ft3f+aq1jEYRbxeV/k6BGLhV6EcEk35XdKRlPGO+R +zKgsLkiHKb615vzrLhqZL7wWCWYuxY5wDngL4rfzy3LtnxbHE/Sr4K0VXh+z68qeTUJ i1xg== 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:content-transfer-encoding; bh=D7yJe8ubEt1xj+uBtoIXHDRPNWKKf2DYCUUG/XqxEjE=; b=sVJjclHfNhC5ntKMYgkapG7E+GYlLCISAjhJBbjoViSp4ntIbc8TbTiArmMLBVs+02 9rNPAUfL9dn2dvwQEEy1UCKPZrtyB8MHALBTrCrT/uD99iqlmZrKi6NEs+lU3IpnCv0s dwRBLao8MZY1/VxFI/En1kEPgz3A4q8zL+tr362xyBnWWkyKfsGPg20PnWz6pRcVzr1P Mk6RBAPXSA6SLOsW2tTIHZ2ZmDVLVbolrzvG+WteIGLU6gHHfVD4IBaWP6IdVvCjO6OX 3fha6Jox2AD4TTH+6hBqC/D/23JCi6QnEI4NrEzkOSQQOXDV7Gp2pl4lPvDW0XxGHdvc Bl6Q== X-Gm-Message-State: AOAM531hdPvyqE8XjnrOGpaIQ3RZwc55WrE9zTxCak+HZ/9uZrc/LJLo HCUyLn4OxVStG/lvQ4ow44OWxZJQwAs= X-Google-Smtp-Source: ABdhPJwgub2njyS4JN0COXGhRyaHXWfGlMTwF3tz00aSYS7BqV+lwgwSClnf/RUV2dkxCZCDOsMK+A== X-Received: by 2002:a17:906:d41:: with SMTP id r1mr3208667ejh.383.1603818256464; Tue, 27 Oct 2020 10:04:16 -0700 (PDT) Received: from Morphium (ip-84-118-73-55.unity-media.net. [84.118.73.55]) by smtp.gmail.com with ESMTPSA id a27sm1394258ejb.67.2020.10.27.10.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 10:04:15 -0700 (PDT) From: Malte Frank Gerdes To: zimoun Subject: Re: usage of pypi-uri in the pypi importer References: <86r1pwu0ff.fsf@gmail.com> <861rhl57xg.fsf@gmail.com> Date: Tue, 27 Oct 2020 18:04:14 +0100 In-Reply-To: <861rhl57xg.fsf@gmail.com> (zimoun's message of "Mon, 26 Oct 2020 16:22:03 +0100") Message-ID: <86mu07lhwx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::641; envelope-from=malte.f.gerdes@gmail.com; helo=mail-ej1-x641.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ejYF+KoM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: iaE9SqOxx83w TL;DR: Now that my initial problem is solved anyway. No change is needed at all. zimoun writes: > Dear, > > On Sat, 17 Oct 2020 at 21:17, Malte Frank Gerdes wrote: > >> i noticed that the python pypi importer generates packages definitions >> which rely on the pypi-uri function declared in the python build >> system. I observed that the python build system itself doesn't use this >> function at all, so why is it defined there and not in the python >> importer, which seems to be the only piece of software using it? > > Because, =E2=80=9Cpypi-uri=E2=80=9D is used by *a lot* of Python packages= =E2=80=93 packages > using =E2=80=99python-build-system=E2=80=99. For example, > gnu/packages/python-science.scm: > > [..] > #:use-module (guix build-system python)) > > (define-public python-scipy > (package > (name "python-scipy") > (version "1.3.2") > (source > (origin > (method url-fetch) > (uri (pypi-uri "scipy" version)) > (sha256 > (base32 "192d8dsybvhv19igkrsafbdafx198nz7pibkjgrqjhlr66s3jfd0")))) > (build-system python-build-system) > [..]=20=20=20=20 > > > In what you are proposing, if I read correctly, the > gnu/packages/python-science.scm should have to also import =E2=80=99(guix= import > pypi)=E2=80=99. Yes, that was exactly what i meant. The thing is: Every time i tried to build a python package that has it's uri specified vie `pypi-uri' i see a redirect to the actual place where the package is located. I don't know if this is to shorten the URLs or if it's a temperary solution. In the former case there is no problem and nothing needs to be done, in the latter case it might make sense to not use it. I'm not sure about this - the particular problem that lead me to this was: (please read on) >> Also: I tried to package pyinstrument-cext and noticed that the importer >> generated function isn't able to find the source package - only >> 404's. The importer uses PyPI's json API to get information about a >> given package (this includes it's url - called source-url), so is the >> pypi-uri function needed at all? the necessary information is available >> even without it. Or are there any specific reasons why things are as >> they are? > > I am not sure to understand. Using Guix 353bdae, I get: > > $ guix import pypi pyinstrument-cext > > Starting download of /tmp/guix-file.5tmgen > From https://files.pythonhosted.org/packages/b6/95/0a391322dd7f2f97f55337= 3659a787b7428dfe15fc2a8e01844c8768f45e/pyinstrument_cext-0.2.2.tar.gz... > =E2=80=A6xt-0.2.2.tar.gz 5KiB 704KiB/s 00:00 [###########= #######] 100.0% > > Starting download of /tmp/guix-file.cZDsRo > From https://files.pythonhosted.org/packages/13/2e/d548d3727aa3c5b77eb79f= 667e7212de1acf93087ddce5274887abbe217d/pyinstrument_cext-0.2.2-cp27-cp27m-m= acosx_10_6_intel.whl... > =E2=80=A6-cp27m-macosx_10_6_intel.whl 7KiB 679KiB/s 00:00 [###########= #######] 100.0% > (package > (name "python-pyinstrument-cext") > (version "0.2.2") > (source > (origin > (method url-fetch) > (uri (pypi-uri "pyinstrument-cext" version)) > (sha256 > (base32 > "0nycf7nhx2xzba49m8208agx5xghzxkma3iim5f43h3l3pvjb7pj")))) > (build-system python-build-system) > (home-page > "https://github.com/joerick/pyinstrument_cext") > (synopsis > "A CPython extension supporting pyinstrument") > (description > "A CPython extension supporting pyinstrument") > (license #f)) The problem here is: if you take that generated package definition as-is - and add it to guix - then it will fail to download the sources because the actual package name is `pyinstrument_cext' (notice the underscore!). Efraim suggested to me tha ti should change that. This works.=20 > BTW, =E2=80=99pypi-uri=E2=80=99 eases the management of all the packages = coming from > PyPI. If the URL of PyPI change or is mirrored, it is easy to switch or > add the mirror; otherwise one would have to go package by package. > Well, if I understand correctly what you mean. I see that. I was just wondering why this function exists, because the importer itself knows the correct link anyway (it's just ugly because it's long, the link i mean :D). But i might be misunderstanding how PyPI works here. Malte