guix-commits
[Top][All Lists]
Advanced

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

01/05: gnu: python-jplephem: Use ADD-INSTALLED-PYTHONPATH.


From: guix-commits
Subject: 01/05: gnu: python-jplephem: Use ADD-INSTALLED-PYTHONPATH.
Date: Mon, 22 Nov 2021 12:01:03 -0500 (EST)

rekado pushed a commit to branch core-updates-frozen
in repository guix.

commit 823e855bd00a776b30bbe8bd12c34f3e0a30a671
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Nov 22 17:54:53 2021 +0100

    gnu: python-jplephem: Use ADD-INSTALLED-PYTHONPATH.
    
    * gnu/packages/astronomy.scm (python-jplephem)[arguments]: Use
    ADD-INSTALLED-PYTHONPATH instead of setting PYTHONPATH directly; run tests
    conditionally.
---
 gnu/packages/astronomy.scm | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 1fb755d..0e7f380 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1061,14 +1061,12 @@ more.")
      `(#:phases
        (modify-phases %standard-phases
          (replace 'check
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (setenv "PYTHONPATH"
-                       (string-append "./build/lib:"
-                                      (getenv "PYTHONPATH")))
-               (setenv "PATH" (string-append out "/bin:"
-                                             (getenv "PATH")))
-               (invoke "python" "-m" "unittest" "discover" "-s" "test")))))))
+           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+             (when tests?
+               (let ((out (assoc-ref outputs "out")))
+                 (add-installed-pythonpath inputs outputs)
+                 (setenv "PATH" (string-append out "/bin:" (getenv "PATH")))
+                 (invoke "python" "-m" "unittest" "discover" "-s" 
"test"))))))))
     (inputs
      `(("python-numpy" ,python-numpy)))
     (home-page "https://github.com/brandon-rhodes/python-jplephem";)



reply via email to

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