From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 10:51:36 2021 Received: (at 49168) by debbugs.gnu.org; 25 Jun 2021 14:51:36 +0000 Received: from localhost ([127.0.0.1]:46608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwnBA-0004jK-4b for submit@debbugs.gnu.org; Fri, 25 Jun 2021 10:51:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwnB8-0004j7-CV for 49168@debbugs.gnu.org; Fri, 25 Jun 2021 10:51:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48270) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwnB1-0004dC-LJ; Fri, 25 Jun 2021 10:51:27 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42476 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwnB1-00024A-DN; Fri, 25 Jun 2021 10:51:27 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#49168: =?utf-8?Q?=E2=80=98guix?= import =?utf-8?Q?pypi?= =?utf-8?Q?=E2=80=99?= misses package dependencies References: <877dim5psf.fsf@inria.fr> <992e746ed43c5ae7def7b35996ed44743fef85bf.camel@student.tugraz.at> <87eecu3wqh.fsf@inria.fr> <87mtrgyaxe.fsf@gnu.org> <7da007493c9bcea075a76dc01d6e85b457c5d4e3.camel@student.tugraz.at> <87a6nftwio.fsf@gnu.org> <87pmwbythg.fsf@gmail.com> Date: Fri, 25 Jun 2021 16:51:25 +0200 In-Reply-To: <87pmwbythg.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 24 Jun 2021 15:04:27 -0400") Message-ID: <87mtre2e1e.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49168 Cc: Leo Prikler , 49168@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: -3.3 (---) Hello, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> Why does the importer favor .whl in the first place? Is it supposed to >> be more accurate or more widespread or something? > > Yes, the METADATA file from the binary wheel is a better place to look > than the source egg-info requires.txt file. In my commit 01589acc5e1, I > simplified a comment that used used to read as: > > - ;; First, try to compute the requirements using the wheel, since that = is the > - ;; most reliable option. If a wheel is not provided for this package, = try > - ;; getting them by reading either the "requirements.txt" file or the > - ;; "requires.txt" from the egg-info directory from the source tarball.= Note > - ;; that "requirements.txt" is not mandatory, so this is likely to fail. > + ;; First, try to compute the requirements using the wheel, else, fallb= ack to > + ;; reading the "requires.txt" from the egg-info directory from the sou= rce > + ;; tarball. > > The wheel (.whl) binary format is well specified as PEP 427 [0] and is > what pip primarily uses for installing Python packages, making it a very > reliable source of metadata. The Python egg is the predecessor of the > wheel, and can be considered obsolete, which explains why it's used as a > fallback. Oh, I see. > Perhaps it'd be best to raise the issue to the package maintainers and > have them specify their metadata correctly? Going back to the example at the beginning of this thread, what =E2=80=98gu= ix import pypi tablib=E2=80=99 produces is missing =E2=80=98python-setuptools-= scm=E2=80=99. Indeed, =E2=80=98METADATA=E2=80=99 doesn=E2=80=99t mention it. Is it really a bug on their side, or is it something peculiar about Guix packaging? Perhaps =E2=80=98python-setuptools-scm=E2=80=99 should be provi= ded more or less by default? > Having the code you wrote to allow importing optional dependencies is > still a nice (optional) option to have though. It was originally left > out based on comments from Ricardo that it wouldn't make a good default > due to raising the packaging effort. OK. Looking at , the =E2=80=98METADATA=E2=80=99 format apparently doesn=E2=80=99t support option= al dependencies anyway (which makes sense, because Wheels are a binary format), so perhaps that idea was misguided. (However =E2=80=98METADATA=E2=80=99 defines =E2=80=98Requires-External=E2= =80=99, which the importer could usefully interpret!) WDYT? Ludo=E2=80=99.