From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 oLkZBWrTPWZf9AAAqHPOHw:P1 (envelope-from ) for ; Fri, 10 May 2024 09:57:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id oLkZBWrTPWZf9AAAqHPOHw (envelope-from ) for ; Fri, 10 May 2024 09:57:30 +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=1715327850; 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=tmbRFYsRMsK5U0FgAO/zJan5MjrkPXqbb3N5YnJ9V+8=; b=P8uqHALzIf62ClKyZMwFPKkhYX2MX4LwN46eaTCyNSApAjwhbVzjMgjP/ZsFJoeSDQruMh V6THUEhh+LUqEwZrE0nWtde2vk2CitBiG6wAJFBzvJUFeW/2HymnvM+T64o7Og6Tz6rUAa AeOZxgYEeTJSGkwjClckTblP82bAw9Gw/MeatmMF4qGBHKa2Jup7uNYOnefwsvSUf6QCZ2 oagLxOTv4w8woRc29/GMI84Bb0hu6g409I5mzrQMpWzkSdolYw1xIFNJREHWKdGMMHkZv6 /DMJh6T05zqz7YC43/g1p7gz/4/fglqjcHR6gQtrycL9YAuz08ehWMe1N27POA== 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715327850; a=rsa-sha256; cv=none; b=YeAfssBPkuGn0zO/C+ToO4ZmTZTKY+43Mr5tXphgZBkP/Jin0DC+AvrHkOxDjbTfnJb4L5 TNoBDm5P9CThire6H/AqjVJC/E8kzT+Wgx3ht2lmk4LR5jqy/BzRzy4gUy5UkS3JW/p9Gn dlrUmexXFbWUimPkTVIBLHI3k78FoHNSHaOWyMNribRdzuDFKyiqfWl1+itSAwPnnMl3ju mccdQsuuJTfojYyAyk5n2H1DyDPhlpLuV8Y1EPqrVyasfcA2HwbhAt/P6WaW5VyaiQEkhh 2rd3+ltzrrEXgTKcVRIxiGL93cIRnt0gCqqHeb+p8cPNU+4AwzaQQ4m/v8WcKg== 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 D9E09110B7 for ; Fri, 10 May 2024 09:57:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5L87-0001um-Rs; Fri, 10 May 2024 03:57:25 -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 1s5L7o-0001sU-2k for guix-patches@gnu.org; Fri, 10 May 2024 03:57:04 -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 1s5L7n-0005TY-Pf for guix-patches@gnu.org; Fri, 10 May 2024 03:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5L7l-0000Sr-RS for guix-patches@gnu.org; Fri, 10 May 2024 03:57:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70858] [PATCH 01/32] guix: import: pypi: Ignore pypi-ignored-inputs. References: <20240510074844.2703-1-ngraves@ngraves.fr> In-Reply-To: <20240510074844.2703-1-ngraves@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 May 2024 07:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70858 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70858@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 70858-submit@debbugs.gnu.org id=B70858.17153277761465 (code B ref 70858); Fri, 10 May 2024 07:57:01 +0000 Received: (at 70858) by debbugs.gnu.org; 10 May 2024 07:56:16 +0000 Received: from localhost ([127.0.0.1]:41692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5L70-0000NP-6p for submit@debbugs.gnu.org; Fri, 10 May 2024 03:56:16 -0400 Received: from 4.mo575.mail-out.ovh.net ([46.105.59.63]:49381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5L6v-0000NB-Kz for 70858@debbugs.gnu.org; Fri, 10 May 2024 03:56:13 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.139.43]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4VbLmT1cqcz1TPN for <70858@debbugs.gnu.org>; Fri, 10 May 2024 07:56:09 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-fqktz (unknown [10.110.168.37]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id DBE911FE97; Fri, 10 May 2024 07:56:08 +0000 (UTC) Received: from ngraves.fr ([37.59.142.99]) by ghost-submission-6684bf9d7b-fqktz with ESMTPSA id pH3TMhjTPWbXNgAAuPPoMw (envelope-from ); Fri, 10 May 2024 07:56:08 +0000 X-OVh-ClientIp: 81.67.146.208 Date: Fri, 10 May 2024 09:55:05 +0200 Message-ID: <20240510075605.6303-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: 15211189217147806434 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdefjedgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeegtdekudeuveeuteegueevffetieegtefgjedtudetgeeigfeuueeftdeiveetgfenucffohhmrghinhepphihphhirdhorhhgnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrdelleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtkeehkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.88 X-Spam-Score: -6.88 X-Migadu-Queue-Id: D9E09110B7 X-Migadu-Scanner: mx13.migadu.com X-TUID: 75vq0VgirYd6 * 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 | 21 ++++++++++++++++++--- guix/lint.scm | 12 +++++++----- tests/pypi.scm | 3 ++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 6719fde330a..d4b70061e86 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,18 @@ (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 + "tox" ; test wrapper for other environments + "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 +438,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 68d532968de..f689cc2a2a8 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,12 @@ (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" + "pre-commit") + (map (cut string-append "python-" <>) + pypi-ignored-inputs)))) (map (lambda (input) (make-warning package diff --git a/tests/pypi.scm b/tests/pypi.scm index 42b39cde730..fe01ab3beb3 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