aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-11-22 17:54:53 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-11-22 18:00:55 +0100
commit823e855bd00a776b30bbe8bd12c34f3e0a30a671 (patch)
tree65f887ae590c9b107c03e2d67bead07d63c1b910
parente711ad31857c587194c3077d2f1bb08c2124e8cd (diff)
downloadguix-823e855bd00a776b30bbe8bd12c34f3e0a30a671.tar
guix-823e855bd00a776b30bbe8bd12c34f3e0a30a671.tar.gz
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.
-rw-r--r--gnu/packages/astronomy.scm14
1 files changed, 6 insertions, 8 deletions
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 1fb755d271..0e7f380d9d 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")