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.
This commit is contained in:
Ricardo Wurmus 2021-11-22 17:54:53 +01:00
parent e711ad3185
commit 823e855bd0
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1061,14 +1061,12 @@ (define-public python-jplephem
`(#: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")