unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Sharlatan Hellseher <sharlatanus@gmail.com>
To: Vinicius Monego <monego@posteo.net>
Cc: 48046@debbugs.gnu.org
Subject: [bug#48046] [PATCH]: Gnu add astropy
Date: Sat, 22 May 2021 20:00:35 +0000	[thread overview]
Message-ID: <CAO+9K5oVE-z7giCse5ZSZq0JL=MPwS5zsnYAW-EF46a2CjC3Fg@mail.gmail.com> (raw)
In-Reply-To: <a2c650067b52001a3b205cbc1b3999eb99ea4d92.camel@posteo.net>

[-- Attachment #1: Type: text/plain, Size: 3919 bytes --]

Hi Vinicius,

My attempt to make Astropy test working failed as well. the project
heavily depends on TOX which requires pip to install missing
dependencies for itself. I run test with pytest but it looks like it's
not allowed by this
https://github.com/astropy/astropy/blob/main/astropy/__init__.py#L139

I'll come back to conquer it once again when I have some fresh ideas.

On Wed, 19 May 2021 at 18:16, Vinicius Monego <monego@posteo.net> wrote:
>
> Hi,
>
> Em seg, 2021-04-26 às 20:01 +0000, Sharlatan Hellseher escreveu:
> > Hi Guix team!
> >
> > Here is my attempt to pack bulky python package -
> > https://www.astropy.org/
> > I've disabled test and add minor modification removing `_compiler.c'
> > file.
>
> I've tried to package AstroPy before but got stuck in the dependencies,
> more specifically pytest-astropy. There is a bug somewhere that pytest-
> filter-subpackage is not found by setup.py, even though it's listed in
> the inputs. I encountered that problem again here, after enabling the
> tests.
>
> > +     ;; NOTE: (Sharlatan-20210426T204315+0100): Tests require build
> > astropy
> > +     ;; module, it needs a good review on how to enable them.
> > +     `(#:tests? #f
>
> AstroPy uses pytest, which is not listed in your native-inputs. The
> other dependencies I had to add are python-hypothesis, python-pytest-
> cov, python-pytest-astropy and python-pytest-xdist. According to the
> documentation, it should be as simple as running pytest to run the
> entire test suite:
>
> https://docs.astropy.org/en/latest/development/testguide.html#running-tests
>
> If you end up in 'ModuleNotFoundError: No module named "astropy"', you
> may have to update PYTHONPATH after the install phase with (add-
> installed-pythonpath inputs outputs). That usually happens when
> replacing the check phase.
>
> > +    (inputs
> > +     `(("asdf" ,python-asdf)
> > +       ("beautifulsoup4" ,python-beautifulsoup4)
> > +       ("bleach" ,python-bleach)
> > +       ("bottleneck" ,python-bottleneck)
> > +       ("cfitsio" ,cfitsio)
> > +       ("dask" ,python-dask)
> > +       ("expat" ,expat)
> > +       ("graphviz" ,graphviz)
> > +       ("h5py" ,python-h5py)
> > +       ("html5lib" ,python-html5lib)
> > +       ("jplephem" ,python-jplephem)
> > +       ("matplotlib" ,python-matplotlib)
> > +       ("mpmath" ,python-mpmath)
> > +       ("numpy" ,python-numpy)
> > +       ("pandas" ,python-pandas)
> > +       ("pyerfa" ,python-pyerfa)
> > +       ("pytz" ,python-pytz)
> > +       ("pyyaml" ,python-pyyaml)
> > +       ("scipy" ,python-scipy)
> > +       ("sortedcontainers" ,python-sortedcontainers)
> > +       ("wcslib" ,wcslib)))
>
> AstroPy is a library, its Python inputs should be propagated here.
> See https://guix.gnu.org/manual/en/html_node/package-Reference.html#package-Reference
> for reference.
>
> Also, the documentation states that the only strict requirements are
> PyERFA and NumPy:
>
> https://docs.astropy.org/en/stable/install.html
>
> IMO we should only propagate these, and leave the rest in native-inputs
> as needed by tests.
>
> Now speaking of the astropy dependencies, pytest-astropy is supposed to
> propagate its six dependencies. AFAIK its purpose is to be a
> metapackage to install these other 6 pytest modules. PyERFA should also
> propagate numpy (liberfa can remain as normal input).
>
> I'll take a look at this package again next week. Could you test these
> suggestions in the meantime?
>
> Vinicius
>
>


-- 

… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.

[-- Attachment #2: 0001-gnu-astropy-rc1.patch --]
[-- Type: text/x-patch, Size: 5408 bytes --]

From 4b0d8e20915ee674054cb3bd1b3573a9f42bd08a Mon Sep 17 00:00:00 2001
From: Sharlatan Hellseher <sharlatanus@gmail.com>
Date: Sat, 22 May 2021 20:52:49 +0100
Subject: [PATCH] gnu: astropy: rc1

* gnu/packages/astronomy.scm (python-astropy)
 [inputs]: refactor inputs
 [package] Attemp to make test working no-successufl run, it failed with

starting phase `check'
/tmp/guix-build-python-astropy-4.2.1.drv-0/astropy-4.2.1/astropy/config/configuration.py:582: ConfigurationMissingWarning: Configuration defaults will be used due to FileNotFoundError:2 on None
  warn(ConfigurationMissingWarning(msg))
ImportError while loading conftest '/tmp/guix-build-python-astropy-4.2.1.drv-0/astropy-4.2.1/conftest.py'.
conftest.py:11: in <module>
    from astropy import __version__
astropy/__init__.py:248: in <module>
    _initialize_astropy()
astropy/__init__.py:203: in _initialize_astropy
    raise ImportError('You appear to be trying to import astropy from '
E   ImportError: You appear to be trying to import astropy from within a source checkout or from an editable installation without building the extension modules first. Either run:
E
E     pip install -e .
E
E   or
E
E     python setup.py build_ext --inplace
E
E   to make sure the extension modules are built
command "pytest" "-vv" failed with status 4
builder for `/gnu/store/syjzb0sjd01af6i13k5pa6snwxk1im3x-python-astropy-4.2.1.drv' failed with exit code 1
---
 gnu/packages/astronomy.scm | 71 +++++++++++++++++++++-----------------
 1 file changed, 40 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index b607fbd3d7..8ea665380e 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1085,13 +1085,17 @@ orbit around the Earth.")
     (arguments
      ;; NOTE: (Sharlatan-20210426T204315+0100): Tests require build astropy
      ;; module, it needs a good review on how to enable them.
-     `(#:tests? #f
+     `(;#:tests? #f
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'setenv-astropy-system-all
            (lambda _
              (setenv "ASTROPY_USE_SYSTEM_ALL" "1")
              #t))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv")))
          ;; NOTE: (Sharlatan-20210426T200127+0100): it fails during install
          ;; phases without the file is removed
          ;;
@@ -1108,37 +1112,42 @@ orbit around the Earth.")
              #t)))))
     (native-inputs
      `(("cfitsio" ,cfitsio)
-       ("coverage" ,python-coverage)
-       ("cython" ,python-cython)
-       ("extension-helpers" ,python-extension-helpers)
-       ("ipython" ,python-ipython)
-       ("objgraph" ,python-objgraph)
-       ("pkg-config" ,pkg-config)
-       ("setuptools-scm" ,python-setuptools-scm)
-       ("sgp4" ,python-sgp4)
-       ("skyfield" ,python-skyfield)))
-    (inputs
-     `(("asdf" ,python-asdf)
-       ("beautifulsoup4" ,python-beautifulsoup4)
-       ("bleach" ,python-bleach)
-       ("bottleneck" ,python-bottleneck)
-       ("cfitsio" ,cfitsio)
-       ("dask" ,python-dask)
-       ("expat" ,expat)
-       ("graphviz" ,graphviz)
-       ("h5py" ,python-h5py)
-       ("html5lib" ,python-html5lib)
-       ("jplephem" ,python-jplephem)
-       ("matplotlib" ,python-matplotlib)
-       ("mpmath" ,python-mpmath)
-       ("numpy" ,python-numpy)
-       ("pandas" ,python-pandas)
-       ("pyerfa" ,python-pyerfa)
-       ("pytz" ,python-pytz)
-       ("pyyaml" ,python-pyyaml)
-       ("scipy" ,python-scipy)
-       ("sortedcontainers" ,python-sortedcontainers)
+       ("python-asdf" ,python-asdf)("expat" ,expat)
+       ("python-beautifulsoup4" ,python-beautifulsoup4)
+       ("python-bleach" ,python-bleach)
+       ("python-bottleneck" ,python-bottleneck)
+       ("python-coverage" ,python-coverage)
+       ("python-cython" ,python-cython)
+       ("python-dask" ,python-dask)
+       ("python-extension-helpers" ,python-extension-helpers)
+       ("python-graphviz" ,graphviz)
+       ("python-h5py" ,python-h5py)
+       ("python-html5lib" ,python-html5lib)
+       ("python-hypothesis" ,python-hypothesis)
+       ("python-ipython" ,python-ipython)
+       ("python-jplephem" ,python-jplephem)
+       ("python-matplotlib" ,python-matplotlib)
+       ("python-mpmath" ,python-mpmath)
+       ("python-objgraph" ,python-objgraph)
+       ("python-pandas" ,python-pandas)
+       ("python-pkg-config" ,pkg-config)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-astropy" ,python-pytest-astropy)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-xdist" ,python-pytest-xdist)
+       ("python-pytz" ,python-pytz)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-scipy" ,python-scipy)
+       ("python-setuptools" ,python-setuptools)
+       ("python-setuptools-scm" ,python-setuptools-scm)
+       ("python-sgp4" ,python-sgp4)
+       ("python-skyfield" ,python-skyfield)
+       ("python-sortedcontainers" ,python-sortedcontainers)
+       ("python-tox" ,python-tox)
        ("wcslib" ,wcslib)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pyerfa" ,python-pyerfa)))
     (home-page "https://astropy.org/")
     (synopsis "Astronomy and astrophysics core library")
     (description
-- 
2.31.1


  reply	other threads:[~2021-05-22 20:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 20:01 [bug#48046] [PATCH]: Gnu add astropy Sharlatan Hellseher
2021-05-19 18:16 ` Vinicius Monego
2021-05-22 20:00   ` Sharlatan Hellseher [this message]
2021-05-23 17:54     ` Vinicius Monego
2021-05-23 20:01       ` Sharlatan Hellseher
2021-10-29 21:35         ` Sharlatan Hellseher
2021-10-29 22:58           ` Vinicius Monego
2021-10-30  2:51 ` [bug#48046] [PATCH v2 0/3] Add Astropy Vinicius Monego
2021-10-30  2:51   ` [bug#48046] [PATCH v2 1/3] gnu: python-pytest-astropy: Adjust inputs Vinicius Monego
2021-10-30  2:51   ` [bug#48046] [PATCH v2 2/3] gnu: python-pyerfa: " Vinicius Monego
2021-10-30  2:51   ` [bug#48046] [PATCH v2 3/3] gnu: Add python-astropy Vinicius Monego
2021-11-08  8:06   ` bug#48046: [PATCH v2 0/3] Add Astropy Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO+9K5oVE-z7giCse5ZSZq0JL=MPwS5zsnYAW-EF46a2CjC3Fg@mail.gmail.com' \
    --to=sharlatanus@gmail.com \
    --cc=48046@debbugs.gnu.org \
    --cc=monego@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).