[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11/46: gnu: python-astropy: Improve packages style.
From: |
guix-commits |
Subject: |
11/46: gnu: python-astropy: Improve packages style. |
Date: |
Tue, 27 Feb 2024 17:55:14 -0500 (EST) |
sharlatan pushed a commit to branch master
in repository guix.
commit 38b6670c7a82376e0e2d256b547d080f0e07e8ae
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Sat Jan 27 13:08:21 2024 +0000
gnu: python-astropy: Improve packages style.
* gnu/packages/astronomy.scm (python-astropy): Adjust package style.
[arguments] <#:phases>: Simplify 'preparations, move step setting up
HOME env to 'prepare-test-environment phase.
Add 'prepare-test-environment phase, consolidating all pre test
procedures.
{check}: Add option to run test in parallel to accelerate them. Remove
from disabled list tests which were passed successfully.
Change-Id: I306ab60b6e155c81035de9584fbd9d06a6381045
---
gnu/packages/astronomy.scm | 86 +++++++++++++++++++++++++---------------------
1 file changed, 46 insertions(+), 40 deletions(-)
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 11cdd9e862..9db5b080cc 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1499,46 +1499,52 @@ accurately in real time at any rate desired.")
(for-each delete-file-recursively '("expat" "wcslib")))))))
(build-system python-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'preparations
- (lambda _
- ;; Use our own libraries in place of bundles.
- (setenv "ASTROPY_USE_SYSTEM_ALL" "1")
- ;; Some tests require a writable home.
- (setenv "HOME" "/tmp")
- ;; Relax xfail tests.
- (substitute* "pyproject.toml"
- (("xfail_strict = true") "xfail_strict = false"))
- ;; Replace reference to external ply.
- (substitute* "astropy/utils/parsing.py"
- (("astropy.extern.ply") "ply"))
- ;; Replace reference to external configobj.
- (with-directory-excursion "astropy/config"
- (substitute* "configuration.py"
- (("from astropy.extern.configobj ") "")))))
- ;; This file is opened in both install and check phases.
- (add-before 'install 'writable-compiler
- (lambda _ (make-file-writable "astropy/_compiler.c")))
- (add-before 'check 'writable-compiler
- (lambda _ (make-file-writable "astropy/_compiler.c")))
- (replace 'check
- (lambda* (#:key inputs outputs tests? #:allow-other-keys)
- (when tests?
- (add-installed-pythonpath inputs outputs)
- ;; Extensions have to be rebuilt before running the tests.
- (invoke "python" "setup.py" "build_ext" "--inplace")
- (invoke "python" "-m" "pytest" "--pyargs" "astropy"
- ;; Skip tests that need remote data.
- "-k" (string-append
- "not remote_data"
- ;; XXX: Check why this tests failing.
- " and not test_ignore_sigint"
- " and not test_parquet_filter"
- ;; See
https://github.com/astropy/astropy/issues/15537
- " and not test_pvstar"
- ;; E ModuleNotFoundError: No module named 'wofz'
- " and not test_pickle_functional"))))))))
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'preparations
+ (lambda _
+ ;; Use our own libraries in place of bundles.
+ (setenv "ASTROPY_USE_SYSTEM_ALL" "1")
+ ;; Relax xfail tests.
+ (substitute* "pyproject.toml"
+ (("xfail_strict = true") "xfail_strict = false"))
+ ;; Replace reference to external ply.
+ (substitute* "astropy/utils/parsing.py"
+ (("astropy.extern.ply") "ply"))
+ ;; Replace reference to external configobj.
+ (substitute* "astropy/config/configuration.py"
+ (("from astropy.extern.configobj ") ""))))
+ ;; This file is opened in both install and check phases.
+ (add-before 'install 'writable-compiler
+ (lambda _
+ (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
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "python" "-m" "pytest" "--pyargs" "astropy"
+ ;; with -n : 133.00s
+ ;; without -n : 326.14s
+ "-n" (number->string (parallel-job-count))
+ "-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"))))))))
(native-inputs
(list pkg-config
python-colorlog
- branch master updated (16ab67182b -> 8c0282cf54), guix-commits, 2024/02/27
- 02/46: gnu: giza: Update to 1.4.1., guix-commits, 2024/02/27
- 05/46: gnu: parfive: Update to 2.0.2., guix-commits, 2024/02/27
- 01/46: gnu: calceph: Update to 3.5.5., guix-commits, 2024/02/27
- 09/46: gnu: Add python-astropy-iers-data., guix-commits, 2024/02/27
- 06/46: gnu: parfive: Simplify package., guix-commits, 2024/02/27
- 12/46: gnu: python-asdf-2.15: Deprecate package., guix-commits, 2024/02/27
- 08/46: gnu: python-aioftp: Update to 0.22.3., guix-commits, 2024/02/27
- 10/46: gnu: python-astropy: Update to 6.0.0., guix-commits, 2024/02/27
- 04/46: gnu: phd2: Update to 2.6.13., guix-commits, 2024/02/27
- 11/46: gnu: python-astropy: Improve packages style.,
guix-commits <=
- 03/46: gnu: indi-2.0: Update to 2.0.6., guix-commits, 2024/02/27
- 15/46: gnu: python-asdf-transform-schemas: Update to 0.4.0., guix-commits, 2024/02/27
- 07/46: gnu: siril: Update to 1.2.1., guix-commits, 2024/02/27
- 13/46: gnu: python-asdf-fits-schemas: Update to 0.0.1-1.d1b5e7a., guix-commits, 2024/02/27
- 14/46: gnu: python-asdf-time-schemas: Update to 0.0.1-3.a306206., guix-commits, 2024/02/27
- 19/46: gnu: python-jwst: Update to 1.13.4., guix-commits, 2024/02/27
- 16/46: gnu: python-asdf-wcs-schemas: Update to 0.3.0., guix-commits, 2024/02/27
- 18/46: gnu: python-h5netcdf: Update to 1.3.0., guix-commits, 2024/02/27
- 20/46: gnu: python-pysynphot: Update to 2.0.0-0.54e9e2a., guix-commits, 2024/02/27
- 26/46: gnu: python-stdatamodels: Update to 1.9.1., guix-commits, 2024/02/27