mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-01 07:16:39 +01:00
gnu: python-astropy: Symplify package.
* gnu/packages/astronomy.scm (python-astropy): Simplify package. [build-system]: Swap to pyproject-build-system. [arguments] <#:phases>: Merge 'prepare-test-environment into custom 'check phase and move test arguments to <#:test-arguments>. Change-Id: I80098c3eb4e9d95ef2c651d5416196165be3f7c0
This commit is contained in:
parent
6008e256f8
commit
6a6378c2eb
1 changed files with 22 additions and 25 deletions
|
@ -1565,9 +1565,20 @@ (define-public python-astropy
|
||||||
;; see https://github.com/astropy/astropy/pull/14311
|
;; see https://github.com/astropy/astropy/pull/14311
|
||||||
(with-directory-excursion "cextern"
|
(with-directory-excursion "cextern"
|
||||||
(for-each delete-file-recursively '("expat" "wcslib")))))))
|
(for-each delete-file-recursively '("expat" "wcslib")))))))
|
||||||
(build-system python-build-system)
|
(build-system pyproject-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
|
#:test-flags
|
||||||
|
#~(list "--pyargs" "astropy"
|
||||||
|
"-n" "auto"
|
||||||
|
"-k" (string-append
|
||||||
|
;; Skip tests that need remote data.
|
||||||
|
"not remote_data"
|
||||||
|
;; E astropy.samp.errors.SAMPProxyError:
|
||||||
|
;; <SAMPProxyError 1: 'Timeout expired!'>
|
||||||
|
" and not test_main"
|
||||||
|
;; E ModuleNotFoundError: No module named 'wofz'
|
||||||
|
" and not test_pickle_functional"))
|
||||||
#:phases
|
#:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'preparations
|
(add-after 'unpack 'preparations
|
||||||
|
@ -1587,32 +1598,18 @@ (define-public python-astropy
|
||||||
(add-before 'install 'writable-compiler
|
(add-before 'install 'writable-compiler
|
||||||
(lambda _
|
(lambda _
|
||||||
(make-file-writable "astropy/_compiler.c")))
|
(make-file-writable "astropy/_compiler.c")))
|
||||||
(add-before 'check 'prepare-test-environment
|
|
||||||
(lambda _
|
|
||||||
;; Some tests require a writable home.
|
|
||||||
(setenv "HOME" "/tmp")
|
|
||||||
(make-file-writable "astropy/_compiler.c")
|
|
||||||
;; Extensions have to be rebuilt before running the tests.
|
|
||||||
(invoke "python" "setup.py" "build_ext" "--inplace"
|
|
||||||
"-j" (number->string (parallel-job-count)))))
|
|
||||||
;; TODO: The swap to pyproject-build-system introduced all tests
|
|
||||||
;; failed due to pytest could not load conftest.py, find out how
|
|
||||||
;; to resolve it and migrate completely to pyproject-build-system.
|
|
||||||
(replace 'check
|
(replace 'check
|
||||||
(lambda* (#:key tests? #:allow-other-keys)
|
(lambda* (#:key tests? test-flags #:allow-other-keys)
|
||||||
(when tests?
|
(when tests?
|
||||||
(invoke "python" "-m" "pytest" "--pyargs" "astropy"
|
(setenv "HOME" "/tmp")
|
||||||
;; with -n : 133.00s
|
(make-file-writable "astropy/_compiler.c")
|
||||||
;; without -n : 326.14s
|
;; Extensions have to be rebuilt before running the tests.
|
||||||
"-n" (number->string (parallel-job-count))
|
(invoke "python" "setup.py" "build_ext" "--inplace"
|
||||||
"-k" (string-append
|
"-j" (number->string (parallel-job-count)))
|
||||||
;; Skip tests that need remote data.
|
;; Step out of the source directory to avoid interference; we
|
||||||
"not remote_data"
|
;; want to run the installed code with extensions etc.
|
||||||
;; E astropy.samp.errors.SAMPProxyError:
|
(with-directory-excursion "/tmp"
|
||||||
;; <SAMPProxyError 1: 'Timeout expired!'>
|
(apply invoke "pytest" "-v" test-flags))))))))
|
||||||
" and not test_main"
|
|
||||||
;; E ModuleNotFoundError: No module named 'wofz'
|
|
||||||
" and not test_pickle_functional"))))))))
|
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list pkg-config
|
(list pkg-config
|
||||||
python-colorlog
|
python-colorlog
|
||||||
|
|
Loading…
Reference in a new issue