GNU bug report logs - #67237
[PATCH 00/32] gnu: Astronomy 2023/11 updates.

Previous Next

Package: guix-patches;

Reported by: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Date: Fri, 17 Nov 2023 10:09:02 UTC

Severity: normal

Tags: patch

Done: Eric Bavier <bavier <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 67237 <at> debbugs.gnu.org
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>, Andreas Enge <andreas <at> enge.fr>, Efraim Flashner <efraim <at> flashner.co.il>, Eric Bavier <bavier <at> posteo.net>
Subject: [bug#67237] [PATCH 20/32] gnu: python-astroquery: Improve package style.
Date: Fri, 17 Nov 2023 12:16:09 +0000
* gnu/packages/astronomy.scm (python-astroquery): Improve package style.
[build-system]: Swap to pyproject-build-system.
[arguments]{phases}: Rename 'writable-home phase to
'prepare-test-environment to reflect the purpose, Add extra step
configuring Pytest.
[native-inputs]: Remove python-flask, python-jinja2. Add
python-astropy-healpix, python-regions.

Change-Id: Id3909a13e451a2f9d5f4f28511e9f04c6bceb738
---
 gnu/packages/astronomy.scm | 41 +++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index e9caced125..d12dccc208 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1614,19 +1614,27 @@ (define-public python-astroquery
        (uri (pypi-uri "astroquery" version))
        (sha256
         (base32 "1vhkzsqlgn3ji5by2rdf2gwklhbyzvpzb1iglalhqjkkrdaaaz1h"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
-     (list #:phases
-           #~(modify-phases %standard-phases
-               (add-before 'check 'writable-home
-                 (lambda _              ; some tests need a writable home
-                   (setenv "HOME" (getcwd))))
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     (invoke "python" "-m" "pytest" "--pyargs" "astroquery"
-                             ;; Skip tests that require online data.
-                             "-m" "not remote_data")))))))
+     (list
+      #:test-flags
+      #~(list "--pyargs" "astroquery"
+              "-m" "not remote_data")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'prepare-test-environment
+            (lambda _
+              (setenv "HOME" (getcwd)) ; some tests need a writable home
+              ;; To solve pytest/conftest issue. Pytest tries to load all
+              ;; files with word 'test' in them.
+              ;;
+              ;; ImportError while loading conftest ...
+              ;; _pytest.pathlib.ImportPathMismatchError: ...
+              ;;
+              (call-with-output-file "pytest.ini"
+                (lambda (port)
+                  (format port "[pytest]
+python_files = test_*.py"))))))))
     (propagated-inputs
      (list python-astropy
            python-beautifulsoup4
@@ -1636,12 +1644,13 @@ (define-public python-astroquery
            python-pyvo
            python-requests))
     (native-inputs
-     (list python-flask
-           python-jinja2
+     (list python-astropy-healpix
            python-matplotlib
+           ;; python-mocpy : Not packed yet, optional
            python-pytest-astropy
-           python-pytest-dependency))
-    (home-page "https://www.astropy.org/astroquery/")
+           python-pytest-dependency
+           python-regions))
+    (home-page "https://astroquery.readthedocs.io/en/latest/index.html")
     (synopsis "Access online astronomical data resources")
     (description "Astroquery is a package that contains a collection of tools
 to access online Astronomical data.  Each web service has its own sub-package.")
-- 
2.41.0





This bug report was last modified 1 year and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.