~ruther/guix-local

12964df69a99de6190422c752fef65ef813f3b6b — Ricardo Wurmus 5 years ago a8c653f
gnu: python-attrs: Conditionally execute tests.

* gnu/packages/python-xyz.scm (python-attrs)[arguments]: Wrap "check" phase in
conditional expression.
1 files changed, 14 insertions(+), 12 deletions(-)

M gnu/packages/python-xyz.scm
M gnu/packages/python-xyz.scm => gnu/packages/python-xyz.scm +14 -12
@@ 16991,18 16991,20 @@ and bit flag values.")
                  (ice-9 ftw)
                  (srfi srfi-1)
                  (srfi srfi-26))
       #:phases (modify-phases %standard-phases
                  (replace 'check
                    (lambda _
                      (let ((cwd (getcwd)))
                        (setenv "PYTHONPATH"
                                (string-append
                                 cwd "/build/"
                                 (find (cut string-prefix? "lib" <>)
                                       (scandir (string-append cwd "/build")))
                                 ":"
                                 (getenv "PYTHONPATH")))
                        (invoke "python" "-m" "pytest")))))))
       #:phases
       (modify-phases %standard-phases
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               (let ((cwd (getcwd)))
                 (setenv "PYTHONPATH"
                         (string-append
                          cwd "/build/"
                          (find (cut string-prefix? "lib" <>)
                                (scandir (string-append cwd "/build")))
                          ":"
                          (getenv "PYTHONPATH")))
                 (invoke "python" "-m" "pytest"))))))))
    (native-inputs
     `(("python-coverage" ,python-coverage)
       ("python-hypothesis" ,python-hypothesis)