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 ms0.migadu.com with LMTPS id yPF8KHfX1GDZOgAAgWs5BA (envelope-from ) for ; Thu, 24 Jun 2021 21:05:27 +0200 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 yIo9JHfX1GDERgAA1q6Kng (envelope-from ) for ; Thu, 24 Jun 2021 19:05:27 +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 D458011754 for ; Thu, 24 Jun 2021 21:05:26 +0200 (CEST) Received: from localhost ([::1]:47102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwUfE-0003LO-Q1 for larch@yhetil.org; Thu, 24 Jun 2021 15:05:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwUes-0003LD-8q for bug-guix@gnu.org; Thu, 24 Jun 2021 15:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwUes-0003CF-0S for bug-guix@gnu.org; Thu, 24 Jun 2021 15:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwUer-0001PB-Sg for bug-guix@gnu.org; Thu, 24 Jun 2021 15:05:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#49168: =?UTF-8?Q?=E2=80=98guix?= import =?UTF-8?Q?pypi=E2=80=99?= misses package dependencies Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 24 Jun 2021 19:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49168 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 49168-submit@debbugs.gnu.org id=B49168.16245614785360 (code B ref 49168); Thu, 24 Jun 2021 19:05:01 +0000 Received: (at 49168) by debbugs.gnu.org; 24 Jun 2021 19:04:38 +0000 Received: from localhost ([127.0.0.1]:44162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwUeU-0001OO-8m for submit@debbugs.gnu.org; Thu, 24 Jun 2021 15:04:38 -0400 Received: from mail-qv1-f53.google.com ([209.85.219.53]:35817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwUeQ-0001O3-ON for 49168@debbugs.gnu.org; Thu, 24 Jun 2021 15:04:37 -0400 Received: by mail-qv1-f53.google.com with SMTP id h10so3888539qvz.2 for <49168@debbugs.gnu.org>; Thu, 24 Jun 2021 12:04:34 -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=2uTRxXA8p4721oJhD0Kmg2DGFv8zc1b3tACIBi7CGtc=; b=owHYIZijtEopAcZgWX3l9W7cBFyM7OJ5u3/YmbndXF5tF5PgWQVMViBZvqXWLQ46oq pIwEcvsxK/41PyR1wTKqgFnmsYGICTG27OTEl2Pz6CcNQTjUD9RiJIoqyc6NLwg+z465 lR54aq8ZeFcACPtXeOabgB3bMWZgydEhkFojzVMdFqCbVDugN7yltQYXpTWHzk7Z9w6L FPoIGEEriSjSVeJAkC6QxWIdypLkuIqSM/IEbH13OcSXeBIgQpeoXBH0xf8JdX31Ja5P UceY/eKWzVdr7qIHpr73lKvx0Bm6MZ+B08s11MMepp/dPZf1CIrpiYbXHyh2XZ8RJJEJ jGVQ== 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=2uTRxXA8p4721oJhD0Kmg2DGFv8zc1b3tACIBi7CGtc=; b=DFVl3C0tMVUgUW/sySGibH0uy/iiTPvGbRbmabc4qB/rGh/nZo8tpEyoPgwNmMpbsy qv1fYH9BV3doHhLQ5Hi+CSq1nx5Cf/I32w+LxTNwKOsjq9EEf1cn4HnqAiFkvAFeQ3E9 qC2v4Szw5T5AVhtFZOiLGtKm+PCAEk7/qMD4VrpVF0n/DokpcVAkDiOz76qTjVu7Qfv+ hEFLXVvjbBcMkq26wY3Y2z+iNX163TEzlNZK3k9C24FWGzT2jNnx9wWiRdetKpKNH+m0 ITiHl6ZatRVSWinuH9aCOeR3M0axN3+89VboPEAVdvfEgUcsxD90AsCyUdI217Z32/yi oDTQ== X-Gm-Message-State: AOAM532br/Hr3GN1Jq5eckglKVjOmLzwSv++jf4Dr4kcXx4GaXNPVv/O 2NZbD61cMb6spPl0MfxDKomgZgFiH/WgyA== X-Google-Smtp-Source: ABdhPJxpBaEzembAgviG+vewg3CJdupbLu+aK2kn1OjBYjOCQSyYQ+6DMd+KxcvWGT3/fULWgPaO+g== X-Received: by 2002:a0c:ef8b:: with SMTP id w11mr7038655qvr.37.1624561469066; Thu, 24 Jun 2021 12:04:29 -0700 (PDT) Received: from hurd ([207.35.95.2]) by smtp.gmail.com with ESMTPSA id d124sm3125413qkf.54.2021.06.24.12.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 12:04:28 -0700 (PDT) From: Maxim Cournoyer 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> Date: Thu, 24 Jun 2021 15:04:27 -0400 In-Reply-To: <87a6nftwio.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 24 Jun 2021 11:57:51 +0200") Message-ID: <87pmwbythg.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Prikler , 49168@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624561527; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2uTRxXA8p4721oJhD0Kmg2DGFv8zc1b3tACIBi7CGtc=; b=sMyfoU2TQHS3FPhu2Rm0ySQHDpUzX3vabUQ8Iq/JWIIMNPMog6Xl85tN+qarbNwSicPrM2 GSgfhACJ15CBNjsUOuhkqxhOT71sTFIVLj5Z26vkWOScXb7ydE95M6y+xVPRwA0AIWQ55A 74pIKkqm5a75tGZQCA4atKkgTBhJ8VwONUAGZTZOXXq7L+JIiAwzyM5kUJAM7NkMSMSoAl usoMA6tyjGfcEGXnp2nSvQ/f1m2hH3Llz17MexIItMrcSYlPMkfq018NfBH4JJ8yeMi65/ a1t2mxzN+mEy7ghroLP32JRBlSkOY7RxoT+v7dCgv6J+nxUAHEwzeXdfBuJLAQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624561527; a=rsa-sha256; cv=none; b=RSKZSBHopoKlaNex34IULlcFk8l1bEWlvWmLuLLVyGuNLmWbRFklAhfprG2vWCvhj7eUIk zxgbwgu2E7vHrHWqp7i5sNbUlbaRq+9HidmcQLpsB4UOTYo8Jy2IPgoj8z288JAav3Yh7z 4nRFXSr+kT376MeyH8KQ+DDu0/e+tPmKezfj5AtP9FG1RzA1zdqbSa5ct0WePyWIoYWwCi 4dYRqxvPZN5VYlZFgPD8TU7oh+d5f+pnT2Kut3Ervkqp6Mnw9zyZQwpZmjVtKHSo9jMybC zWhk2WbKiScTZ5zkH7tpas9dWRLYNlldwLI786gqcsgx56E2l34cCsFAcWiVew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=owHYIZij; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=owHYIZij; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: D458011754 X-Spam-Score: -1.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: i+mySGSXI+nf Hi, Ludovic Court=C3=A8s writes: [...] > So I came up with the following patch, which adds a flag for optional > dependencies, based on =E2=80=98requires.txt=E2=80=99. > > Unfortunately, it has no effect for =E2=80=98guix import pypi tablib=E2= =80=99 because we > only look at Wheel info in that case, as per: > > ;; First, try to compute the requirements using the wheel, else, fallba= ck to > ;; reading the "requires.txt" from the egg-info directory from the sour= ce > ;; archive. > (or (guess-requirements-from-wheel) > (guess-requirements-from-source)) > > AFAICS, wheels don=E2=80=99t provide that info, do they? > > 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. N= ote - ;; that "requirements.txt" is not mandatory, so this is likely to fail. + ;; First, try to compute the requirements using the wheel, else, fallbac= k to + ;; reading the "requires.txt" from the egg-info directory from the source + ;; 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. Perhaps it'd be best to raise the issue to the package maintainers and have them specify their metadata correctly? 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. HTH, Maxim [0] https://www.python.org/dev/peps/pep-0427/