all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 70858@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#70858] [PATCH 01/32] guix: import: pypi: Ignore pypi-ignored-inputs.
Date: Fri, 10 May 2024 09:55:05 +0200	[thread overview]
Message-ID: <20240510075605.6303-1-ngraves@ngraves.fr> (raw)
In-Reply-To: <20240510074844.2703-1-ngraves@ngraves.fr>

* 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 <vivien@planete-kraus.eu>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; 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 <upstream-input> 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





  reply	other threads:[~2024-05-10  7:57 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  7:26 [bug#70858] [PATCH 00/32] python-team: Remove native inputs Nicolas Graves via Guix-patches via
2024-05-10  7:55 ` Nicolas Graves via Guix-patches via [this message]
2024-05-10  7:55   ` [bug#70858] [PATCH 02/32] build-system/pyproject: Ignore unwanted pytest flags Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 03/32] build-system/pyproject: Remove python-black input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 04/32] build-system/pyproject: Remove python-pylint native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 05/32] build-system/pyproject: Remove python-flake8 inputs Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 06/32] build-system/pyproject: Remove python-coverage input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 07/32] gnu: python-cram: Remove python-coverage native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 08/32] gnu: u-boot-tools: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 09/32] gnu: python-aiosqlite: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 10/32] gnu: python-openid: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 11/32] build-system/pyproject: Remove python-coveralls native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 12/32] build-system/pyproject: Remove python-pycodestyle native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 13/32] gnu: python-versioneer: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 14/32] gnu: python-versioneer: Remove python-pyflakes native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 15/32] gnu: python-re-assert: Remove python-covdefaults native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 16/32] build-system/pyproject: Remove python-codecov native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 17/32] build-system/pyproject: Remove python-tox native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 18/32] build-system/pyproject: Remove python-mypy native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 19/32] gnu: python-immutables: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 20/32] build-system/pyproject: Remove python-isort native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 21/32] build-system/pyproject: Remove python-twine native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 22/32] build-system/pyproject: Remove python-pytest-cov native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 23/32] gnu: python-tinycss2: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 24/32] gnu: python-django-contact-form: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 25/32] gnu: python-dateutil: " Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 26/32] build-system/pyproject: Remove python-pytest-isort native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 27/32] build-system/pyproject: Remove python-pytest-black native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 28/32] build-system/pyproject: Remove python-pytest-flake8 native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 29/32] build-system/pyproject: Remove python-pytest-mypy inputs Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 30/32] build-system/pyproject: Stop hiding options Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 31/32] gnu: python-linear-operator: Remove python-flake8-print native-input Nicolas Graves via Guix-patches via
2024-05-10  7:55   ` [bug#70858] [PATCH 32/32] gnu: abjad-ext-ipython: Remove uneeded inputs Nicolas Graves via Guix-patches via
2024-06-01 15:36 ` [bug#70858] [PATCH python-team v2 00/32] Remove unwanted native-inputs Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 01/32] guix: import: pypi: Ignore pypi-ignored-inputs Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 02/32] build-system/pyproject: Ignore unwanted pytest flags Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 03/32] build-system/pyproject: Remove python-black input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 04/32] build-system/pyproject: Remove python-pylint native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 05/32] build-system/pyproject: Remove python-flake8 inputs Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 06/32] build-system/pyproject: Remove python-coverage input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 07/32] gnu: python-cram: Remove python-coverage native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 08/32] gnu: u-boot-tools: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 09/32] gnu: python-aiosqlite: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 10/32] gnu: python-openid: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 11/32] build-system/pyproject: Remove python-coveralls native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 12/32] build-system/pyproject: Remove python-pycodestyle native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 13/32] gnu: python-versioneer: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 14/32] gnu: python-versioneer: Remove python-pyflakes native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 15/32] gnu: python-re-assert: Remove python-covdefaults native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 16/32] build-system/pyproject: Remove python-codecov native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 17/32] build-system/pyproject: Remove python-tox native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 18/32] build-system/pyproject: Remove python-mypy native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 19/32] gnu: python-immutables: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 20/32] build-system/pyproject: Remove python-isort native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 21/32] build-system/pyproject: Remove python-twine native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 22/32] build-system/pyproject: Remove python-pytest-cov native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 23/32] gnu: python-tinycss2: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 24/32] gnu: python-django-contact-form: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 25/32] gnu: python-dateutil: " Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 26/32] build-system/pyproject: Remove python-pytest-isort native-input Nicolas Graves via Guix-patches via
2024-06-01 15:36   ` [bug#70858] [PATCH python-team v2 27/32] build-system/pyproject: Remove python-pytest-black native-input Nicolas Graves via Guix-patches via
2024-06-01 15:37   ` [bug#70858] [PATCH python-team v2 28/32] build-system/pyproject: Remove python-pytest-flake8 native-input Nicolas Graves via Guix-patches via
2024-06-01 15:37   ` [bug#70858] [PATCH python-team v2 29/32] build-system/pyproject: Remove python-pytest-mypy inputs Nicolas Graves via Guix-patches via
2024-06-01 15:37   ` [bug#70858] [PATCH python-team v2 30/32] build-system/pyproject: Stop hiding options Nicolas Graves via Guix-patches via
2024-06-01 15:37   ` [bug#70858] [PATCH python-team v2 31/32] gnu: python-linear-operator: Remove python-flake8-print native-input Nicolas Graves via Guix-patches via
2024-06-01 15:37   ` [bug#70858] [PATCH python-team v2 32/32] gnu: abjad-ext-ipython: Remove uneeded inputs Nicolas Graves via Guix-patches via
2024-06-05 16:53   ` [bug#70858] [PATCH python-team v2 00/32] Remove unwanted native-inputs Nicolas Graves via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240510075605.6303-1-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=70858@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.