From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id QGELJk5+KmZyRQEAe85BDQ:P1 (envelope-from ) for ; Thu, 25 Apr 2024 18:01:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id QGELJk5+KmZyRQEAe85BDQ (envelope-from ) for ; Thu, 25 Apr 2024 18:01:18 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714060878; h=from:from:sender:sender:reply-to: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; bh=AapB6lxpvYEBnGeBWIur1MYJCMSyrCN2N0/QxxBAT+c=; b=df0jO71R2dC1WJdXlExZlC9EFJ9oaA7lJL2K4UUOw3SELET61V0cbDBVMLg1z+PrY13Yi+ ZjbwFppfaq9ihI9z8RFiuIX5CZyK/76YXhtLt+KYVcZDnw7fdUWKXZeWca6o4X4npUIm9M D/0L91vCoF02gf2HD9Ww5xMVh/Okyl82fZffJkSErSCDNPLQ/0WCzaR4SOlNHqA6Dt6Kq6 c+jWZLfmvyg/QwSm1frUiTj9nFKdNvHzGDFussAXOPMbQIKvtSE3/Ln51/45kFQcGlic2O uDVCbN/G5q0Lhb9cgO+jgmhHcb6V9ApSAMxDj0MCZn2Q/g/Eg80140JCQ8UXMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714060878; a=rsa-sha256; cv=none; b=rxSwOa2qFGaBLQMZAYoh/+mvSm6p1RuqdddtjUuIKNi3nuXm3OqH2nO2taWYgRRlUmcYmj /KiS+6in7in6aYuM57BYKScRKtxTHHITbgffUEe6tM68xhCKjzZeNJ501mdO+c0qmuuhIB s9C3xGNSvMczQrHbeXgD3QNn44wE5b3ksYOgELmjVhxcogxt/1uIv74LMO7li0OQBx809K +7Hb0BK2/PEf9LObQ+lna9s1FaFALYjtGq7M16K1GYq/e0U22mIt/eYIvFk+gjFYQDihqV MUinDkOuysMUuY4b8Gy4UcQVm1MPPzGv/uu/WqGg0oc1LpLZzhQk+FEPbTUo3g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org 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 3C7C510177 for ; Thu, 25 Apr 2024 18:01:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s01Wk-0002E2-Tf; Thu, 25 Apr 2024 12:00:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s01Wi-0002D2-Bl for guix-patches@gnu.org; Thu, 25 Apr 2024 12:00:48 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s01Wi-0003mL-2S for guix-patches@gnu.org; Thu, 25 Apr 2024 12:00:48 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s01Wz-0007ct-Mg for guix-patches@gnu.org; Thu, 25 Apr 2024 12:01:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70570] [PATCH 1/2] guix: import: pypi: Ignore pypi-ignored-inputs. References: <20240425155529.30747-1-ngraves@ngraves.fr> In-Reply-To: <20240425155529.30747-1-ngraves@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Apr 2024 16:01:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70570 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70570@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 70570-submit@debbugs.gnu.org id=B70570.171406084729094 (code B ref 70570); Thu, 25 Apr 2024 16:01:05 +0000 Received: (at 70570) by debbugs.gnu.org; 25 Apr 2024 16:00:47 +0000 Received: from localhost ([127.0.0.1]:33138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s01Wb-0007Y9-HC for submit@debbugs.gnu.org; Thu, 25 Apr 2024 12:00:46 -0400 Received: from 5.mo560.mail-out.ovh.net ([87.98.181.248]:41125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s01WV-0007WV-BU for 70570@debbugs.gnu.org; Thu, 25 Apr 2024 12:00:39 -0400 Received: from director5.ghost.mail-out.ovh.net (unknown [10.109.139.129]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4VQLCz06RDz1Zs5 for <70570@debbugs.gnu.org>; Thu, 25 Apr 2024 16:00:14 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-vpbkv (unknown [10.110.96.9]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 90BBB1FE5E; Thu, 25 Apr 2024 16:00:14 +0000 (UTC) Received: from ngraves.fr ([37.59.142.109]) by ghost-submission-6684bf9d7b-vpbkv with ESMTPSA id SVMnHA5+KmYuIAEABnI3AA (envelope-from ); Thu, 25 Apr 2024 16:00:14 +0000 X-OVh-ClientIp: 80.215.5.23 Date: Thu, 25 Apr 2024 17:59:45 +0200 Message-ID: <20240425160010.6243-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 9083197499245978338 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeljedgleeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeegtdekudeuveeuteegueevffetieegtefgjedtudetgeeigfeuueeftdeiveetgfenucffohhmrghinhepphihphhirdhorhhgnecukfhppeduvdejrddtrddtrddupdektddrvdduhedrhedrvdefpdefjedrheelrddugedvrddutdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdehjedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.89 X-Spam-Score: -6.89 X-Migadu-Queue-Id: 3C7C510177 X-Migadu-Scanner: mx13.migadu.com X-TUID: bbAJUia8thkw * guix/import/pypi.scm (pypi-ignored-inputs): New variable. (compute-inputs): Use it. * tests/pypi.scm (parse-requires.txt): Add ignored input to test the feature. * guix/lint.scm (check-inputs-should-be-native): Adapt list. (check-inputs-should-not-be-an-input-at-all): Use pypi-ignored-list. Change-Id: I774e526c5a090026e778ee44049637174a1dca95 --- guix/import/pypi.scm | 20 +++++++++++++++++--- guix/lint.scm | 11 ++++++----- tests/pypi.scm | 3 ++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 6719fde330..a43d4eca1d 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2022 Vivien Kraus ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -61,6 +62,7 @@ (define-module (guix import pypi) #:use-module (guix upstream) #:use-module ((guix licenses) #:prefix license:) #:export (%pypi-base-url + pypi-ignored-inputs parse-requires.txt parse-wheel-metadata specification->requirement-name @@ -77,6 +79,17 @@ (define %pypi-base-url ;; Base URL of the PyPI API. (make-parameter "https://pypi.org/pypi/")) +(define pypi-ignored-inputs + ;; This list contains packages that are useful for development or quality + ;; testing, but that most of the time are not necessary to have as an input. + (list "argparse" ; native + "codecov" "coverage" ; coverage + "black" "isort" "pycodestyle" "pep8" ; style + "pyflakes" "flake8" "pylint" "mypy" ; style+lint + "coveralls" "twine" ; upload integration tools + "pytest-isort" "pytest-flake8" "pytest-cov" "pytest-black" + "pytest-pep8" "pytest-mypy" "pytest-pep8" "pre-commit")) ; variants + (define non-empty-string-or-false (match-lambda ("" #f) @@ -424,9 +437,10 @@ (define (compute-inputs source-url wheel-url archive) "Given the SOURCE-URL and WHEEL-URL of an already downloaded ARCHIVE, return the corresponding list of records." (define (requirements->upstream-inputs deps type) - (filter-map (match-lambda - ("argparse" #f) - (name (upstream-input + (filter-map (lambda (name) + (if (member name pypi-ignored-inputs) + #f + (upstream-input (name name) (downstream-name (python->package-name name)) (type type)))) diff --git a/guix/lint.scm b/guix/lint.scm index 68d532968d..9867b71cfd 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -71,6 +71,7 @@ (define-module (guix lint) hg-reference-url) #:autoload (guix bzr-download) (bzr-reference? bzr-reference-url) + #:use-module ((guix import pypi) #:select (pypi-ignored-inputs)) #:use-module (guix import stackage) #:use-module (ice-9 match) #:use-module (ice-9 regex) @@ -557,14 +558,12 @@ (define (check-inputs-should-be-native package) "m4" "qttools-5" "yasm" "nasm" "fasm" - "python-coverage" "python-cython" "python-docutils" "python-mock" "python-nose" "python-pbr" "python-pytest" - "python-pytest-cov" "python-setuptools-scm" "python-sphinx" "scdoc" @@ -586,9 +585,11 @@ (define (check-inputs-should-be-native package) (define (check-inputs-should-not-be-an-input-at-all package) ;; Emit a warning if some inputs of PACKAGE are likely to should not be ;; an input at all. - (let ((input-names '("python-setuptools" - "python-pip" - "python-pre-commit"))) + (let ((input-names (append + '("python-setuptools" + "python-pip" + "python-pre-commit") + pypi-ignored-inputs))) (map (lambda (input) (make-warning package diff --git a/tests/pypi.scm b/tests/pypi.scm index 42b39cde73..fe01ab3beb 100644 --- a/tests/pypi.scm +++ b/tests/pypi.scm @@ -97,6 +97,7 @@ (define test-requires.txt "\ [test] pytest (>=2.5.0) +pytest-cov # read but ignored ") ;; Beaker contains only optional dependencies. @@ -244,7 +245,7 @@ (define-syntax-rule (with-pypi responses body ...) (map specification->requirement-name test-specifications)) (test-equal "parse-requires.txt" - (list '("foo" "bar") '("pytest")) + (list '("foo" "bar") '("pytest" "pytest-cov")) (mock ((ice-9 ports) call-with-input-file call-with-input-string) (parse-requires.txt test-requires.txt))) -- 2.41.0