From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2HpVJS6YmF8tPAAA0tVLHw (envelope-from ) for ; Tue, 27 Oct 2020 21:59:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id WJkfIS6YmF/dSwAAbx9fmQ (envelope-from ) for ; Tue, 27 Oct 2020 21:59:10 +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 4FD36940546 for ; Tue, 27 Oct 2020 21:59:09 +0000 (UTC) Received: from localhost ([::1]:32940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXWzj-0005j9-Ns for larch@yhetil.org; Tue, 27 Oct 2020 17:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXWz9-0005i2-Ez for guix-devel@gnu.org; Tue, 27 Oct 2020 17:58:32 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:39233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXWz5-0000be-6b for guix-devel@gnu.org; Tue, 27 Oct 2020 17:58:31 -0400 Received: by mail-wm1-x32c.google.com with SMTP id d3so2935839wma.4 for ; Tue, 27 Oct 2020 14:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=P37KQhavp2nKLwYJDgM7u8nX1Mwa9YCR5FbKABD/Dpk=; b=qGLj4zjB3xFzD+wxyTye6ZI8uul4dBql4Ju5Lc1QH2T6q4nRpdiVDzmTTGnkJfOzDX Rp6oBBJN1BRToxhZ5Cyz0nIcTLAKQ3gmHlqUzvnM5m1hV4aKdzovf8/j9cL2icS7rEr1 k5jFHyrxjmLHLrHP2eUbbozdQjW68dOITQ2xEOMdirakejWJDY2UtjCMCJGwbxXq7zxs P3zYfy1hAyg8Gr/WOZWpBJUh6QLVFdbXPpmxWmCzcXl/0/zNADmKoyOYR06fdLPZ/dZv mJQ1R+qCdQVBeho7FbbPEtBiFeIJJyaK14NOnfsVGo7lYo5TYIEAf+Cjg9AZM1SHIIGW iIiA== 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:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=P37KQhavp2nKLwYJDgM7u8nX1Mwa9YCR5FbKABD/Dpk=; b=B3zLYBPgwBL8ynq8p4udDSNc9r15t1SWK1NX9zDGDSXPLNIaLxW6Y1A9NDBAiu/Y/2 LVYuB/JZk33Z6HAt+S7pVbg9YQxI8XCYJ5hJdHKhHDZFPeOj/5n/JgBWu0TXRV0JoCEE oEMP1+HfIp2dW1HXcPYgF2iHdnFunn62g9ABGuMie+GMozrG8fdiNE+QJyHvhjqxUMxz uMrFNve2CLdTqbb0yg2ySnAUpn/a7KNNpUCYQ4UIlybD7BK9MEUDvIGGQiDaAWjlqX4t WWax6CgJKXU5xZYL7jIzopAHewvu1gIigOUad30qJ8cpyQKzbfSDQTzvWPpGiWAuGitI BSjQ== X-Gm-Message-State: AOAM531cKnRpXTV0TAuX3ezTMtcMGotL78j0aGTy0wG4vWsRR0IJNJkr zaJt2EHETJ6h9WzruCiPZDSgMf6UW+Q= X-Google-Smtp-Source: ABdhPJyZCJVYsb6AdNr2/M3L/4TG0K7plT8MvlsPogzyjUZ9vo1gH3ImMKmIaDlS7HxUG863C7xlLA== X-Received: by 2002:a1c:6408:: with SMTP id y8mr5056401wmb.51.1603835904675; Tue, 27 Oct 2020 14:58:24 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id 4sm3699161wrp.58.2020.10.27.14.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 14:58:24 -0700 (PDT) From: zimoun To: Malte Frank Gerdes Subject: Re: usage of pypi-uri in the pypi importer In-Reply-To: <86mu07lhwx.fsf@gmail.com> References: <86r1pwu0ff.fsf@gmail.com> <861rhl57xg.fsf@gmail.com> <86mu07lhwx.fsf@gmail.com> Date: Tue, 27 Oct 2020 22:58:22 +0100 Message-ID: <86sg9z2uwx.fsf@gmail.com> 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::32c; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32c.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=qGLj4zjB; 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: -0.21 X-TUID: zks7KclNzGqg Dear, On Tue, 27 Oct 2020 at 18:04, Malte Frank Gerdes = wrote: >> (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 Yes. It happens all the time. I do not see what is the problem. You just have to do: (uri (pypi-uri "pyinstrument_cext" version)) For example, the upstream names of the CRAN or Bioconductor packages are a big mess and do not fit =E2=80=93at all=E2=80=93 the names in Guix. That= =E2=80=99s fine. Let take an example: (name "r-matrix-utils") [..]=20=20=20=20 (method url-fetch) (uri (cran-uri "Matrix.utils" version)) [..] (properties `((upstream-name . "Matrix.utils"))) And note the extra =E2=80=9Cupstream-name=E2=80=9D property eases stuff, e.= g., comment in the =E2=80=99r-build-system=E2=80=99: ;; R package names are case-sensitive and cannot be derived from t= he ;; Guix package name. The exact package name is required as an ;; argument to =E2=80=98tools::testInstalledPackage=E2=80=99, whic= h runs the tests ;; for a package given its name and the path to the =E2=80=9Clibra= ry=E2=80=9D (a ;; location for a collection of R packages) containing it. >> 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. It is not only about PyPI and pypy-uri. And maybe it is not the good example. Instead give a look at =E2=80=99cran-uri=E2=80=99 defined in =E2=80=99guix/build-system/r.scm=E2=80=99. It returns the list: mirror://cran/src/contrib/_.tar.gz mirror://cran/src/contrib/Archive/_.tar.gz and then =E2=80=99%mirrors=E2=80=99 in =E2=80=99guix/download.scm=E2=80=99 = provides how the mirrors are expanded: (cran ;; Arbitrary mirrors from http://cran.r-project.org/mirrors.html ;; This one automatically redirects to servers worldwide "http://cran.r-project.org/" "http://cran.rstudio.com/" "http://cran.univ-lyon1.fr/" "http://cran.ism.ac.jp/" "http://cran.stat.auckland.ac.nz/" "http://cran.mirror.ac.za/" "http://cran.csie.ntu.edu.tw/") using =E2=80=99maybe-expand-mirrors=E2=80=99 in =E2=80=99guix/build/downloa= d.scm=E2=80=99. Therefore, if the R project decides to change their API to: source/contribution/ARCHIVE/-.tar.bz2 then it is only one change about =E2=80=99cran-uri=E2=80=99 and not replace= all the URLs of all packages in =E2=80=99gnu/packages/cran.scm=E2=80=99. And idem = if mirrors are added or removed. The same logic is applied to PyPI even if the upstream source is only one URL with no mirror. :-) Hope that helps, simon