Nicolas Graves <ngraves@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 28 Apr 2024 10:15:09 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 06:15:09 2024 Received: from localhost ([127.0.0.1]:50127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s11Yq-0004l9-Or for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:15:09 -0400 Received: from 7.mo576.mail-out.ovh.net ([46.105.50.32]:44221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s11Yn-0004l1-5i for 70570 <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:15:08 -0400 Received: from director3.ghost.mail-out.ovh.net (unknown [10.109.139.40]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 4VS2Pv646Wz1ks5 for <70570 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 10:14:43 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-gnph6 (unknown [10.110.168.164]) by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 7F3DB1FE93 for <70570 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 10:14:43 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-gnph6 with ESMTPSA id MarBGpMhLmZ6BgAA1cFsrQ (envelope-from <ngraves@HIDDEN>) for <70570 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 10:14:43 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S004cd389511-621d-4497-85ec-22742fe5fad7, 69145B9711B3A70C035495E6C4924E0A13B99C87) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70570 <at> debbugs.gnu.org Subject: Re: [PATCH v2 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags. In-Reply-To: <20240427165504.8843-2-ngraves@HIDDEN> References: <20240427165504.8843-1-ngraves@HIDDEN> <20240427165504.8843-2-ngraves@HIDDEN> Date: Sun, 28 Apr 2024 12:14:42 +0200 Message-ID: <874jblvlnx.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 2419277427244786258 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvddtgedghedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeijeeukeekffevuedvhfefvdegheegiedtfefffeeltdefudduudelkeejheetudenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtheejtdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70570 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2024-04-27 18:54, Nicolas Graves wrote: > * guix/build/pyproject-build-system.scm : Ignore unwanted pytest flags. > > Change-Id: Ib9f1602e5af11227e5b7ce124f0f9be4fa2b78e4 > --- > guix/build/pyproject-build-system.scm | 91 ++++++++++++++++++++++++++- > 1 file changed, 89 insertions(+), 2 deletions(-) > > diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject= -build-system.scm > index 947d240114..ebe4e1941d 100644 > --- a/guix/build/pyproject-build-system.scm > +++ b/guix/build/pyproject-build-system.scm > @@ -1,6 +1,7 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2021 Lars-Dominik Braun <lars@HIDDEN> > ;;; Copyright =C2=A9 2022 Marius Bakke <marius@HIDDEN> > +;;; Copyright =C2=A9 2024 Nicolas Graves <ngraves@HIDDEN> > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -142,7 +143,89 @@ (define* (build #:key outputs build-backend backend-= path configure-flags #:allow > wheel-dir > config-settings))) >=20=20 > -(define* (check #:key tests? test-backend test-flags #:allow-other-keys) > +(define pytest-default-ignore-alist > + '(("cov" . ("--cov" "--cov-reset" "--cov-report" "--cov-config" > + "--no-cov-on-fail" "--no-cov" "--cov-fail-under" > + "--cov-append" "--cov-branch" "--cov-context")) > + ("mypy" . ("--mypy" "--mypy-config-file" "--mypy-ignore-missing-impo= rts")) > + ("isort" . ("--isort")) > + ("flake8" . ("--flake8")) > + ("black" . ("--black")) > + ("flakes" . ("--flakes")) > + ("pep8" . ("--pep8")))) > + > +(define (pytest-ignore-flags-plugin flags) > + "This function converts an list of flags into a string that can > + be instantiated as a python pytest plugin." > + (format #f "\ > +import pytest > + > +def pytest_addoption(parser): > + group =3D parser.getgroup('guix','Guix ignored options') > + options =3D [~{~s, ~}] > + for option in options: > + group.addoption(option, action=3D'append', nargs=3D'?')" > + flags)) > + > +(define (call-with-guix-pytest-plugin inputs thunk) > + "This function emulates command line options provided by pytest plugin= s in > +the absence of the plugins defining these options. > + > +This is done by selecting absent plugins, gettings their flags defined in > +PYTEST-DEFAULT-IGNORE-ALIST, and generating the plugin from there with > +PYTEST-IGNORE-FLAGS-PLUGIN." > + (let* ((former-path (getenv "PYTHONPATH")) > + (input-names > + (filter (match-lambda > + (((name . _) ...) > + (if (string-prefix? "python-pytest-" name) > + name > + #f)) > + ( _ #f)) > + inputs)) This filter is not working properly as it doesn't output names but pairs. Will be changed in the next revision with a map car. > + (filtered-flags > + (filter identity > + (append-map > + (match-lambda > + ((group . flags) > + (if (member (string-append "python-pytest-" group) > + input-names) > + (list #f) > + flags)) > + (_ (list #f))) > + pytest-default-ignore-alist)))) > + (dynamic-wind > + (lambda () > + (setenv "PYTHONPATH" > + (string-append > + (if former-path > + (string-append former-path ":") > + "") > + ".guix-pytest")) I found that in some edge cases, a hidden directory in the current dir can cause tests to fail. It only happened for one package which was failing on the __init__.py from .guix-pytest, meaning that tests could consider this directory. So it's better to put that out-of-source in ../.guix-pytest. Will be done in the next revision. > + (setenv "PYTEST_PLUGINS" > + (string-append > + (if (getenv "PYTEST_PLUGINS") > + (string-append former-path ",") > + "") > + "pytest_guix_plugin")) > + (mkdir-p ".guix-pytest") > + (with-output-to-file ".guix-pytest/__init__.py" > + (lambda _ (display ""))) > + (with-output-to-file ".guix-pytest/pytest_guix_plugin.py" > + (lambda _ > + (display (pytest-ignore-flags-plugin filtered-flags))))) > + thunk > + (lambda () > + (setenv "PYTHONPATH" former-path) > + (unsetenv "PYTEST_PLUGINS") > + (when (file-exists? ".guix-pytest") > + (delete-file-recursively ".guix-pytest")))))) > + > +(define-syntax-rule (with-guix-pytest-plugin inputs exp ...) > + "Evaluate EXP in a context where the Guix pytest plugin is added." > + (call-with-guix-pytest-plugin inputs (lambda () exp ...))) > + > +(define* (check #:key inputs tests? test-backend test-flags #:allow-othe= r-keys) > "Run the test suite of a given Python package." > (if tests? > ;; Unfortunately with PEP 517 there is no common method to specify= test > @@ -165,7 +248,8 @@ (define* (check #:key tests? test-backend test-flags = #:allow-other-keys) > (format #t "Using ~a~%" use-test-backend) > (match use-test-backend > ('pytest > - (apply invoke pytest "-vv" test-flags)) > + (with-guix-pytest-plugin inputs > + (apply invoke pytest "-vv" test-flags))) > ('nose > (apply invoke nosetests "-v" test-flags)) > ('nose2 > @@ -386,3 +470,6 @@ (define* (pyproject-build #:key inputs (phases %stand= ard-phases) > (apply python:python-build #:inputs inputs #:phases phases args)) >=20=20 > ;;; pyproject-build-system.scm ends here > +;;; Local Variables: > +;;; eval: (put 'with-guix-pytest-plugin 'scheme-indent-function 1) > +;;; End: --=20 Best regards, Nicolas Graves
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 27 Apr 2024 16:55:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 12:55:32 2024 Received: from localhost ([127.0.0.1]:49582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0lKl-0000cj-7I for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:55:31 -0400 Received: from 17.mo584.mail-out.ovh.net ([46.105.41.16]:54531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s0lKi-0000cU-Nj for 70570 <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:55:29 -0400 Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.25.12]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4VRbLN3Vdqz1JQ9 for <70570 <at> debbugs.gnu.org>; Sat, 27 Apr 2024 16:55:08 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-7r8zz (unknown [10.111.174.145]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 378071FD79; Sat, 27 Apr 2024 16:55:08 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-7r8zz with ESMTPSA id JMHFA+wtLWbhSwEAww0/Lg (envelope-from <ngraves@HIDDEN>); Sat, 27 Apr 2024 16:55:08 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G0041ee1e413-50e6-4903-b0b4-d8a84a73cd64, A35C6C2D854BD2823198681D90DB7DB46B6540F1) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70570 <at> debbugs.gnu.org Subject: [PATCH v2 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags. Date: Sat, 27 Apr 2024 18:54:53 +0200 Message-ID: <20240427165504.8843-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240427165504.8843-1-ngraves@HIDDEN> References: <20240427165504.8843-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3309019830495339234 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvddtuddguddtiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdelleegfeefteelkeeugedvhfetvdeuffeihfektdeljeekudevlefgudefudelnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdehjedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeegpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/build/pyproject-build-system.scm : Ignore unwanted pytest flags. Change-Id: Ib9f1602e5af11227e5b7ce124f0f9be4fa2b78e4 --- guix/build/pyproject-build-system.scm | 91 ++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index 947d240114..ebe4e1941d 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Lars-Dominik Braun <lars@HIDDEN> ;;; Copyright © 2022 Marius Bakke <marius@HIDDEN> +;;; Copyright © 2024 Nicolas Graves <ngraves@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -142,7 +143,89 @@ (define* (build #:key outputs build-backend backend-path configure-flags #:allow wheel-dir config-settings))) -(define* (check #:key tests? test-backend test-flags #:allow-other-keys) +(define pytest-default-ignore-alist + '(("cov" . ("--cov" "--cov-reset" "--cov-report" "--cov-config" + "--no-cov-on-fail" "--no-cov" "--cov-fail-under" + "--cov-append" "--cov-branch" "--cov-context")) + ("mypy" . ("--mypy" "--mypy-config-file" "--mypy-ignore-missing-imports")) + ("isort" . ("--isort")) + ("flake8" . ("--flake8")) + ("black" . ("--black")) + ("flakes" . ("--flakes")) + ("pep8" . ("--pep8")))) + +(define (pytest-ignore-flags-plugin flags) + "This function converts an list of flags into a string that can + be instantiated as a python pytest plugin." + (format #f "\ +import pytest + +def pytest_addoption(parser): + group = parser.getgroup('guix','Guix ignored options') + options = [~{~s, ~}] + for option in options: + group.addoption(option, action='append', nargs='?')" + flags)) + +(define (call-with-guix-pytest-plugin inputs thunk) + "This function emulates command line options provided by pytest plugins in +the absence of the plugins defining these options. + +This is done by selecting absent plugins, gettings their flags defined in +PYTEST-DEFAULT-IGNORE-ALIST, and generating the plugin from there with +PYTEST-IGNORE-FLAGS-PLUGIN." + (let* ((former-path (getenv "PYTHONPATH")) + (input-names + (filter (match-lambda + (((name . _) ...) + (if (string-prefix? "python-pytest-" name) + name + #f)) + ( _ #f)) + inputs)) + (filtered-flags + (filter identity + (append-map + (match-lambda + ((group . flags) + (if (member (string-append "python-pytest-" group) + input-names) + (list #f) + flags)) + (_ (list #f))) + pytest-default-ignore-alist)))) + (dynamic-wind + (lambda () + (setenv "PYTHONPATH" + (string-append + (if former-path + (string-append former-path ":") + "") + ".guix-pytest")) + (setenv "PYTEST_PLUGINS" + (string-append + (if (getenv "PYTEST_PLUGINS") + (string-append former-path ",") + "") + "pytest_guix_plugin")) + (mkdir-p ".guix-pytest") + (with-output-to-file ".guix-pytest/__init__.py" + (lambda _ (display ""))) + (with-output-to-file ".guix-pytest/pytest_guix_plugin.py" + (lambda _ + (display (pytest-ignore-flags-plugin filtered-flags))))) + thunk + (lambda () + (setenv "PYTHONPATH" former-path) + (unsetenv "PYTEST_PLUGINS") + (when (file-exists? ".guix-pytest") + (delete-file-recursively ".guix-pytest")))))) + +(define-syntax-rule (with-guix-pytest-plugin inputs exp ...) + "Evaluate EXP in a context where the Guix pytest plugin is added." + (call-with-guix-pytest-plugin inputs (lambda () exp ...))) + +(define* (check #:key inputs tests? test-backend test-flags #:allow-other-keys) "Run the test suite of a given Python package." (if tests? ;; Unfortunately with PEP 517 there is no common method to specify test @@ -165,7 +248,8 @@ (define* (check #:key tests? test-backend test-flags #:allow-other-keys) (format #t "Using ~a~%" use-test-backend) (match use-test-backend ('pytest - (apply invoke pytest "-vv" test-flags)) + (with-guix-pytest-plugin inputs + (apply invoke pytest "-vv" test-flags))) ('nose (apply invoke nosetests "-v" test-flags)) ('nose2 @@ -386,3 +470,6 @@ (define* (pyproject-build #:key inputs (phases %standard-phases) (apply python:python-build #:inputs inputs #:phases phases args)) ;;; pyproject-build-system.scm ends here +;;; Local Variables: +;;; eval: (put 'with-guix-pytest-plugin 'scheme-indent-function 1) +;;; End: -- 2.41.0
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 27 Apr 2024 16:55:31 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 12:55:31 2024 Received: from localhost ([127.0.0.1]:49579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0lKk-0000cf-Kv for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:55:31 -0400 Received: from 9.mo576.mail-out.ovh.net ([46.105.56.78]:44015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s0lKh-0000cT-M4 for 70570 <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:55:29 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.108.17.88]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 4VRbLM12pxz1l5p for <70570 <at> debbugs.gnu.org>; Sat, 27 Apr 2024 16:55:07 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-pl9zh (unknown [10.110.178.72]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E00501FD37; Sat, 27 Apr 2024 16:55:06 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-6684bf9d7b-pl9zh with ESMTPSA id 49jWM+otLWalHwAAfaIZvg (envelope-from <ngraves@HIDDEN>); Sat, 27 Apr 2024 16:55:06 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R002452a143d-58c1-47c9-aa73-dbb69770fb3e, A35C6C2D854BD2823198681D90DB7DB46B6540F1) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70570 <at> debbugs.gnu.org Subject: [PATCH v2 1/2] guix: import: pypi: Ignore pypi-ignored-inputs. Date: Sat, 27 Apr 2024 18:54:52 +0200 Message-ID: <20240427165504.8843-1-ngraves@HIDDEN> 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: 3308738354728657634 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvddtuddguddthecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepgedtkeduueevueetgeeuveffteeigeetgfejtdduteegiefgueeufedtieevtefgnecuffhomhgrihhnpehphihpihdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddrleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdehjedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeeipdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * 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 | 12 +++++++----- tests/pypi.scm | 3 ++- 3 files changed, 26 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 <vivien@HIDDEN> ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN> ;;; Copyright © 2022 Hartmut Goebel <h.goebel@HIDDEN> +;;; Copyright © 2024 Nicolas Graves <ngraves@HIDDEN> ;;; ;;; 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 <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 68d532968d..dd9bf0fb46 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 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
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 27 Apr 2024 16:10:05 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 12:10:05 2024 Received: from localhost ([127.0.0.1]:49562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0kcm-00008y-O6 for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:10:05 -0400 Received: from 14.mo584.mail-out.ovh.net ([46.105.40.29]:45477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s0kcj-00008X-Uf for 70570 <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:10:03 -0400 Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.139.163]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4VRZKx1LWyz1DvL for <70570 <at> debbugs.gnu.org>; Sat, 27 Apr 2024 16:09:41 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-7b9s4 (unknown [10.111.182.85]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D7E431FE92; Sat, 27 Apr 2024 16:09:40 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-7b9s4 with ESMTPSA id c7tvK0QjLWY3lwEAli/sTA (envelope-from <ngraves@HIDDEN>); Sat, 27 Apr 2024 16:09:40 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G0065a08b0b4-93f2-46ef-82b5-d952e3fd6332, A35C6C2D854BD2823198681D90DB7DB46B6540F1) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: Lars-Dominik Braun <lars@HIDDEN> Subject: Re: [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags. In-Reply-To: <87mspgv3a7.fsf@HIDDEN> References: <20240425160010.6243-1-ngraves@HIDDEN> <20240425160010.6243-2-ngraves@HIDDEN> <ZitqM7eUAWMzKZQ0@HIDDEN> <87mspgv3a7.fsf@HIDDEN> Date: Sat, 27 Apr 2024 18:09:39 +0200 Message-ID: <877cgivlbw.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 2541437565561987666 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvddtuddgleejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeffudelkeejveetleeuffejfefftefhhfffuedtteethfelueelveffjedvffdtffenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtheejtdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: 70570 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2024-04-26 12:14, Nicolas Graves wrote: > On 2024-04-26 10:47, Lars-Dominik Braun wrote: > >> Hi, >> >> pretty smart idea to use a pytest plugin :) >> >>> +;; Pytest plugin to filter out arguments to ignore. >>> +(define pytest-default-ignore-alist >> >> From the comment it=E2=80=99s not entirely clear to me what this list >> does. It=E2=80=99s a map from pytest plugin name to it=E2=80=99s pytest = command line >> options, right? > > Right, I'll update the command. > >> >>> +;; Allow guix to ignore these options when underlying pytest package i= s not >>> +;; an input. These flags are not necessary to properly run tests. >>> +(define (pytest-ignore-options-plugin flags) >>> + "This function converts an list of flags in a string that can >>> + be instantiated as a python pytest plugin." >> =E2=80=A6 >>> +(define (call-with-guix-pytest-plugin inputs thunk) >> >> Same here. As far as I understand you want to emulate command line >> options provided by pytest plugins, so pytest won=E2=80=99t fail if the = plugin >> is not present. And we only do that if the plugin is not an input to >> avoid clashing command line options, right? > > Will do. >> >> + for option in options: >> + group.addoption(option, action=3D'append', nargs=3D'*')" >> >> Not sure nargs=3D'*' is a good idea, since it might consume positional >> arguments intended for pytest. '?' would be a more conservative option, >> especially since we cannot override this easily per-package. > > It works. I'll try with '?' then! > >> >>> + (let* ((former-path (getenv "PYTHONPATH")) >> =E2=80=A6 >>> + (dynamic-wind >>> + (lambda () >>> + (setenv "PYTHONPATH" >> =E2=80=A6 >>> + (lambda () >>> + (setenv "PYTHONPATH" former-path) >> >> Isn=E2=80=99t it GUIX_PYTHONPATH? >> >=20=20 > I know it works this way. Could be GUIX_PYTHONPATH too, I'm not sure I > properly get the difference. Can test with GUIX_PYTHONPATH too, but in > any case it's just for the tests, so it should be cleared out > too. Should I? Actually, it doesn't seem to work with a replacement from PYTHONPATH to GUIX_PYTHONPATH, so I would rather keep it this way. > >> Lars >> --=20 Best regards, Nicolas Graves
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 26 Apr 2024 10:24:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 06:23:59 2024 Received: from localhost ([127.0.0.1]:34025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0IkI-0004KF-0H for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 06:23:59 -0400 Received: from 19.mo561.mail-out.ovh.net ([178.32.98.231]:40185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s0IkD-0004Il-6F for 70570 <at> debbugs.gnu.org; Fri, 26 Apr 2024 06:23:55 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.25.12]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 4VQpj04NCVz1Tmv for <70570 <at> debbugs.gnu.org>; Fri, 26 Apr 2024 10:23:32 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-khzk4 (unknown [10.108.42.21]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 345E81FE4F; Fri, 26 Apr 2024 10:23:31 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-6684bf9d7b-khzk4 with ESMTPSA id Xk4qOqOAK2ZUaAoAIVMS1w (envelope-from <ngraves@HIDDEN>); Fri, 26 Apr 2024 10:23:31 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R002a445e36e-f494-46a3-b387-cfc6db708103, EDA0CED93298E9092902437F4E7F8F51E33D8AB1) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: Lars-Dominik Braun <lars@HIDDEN> Subject: Re: [PATCH 1/2] guix: import: pypi: Ignore pypi-ignored-inputs. In-Reply-To: <ZitlNNs1jvQiF-BY@HIDDEN> References: <20240425160010.6243-1-ngraves@HIDDEN> <ZitlNNs1jvQiF-BY@HIDDEN> Date: Fri, 26 Apr 2024 12:23:30 +0200 Message-ID: <87jzkkv2vx.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 9269533935170937426 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudelledgvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeffudelkeejveetleeuffejfefftefhhfffuedtteethfelueelveffjedvffdtffenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddrleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdehjedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: 70570 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2024-04-26 10:26, Lars-Dominik Braun wrote: > Hi, > >> +(define pypi-ignored-inputs >> + ;; This list contains packages that are useful for development or qua= lity >> + ;; 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")) ; var= iants > >> + (let ((input-names (append >> + '("python-setuptools" >> + "python-pip" >> + "python-pre-commit") >> + pypi-ignored-inputs))) > > we should remove python-setuptools from this list now (since it actually > should be an input on the python-team branch), python-pre-commit is > also part of pypi-ignored-inputs and maybe we can just add pip to > pypi-ignored-inputs and use only that list? Yes, but then it should be done in an independent commit IMO to keep this one focused on native-inputs and pytest, and then add one for your other changes of the build system. But yes, I think they ought to be in the same list. > > Also note that check-inputs-should-not-be-an-input-at-all expects Guix > package names (with python- prefix), whereas pypi-ignored-inputs uses > Python package names, so you probably want to (map (cut (string-append > "python-" <>) =E2=80=A6) (or similar) here. Perfectly right, thanks for noticing. About pre-commit : if we add the python- prefix, then we use the outdated variable. Maybe we should remove if pypi-ignored-inputs here, and add "pre-commit" idependently. > Lars > Another quick note : The plugin could also be several plugins (one per package) in the store added in the PYTHONPATH, which would enable us to not regenerate the file everytime, but it doesn't compile with (guix gexp) module. It might be more efficient / guixy this way, but I'm not able to do it. If you know how to, don't hesitate ;) --=20 Best regards, Nicolas Graves
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 26 Apr 2024 10:15:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 06:15:24 2024 Received: from localhost ([127.0.0.1]:33997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0Ibz-0002pN-3W for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 06:15:24 -0400 Received: from 1.mo584.mail-out.ovh.net ([178.33.248.196]:48045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s0Ibu-0002o0-VF for 70570 <at> debbugs.gnu.org; Fri, 26 Apr 2024 06:15:21 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.139.228]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4VQpW63TC5z1KrQ for <70570 <at> debbugs.gnu.org>; Fri, 26 Apr 2024 10:14:58 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-tc2sc (unknown [10.111.182.85]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id ECA641FE31; Fri, 26 Apr 2024 10:14:57 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-tc2sc with ESMTPSA id /3m6MaF+K2Z1nwAAaYUyfQ (envelope-from <ngraves@HIDDEN>); Fri, 26 Apr 2024 10:14:57 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-108S002b02f516f-9ab0-477d-aea4-7da9ef233215, EDA0CED93298E9092902437F4E7F8F51E33D8AB1) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: Lars-Dominik Braun <lars@HIDDEN> Subject: Re: [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags. In-Reply-To: <ZitqM7eUAWMzKZQ0@HIDDEN> References: <20240425160010.6243-1-ngraves@HIDDEN> <20240425160010.6243-2-ngraves@HIDDEN> <ZitqM7eUAWMzKZQ0@HIDDEN> Date: Fri, 26 Apr 2024 12:14:56 +0200 Message-ID: <87mspgv3a7.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 9124855797205688914 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudelledgvdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeffudelkeejveetleeuffejfefftefhhfffuedtteethfelueelveffjedvffdtffenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtheejtdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: 70570 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2024-04-26 10:47, Lars-Dominik Braun wrote: > Hi, > > pretty smart idea to use a pytest plugin :) > >> +;; Pytest plugin to filter out arguments to ignore. >> +(define pytest-default-ignore-alist > > From the comment it=E2=80=99s not entirely clear to me what this list > does. It=E2=80=99s a map from pytest plugin name to it=E2=80=99s pytest c= ommand line > options, right? Right, I'll update the command. > >> +;; Allow guix to ignore these options when underlying pytest package is= not >> +;; an input. These flags are not necessary to properly run tests. >> +(define (pytest-ignore-options-plugin flags) >> + "This function converts an list of flags in a string that can >> + be instantiated as a python pytest plugin." > =E2=80=A6 >> +(define (call-with-guix-pytest-plugin inputs thunk) > > Same here. As far as I understand you want to emulate command line > options provided by pytest plugins, so pytest won=E2=80=99t fail if the p= lugin > is not present. And we only do that if the plugin is not an input to > avoid clashing command line options, right? Will do. > > + for option in options: > + group.addoption(option, action=3D'append', nargs=3D'*')" > > Not sure nargs=3D'*' is a good idea, since it might consume positional > arguments intended for pytest. '?' would be a more conservative option, > especially since we cannot override this easily per-package. It works. I'll try with '?' then! > >> + (let* ((former-path (getenv "PYTHONPATH")) > =E2=80=A6 >> + (dynamic-wind >> + (lambda () >> + (setenv "PYTHONPATH" > =E2=80=A6 >> + (lambda () >> + (setenv "PYTHONPATH" former-path) > > Isn=E2=80=99t it GUIX_PYTHONPATH? > =20 I know it works this way. Could be GUIX_PYTHONPATH too, I'm not sure I properly get the difference. Can test with GUIX_PYTHONPATH too, but in any case it's just for the tests, so it should be cleared out too. Should I? > Lars > --=20 Best regards, Nicolas Graves
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 26 Apr 2024 08:48:24 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 04:48:23 2024 Received: from localhost ([127.0.0.1]:33940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0HFl-0004XM-Ug for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 04:48:23 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:43910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <lars@HIDDEN>) id 1s0HFg-0004Uz-8A for 70570 <at> debbugs.gnu.org; Fri, 26 Apr 2024 04:48:19 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4VQmZX6dBHz9sml; Fri, 26 Apr 2024 10:47:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1714121268; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=+bPBwel8pp2of9zLC2W73K8f7qj1lqZ34ZG3TiOguDA=; b=Dky26wlHMjSggQCFMH0DDWezd3dGESX9jm9TdGMLUXq8Dec0UHVYHSmCPDVa8kazEcGTi7 QTwVoOIJO5JRjiFzqZDU0a1Lr86GK5Cgho57KL751hXxSigs94tXJeU1gU30hO0LWt0Y+e RY16tB7TFVxMuYlF7zrYC20bCECgfwrCu4IYc2j7sjZCjTEQOABVe6ggyLGxizagSCvTjf LfyLbKkczHT520hhXmkC45ZL2eVOyvBm4dCq1g1ZdpaUNWUByQrrSHa9h2N8cL0xOniKzN bm48+TJJVwZtZmcErKf0nQO1GXZVg2lJo3sRv6YQusjhGug5h8Uo1SypqiENuw== Date: Fri, 26 Apr 2024 10:47:47 +0200 From: Lars-Dominik Braun <lars@HIDDEN> To: Nicolas Graves <ngraves@HIDDEN> Subject: Re: [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags. Message-ID: <ZitqM7eUAWMzKZQ0@HIDDEN> References: <20240425160010.6243-1-ngraves@HIDDEN> <20240425160010.6243-2-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240425160010.6243-2-ngraves@HIDDEN> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70570 Cc: 70570 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Hi, pretty smart idea to use a pytest plugin :) > +;; Pytest plugin to filter out arguments to ignore. > +(define pytest-default-ignore-alist From the comment it’s not entirely clear to me what this list does. It’s a map from pytest plugin name to it’s pytest command line options, right? > +;; Allow guix to ignore these options when underlying pytest package is not > +;; an input. These flags are not necessary to properly run tests. > +(define (pytest-ignore-options-plugin flags) > + "This function converts an list of flags in a string that can > + be instantiated as a python pytest plugin." … > +(define (call-with-guix-pytest-plugin inputs thunk) Same here. As far as I understand you want to emulate command line options provided by pytest plugins, so pytest won’t fail if the plugin is not present. And we only do that if the plugin is not an input to avoid clashing command line options, right? + for option in options: + group.addoption(option, action='append', nargs='*')" Not sure nargs='*' is a good idea, since it might consume positional arguments intended for pytest. '?' would be a more conservative option, especially since we cannot override this easily per-package. > + (let* ((former-path (getenv "PYTHONPATH")) … > + (dynamic-wind > + (lambda () > + (setenv "PYTHONPATH" … > + (lambda () > + (setenv "PYTHONPATH" former-path) Isn’t it GUIX_PYTHONPATH? Lars
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 26 Apr 2024 08:27:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 04:27:02 2024 Received: from localhost ([127.0.0.1]:33894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s0Gv6-0000qx-HI for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 04:27:02 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:42794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <lars@HIDDEN>) id 1s0Gv3-0000p4-A0 for 70570 <at> debbugs.gnu.org; Fri, 26 Apr 2024 04:26:59 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4VQm5y2DNHz9smf; Fri, 26 Apr 2024 10:26:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1714119990; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=MOfkGSW9mYFELxZCEuNYEMcJDzTUMT9MS3A4BDsgoVQ=; b=bAqgwXOwaww7Mqv0ZagAf0nYFxInlhe67IXJqrTU7hPPgxN5cbXhF4t/nA0fGi0XJSIq5J jcKv7dhnNlK865z+23F96eEhowuq1qogwsiCFY0XZGtccHYihtNLOJOMMK3NndbsQ8Pdnt PW5FXhULW9DeEc1A4lmQfEWsFi+mGJ8mfRP7bq3Ou9NIuNtjLKU2QwjXzod0EKUtNYmo3B EzpiVaJfWXSIvvr9CH4ins9aOAGOq/yIh+oHXr1PjJGocPKccKg4pxbH80C17kwjatu3xg 7WuOOh9XYNoR0EePkxNg50OPJsqSCE7rOSqfGn6EeKEf3zsCsTnC9oPhasW7dw== Date: Fri, 26 Apr 2024 10:26:28 +0200 From: Lars-Dominik Braun <lars@HIDDEN> To: Nicolas Graves <ngraves@HIDDEN> Subject: Re: [PATCH 1/2] guix: import: pypi: Ignore pypi-ignored-inputs. Message-ID: <ZitlNNs1jvQiF-BY@HIDDEN> References: <20240425160010.6243-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240425160010.6243-1-ngraves@HIDDEN> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70570 Cc: 70570 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Hi, > +(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 > + (let ((input-names (append > + '("python-setuptools" > + "python-pip" > + "python-pre-commit") > + pypi-ignored-inputs))) we should remove python-setuptools from this list now (since it actually should be an input on the python-team branch), python-pre-commit is also part of pypi-ignored-inputs and maybe we can just add pip to pypi-ignored-inputs and use only that list? Also note that check-inputs-should-not-be-an-input-at-all expects Guix package names (with python- prefix), whereas pypi-ignored-inputs uses Python package names, so you probably want to (map (cut (string-append "python-" <>) …) (or similar) here. Lars
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 25 Apr 2024 16:01:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 25 12:01:17 2024 Received: from localhost ([127.0.0.1]:33141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s01X6-0007eU-JT for submit <at> debbugs.gnu.org; Thu, 25 Apr 2024 12:01:17 -0400 Received: from 9.mo575.mail-out.ovh.net ([46.105.78.111]:38727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s01WX-0007X4-HA for 70570 <at> debbugs.gnu.org; Thu, 25 Apr 2024 12:00:42 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.139.129]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4VQLD16NXjz1ZCn for <70570 <at> debbugs.gnu.org>; Thu, 25 Apr 2024 16:00:17 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-82vqs (unknown [10.111.182.237]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 6A61A1FD2A; Thu, 25 Apr 2024 16:00:17 +0000 (UTC) Received: from ngraves.fr ([37.59.142.96]) by ghost-submission-6684bf9d7b-82vqs with ESMTPSA id YJQ5FBF+KmYXAwgAseltsA (envelope-from <ngraves@HIDDEN>); Thu, 25 Apr 2024 16:00:17 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-96R001d6bd04c7-908d-463d-afd0-3b33328a9bb0, AD8D7EE5F14CB41C4DCF674C83E011AE46681836) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 80.215.5.23 From: Nicolas Graves <ngraves@HIDDEN> To: 70570 <at> debbugs.gnu.org Subject: [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags. Date: Thu, 25 Apr 2024 17:59:46 +0200 Message-ID: <20240425160010.6243-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240425160010.6243-1-ngraves@HIDDEN> References: <20240425160010.6243-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 9084041924015547106 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeljedgleeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpedvleelgeeffeetleekueegvdfhtedvueffiefhkedtleejkeduveelgfdufeduleenucfkphepuddvjedrtddrtddruddpkedtrddvudehrdehrddvfedpfeejrdehledrudegvddrleeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdehjedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/build/pyproject-build-system.scm : Ignore unwanted pytest flags. Change-Id: Ib9f1602e5af11227e5b7ce124f0f9be4fa2b78e4 --- guix/build/pyproject-build-system.scm | 88 ++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index 947d240114..3ca3c76c1c 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Lars-Dominik Braun <lars@HIDDEN> ;;; Copyright © 2022 Marius Bakke <marius@HIDDEN> +;;; Copyright © 2024 Nicolas Graves <ngraves@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -142,7 +143,86 @@ (define* (build #:key outputs build-backend backend-path configure-flags #:allow wheel-dir config-settings))) -(define* (check #:key tests? test-backend test-flags #:allow-other-keys) +;; Pytest plugin to filter out arguments to ignore. +(define pytest-default-ignore-alist + '(("cov" . ("--cov" "--cov-reset" "--cov-report" "--cov-config" + "--no-cov-on-fail" "--no-cov" "--cov-fail-under" + "--cov-append" "--cov-branch" "--cov-context")) + ("mypy" . ("--mypy" "--mypy-config-file" "--mypy-ignore-missing-imports")) + ("isort" . ("--isort")) + ("flake8" . ("--flake8")) + ("black" . ("--black")) + ("flakes" . ("--flakes")) + ("pep8" . ("--pep8")))) + +;; Allow guix to ignore these options when underlying pytest package is not +;; an input. These flags are not necessary to properly run tests. +(define (pytest-ignore-options-plugin flags) + "This function converts an list of flags in a string that can + be instantiated as a python pytest plugin." + (format #f "\ +import pytest + +def pytest_addoption(parser): + group = parser.getgroup('guix','Guix ignored options') + options = [~{~s, ~}] + for option in options: + group.addoption(option, action='append', nargs='*')" + flags)) + +(define (call-with-guix-pytest-plugin inputs thunk) + (let* ((former-path (getenv "PYTHONPATH")) + (input-names + (filter (match-lambda + (((name . _) ...) + (if (string-prefix? "python-pytest-" name) + name + #f)) + ( _ #f)) + inputs)) + (filtered-flags + (filter identity + (append-map + (match-lambda + ((group . flags) + (if (member (string-append "python-pytest-" group) + input-names) + (list #f) + flags)) + (_ (list #f))) + pytest-default-ignore-alist)))) + (dynamic-wind + (lambda () + (setenv "PYTHONPATH" + (string-append + (if former-path + (string-append former-path ":") + "") + ".guix-pytest")) + (setenv "PYTEST_PLUGINS" + (string-append + (if (getenv "PYTEST_PLUGINS") + (string-append former-path ",") + "") + "pytest_guix_plugin")) + (mkdir-p ".guix-pytest") + (with-output-to-file ".guix-pytest/__init__.py" + (lambda _ (display ""))) + (with-output-to-file ".guix-pytest/pytest_guix_plugin.py" + (lambda _ + (display (pytest-ignore-options-plugin filtered-flags))))) + thunk + (lambda () + (setenv "PYTHONPATH" former-path) + (unsetenv "PYTEST_PLUGINS") + (when (file-exists? ".guix-pytest") + (delete-file-recursively ".guix-pytest")))))) + +(define-syntax-rule (with-guix-pytest-plugin inputs exp ...) + "Evaluate EXP in a context where the Guix pytest plugin is added." + (call-with-guix-pytest-plugin inputs (lambda () exp ...))) + +(define* (check #:key inputs tests? test-backend test-flags #:allow-other-keys) "Run the test suite of a given Python package." (if tests? ;; Unfortunately with PEP 517 there is no common method to specify test @@ -165,7 +245,8 @@ (define* (check #:key tests? test-backend test-flags #:allow-other-keys) (format #t "Using ~a~%" use-test-backend) (match use-test-backend ('pytest - (apply invoke pytest "-vv" test-flags)) + (with-guix-pytest-plugin inputs + (apply invoke pytest "-vv" test-flags))) ('nose (apply invoke nosetests "-v" test-flags)) ('nose2 @@ -386,3 +467,6 @@ (define* (pyproject-build #:key inputs (phases %standard-phases) (apply python:python-build #:inputs inputs #:phases phases args)) ;;; pyproject-build-system.scm ends here +;;; Local Variables: +;;; eval: (put 'with-guix-pytest-plugin 'scheme-indent-function 1) +;;; End: -- 2.41.0
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at 70570) by debbugs.gnu.org; 25 Apr 2024 16:00:47 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 25 12:00:46 2024 Received: from localhost ([127.0.0.1]:33138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s01Wb-0007Y9-HC for submit <at> 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 <ngraves@HIDDEN>) id 1s01WV-0007WV-BU for 70570 <at> 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 <at> 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 <ngraves@HIDDEN>); Thu, 25 Apr 2024 16:00:14 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-109S0037da76618-70fc-49d8-b0bc-befd460d2feb, AD8D7EE5F14CB41C4DCF674C83E011AE46681836) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 80.215.5.23 From: Nicolas Graves <ngraves@HIDDEN> To: 70570 <at> debbugs.gnu.org Subject: [PATCH 1/2] guix: import: pypi: Ignore pypi-ignored-inputs. Date: Thu, 25 Apr 2024 17:59:45 +0200 Message-ID: <20240425160010.6243-1-ngraves@HIDDEN> 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-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70570 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * 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 <vivien@HIDDEN> ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN> ;;; Copyright © 2022 Hartmut Goebel <h.goebel@HIDDEN> +;;; Copyright © 2024 Nicolas Graves <ngraves@HIDDEN> ;;; ;;; 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 <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 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
guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 25 Apr 2024 15:57:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 25 11:57:20 2024 Received: from localhost ([127.0.0.1]:33125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s01TI-0006vL-MU for submit <at> debbugs.gnu.org; Thu, 25 Apr 2024 11:57:20 -0400 Received: from lists.gnu.org ([2001:470:142::17]:36698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s01SI-0006ij-4o for submit <at> debbugs.gnu.org; Thu, 25 Apr 2024 11:56:23 -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 <ngraves@HIDDEN>) id 1s01Rt-0008B9-Db for guix-patches@HIDDEN; Thu, 25 Apr 2024 11:55:49 -0400 Received: from 4.mo575.mail-out.ovh.net ([46.105.59.63]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>) id 1s01Rp-0000yF-Na for guix-patches@HIDDEN; Thu, 25 Apr 2024 11:55:48 -0400 Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.2.251]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4VQL6Y13Fsz1R0F for <guix-patches@HIDDEN>; Thu, 25 Apr 2024 15:55:33 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-7t84l (unknown [10.110.113.175]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id A8C3E1FE7F; Thu, 25 Apr 2024 15:55:32 +0000 (UTC) Received: from ngraves.fr ([37.59.142.103]) by ghost-submission-6684bf9d7b-7t84l with ESMTPSA id SL7rJfR8KmYc8AYAyso6Hw (envelope-from <ngraves@HIDDEN>); Thu, 25 Apr 2024 15:55:32 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-103G005524e1b7f-3ca5-4335-b061-30244e8fec16, AD8D7EE5F14CB41C4DCF674C83E011AE46681836) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 80.215.5.23 From: Nicolas Graves <ngraves@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH 0/2] Python: Ignore unwanted development inputs. Date: Thu, 25 Apr 2024 17:42:35 +0200 Message-ID: <20240425155529.30747-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 9004103032855519970 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeljedgleehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdektddrvdduhedrhedrvdefpdefjedrheelrddugedvrddutdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehguhhigidqphgrthgthhgvshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht Received-SPF: pass client-ip=46.105.59.63; envelope-from=ngraves@HIDDEN; helo=4.mo575.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) This patch series implements a way to robustly and with minimal burden on maintainers to remove some python packages that are often put in native inputs. This allows these packages to be removed almost seemlessly in most cases from native-inputs where they are of no use, enabling to cut down the dependent rebuilds upon update, and more easily update them and their real dependents. It is for the python-team branch. It will be followed by a more consequential patch series upon the python-team branch to actually remove these unwanted developement inputs, but is send before for reviews. The patch series handles : - guix lint warnings against the inclusion of these packages - guix import pypi will automatically not include them when read in the package result - ignoring pytest arguments defined in pytest.ini or setup.cfg regarding those packages The patch series doesn't handle: - ignoring these packages when they are explicitely listed as required for installation (which means that sometimes a snippet or a patch are necessary, but this is not the general case). Nicolas Graves (2): guix: import: pypi: Ignore pypi-ignored-inputs. guix: pyproject-build-system: Ignore unwanted pytest flags. guix/build/pyproject-build-system.scm | 88 ++++++++++++++++++++++++++- guix/import/pypi.scm | 20 +++++- guix/lint.scm | 11 ++-- tests/pypi.scm | 3 +- 4 files changed, 111 insertions(+), 11 deletions(-) -- 2.41.0
Nicolas Graves <ngraves@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#70570
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.