From patchwork Sat May 22 20:00:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sharlatan Hellseher X-Patchwork-Id: 29508 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ADC4027BC81; Sat, 22 May 2021 21:01:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED,URIBL_SBL, URIBL_SBL_A autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0B7C227BC78 for ; Sat, 22 May 2021 21:01:24 +0100 (BST) Received: from localhost ([::1]:34750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkXoJ-0006Sh-7j for patchwork@mira.cbaines.net; Sat, 22 May 2021 16:01:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkXnz-0006S8-3f for guix-patches@gnu.org; Sat, 22 May 2021 16:01:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkXny-0006u4-5v for guix-patches@gnu.org; Sat, 22 May 2021 16:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkXny-0001mc-1G for guix-patches@gnu.org; Sat, 22 May 2021 16:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48046] [PATCH]: Gnu add astropy Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 May 2021 20:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48046 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Vinicius Monego Cc: 48046@debbugs.gnu.org Received: via spool by 48046-submit@debbugs.gnu.org id=B48046.16217136566836 (code B ref 48046); Sat, 22 May 2021 20:01:01 +0000 Received: (at 48046) by debbugs.gnu.org; 22 May 2021 20:00:56 +0000 Received: from localhost ([127.0.0.1]:40080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkXnr-0001mA-RU for submit@debbugs.gnu.org; Sat, 22 May 2021 16:00:56 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:33525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkXnn-0001li-PX for 48046@debbugs.gnu.org; Sat, 22 May 2021 16:00:53 -0400 Received: by mail-wr1-f47.google.com with SMTP id n2so24414176wrm.0 for <48046@debbugs.gnu.org>; Sat, 22 May 2021 13:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MJY3E+dtI7VL8YZT+0cLYuUZ5KDMN51N6fraFmE+zso=; b=Dvypqi92SS4Ozyix0fIwTJIJgfMvlgjly+zvSLBtIE6sKLB3JNthuPLZBJ/LFxP6RM NCJR9drK4Aywi9HcNLwNndF7QGc4NcwqCrc3+mBkxaea2EIgSaOps4vvoe5wweochfWU HFDGCkTAyQx92Y3XEwe8K/niNxjSpAgX1qaoTiWR9AiA465LDriUHPM7+iBApPG87gMQ ILdQvQgYlCQzxJefwVvFr7UIeRInh7LT1v9ThfUbvy6tysaQxYotp/4lSPfKHzL6ZK6S qMy77YDJsXfUOZBvKUE9Je6VMOkf7vENk+4xNyQKbzFq/joUSlxrClh8pS9V8JFJ3mC1 bKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MJY3E+dtI7VL8YZT+0cLYuUZ5KDMN51N6fraFmE+zso=; b=TF5hubR+FDw5eubwSbX+ZPQnQTVW1wSA/rl6BKPb0KsIOlh3aTFuhSWrN3IT5opmaZ eX4l40EFsvVqVFA+d/BEUAnOzuXCyKBEgQ1ZmtSbi1FfcLgye/u/3Uj2Pbws/1+7SNIB OXLU8N9Rw50IRBm/Ng9f0PhlmL560TAD+N+izEkdl5lRukFr4HzfdMxOG70q4/usZoUP V/H239DrAgZXCxWEk+3dFojtNunXEzZw2ObMpDSr95Vxp9jPwv5cNAahdACimvL98cKC WnreZblDjMv0ovRvILdArs3nt9S6oreqrUv4UlGhtO8II+9pYp09Fp+VCu+wCwnGxG5e 504A== X-Gm-Message-State: AOAM533PwZjwWco1vG0crjKuP9B64Zppw3nPFkhIY+zceLfoypGkYNGe jTJRbSiAstJZowFC7Jby9yBN7wc1Ea56R7keMls= X-Google-Smtp-Source: ABdhPJxNWiMwdX8k+oIM+fu+6LVEJaYFSw2uLoa34LgMs+C6QZHj3cdLaPzXWBzpkHSKNVFYhnJ9QJ19JlrKnvbTFBQ= X-Received: by 2002:adf:e48b:: with SMTP id i11mr15404330wrm.228.1621713645878; Sat, 22 May 2021 13:00:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sharlatan Hellseher Date: Sat, 22 May 2021 20:00:35 +0000 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 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 > > From 4b0d8e20915ee674054cb3bd1b3573a9f42bd08a Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher 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 from astropy import __version__ astropy/__init__.py:248: in _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