From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: Lars-Dominik Braun <lars@6xq.net>
Cc: 70570@debbugs.gnu.org
Subject: [bug#70570] [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags.
Date: Fri, 26 Apr 2024 12:14:56 +0200 [thread overview]
Message-ID: <87mspgv3a7.fsf@ngraves.fr> (raw)
In-Reply-To: <ZitqM7eUAWMzKZQ0@noor.fritz.box>
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’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?
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."
> …
>> +(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?
Will do.
>
> + 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.
It works. I'll try with '?' then!
>
>> + (let* ((former-path (getenv "PYTHONPATH"))
> …
>> + (dynamic-wind
>> + (lambda ()
>> + (setenv "PYTHONPATH"
> …
>> + (lambda ()
>> + (setenv "PYTHONPATH" former-path)
>
> Isn’t it GUIX_PYTHONPATH?
>
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
>
--
Best regards,
Nicolas Graves
next prev parent reply other threads:[~2024-04-26 10:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 15:42 [bug#70570] [PATCH 0/2] Python: Ignore unwanted development inputs Nicolas Graves via Guix-patches via
2024-04-25 15:59 ` [bug#70570] [PATCH 1/2] guix: import: pypi: Ignore pypi-ignored-inputs Nicolas Graves via Guix-patches via
2024-04-25 15:59 ` [bug#70570] [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags Nicolas Graves via Guix-patches via
2024-04-26 8:47 ` Lars-Dominik Braun
2024-04-26 10:14 ` Nicolas Graves via Guix-patches via [this message]
2024-04-27 16:09 ` Nicolas Graves via Guix-patches via
2024-04-26 8:26 ` [bug#70570] [PATCH 1/2] guix: import: pypi: Ignore pypi-ignored-inputs Lars-Dominik Braun
2024-04-26 10:23 ` Nicolas Graves via Guix-patches via
2024-04-27 16:54 ` [bug#70570] [PATCH v2 " Nicolas Graves via Guix-patches via
2024-04-27 16:54 ` [bug#70570] [PATCH v2 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags Nicolas Graves via Guix-patches via
2024-04-28 10:14 ` 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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mspgv3a7.fsf@ngraves.fr \
--to=guix-patches@gnu.org \
--cc=70570@debbugs.gnu.org \
--cc=lars@6xq.net \
--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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).