guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#70570] [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted py


From: Lars-Dominik Braun
Subject: [bug#70570] [PATCH 2/2] guix: pyproject-build-system: Ignore unwanted pytest flags.
Date: Fri, 26 Apr 2024 10:47:47 +0200

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]