From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH 10/10] gnu: Add python-scikit-bio. Date: Thu, 21 Apr 2016 17:04:38 +0200 Message-ID: References: <1461244921-7412-1-git-send-email-donttrustben@gmail.com> <1461244921-7412-11-git-send-email-donttrustben@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atGA0-0003zN-CJ for Guix-devel@gnu.org; Thu, 21 Apr 2016 11:04:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atG9w-0007X5-9Y for Guix-devel@gnu.org; Thu, 21 Apr 2016 11:04:52 -0400 Received: from pegasus.bbbm.mdc-berlin.de ([141.80.25.20]:38485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atG9v-0007Wl-MM for Guix-devel@gnu.org; Thu, 21 Apr 2016 11:04:48 -0400 In-Reply-To: <1461244921-7412-11-git-send-email-donttrustben@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ben Woodcroft Cc: Guix-devel@gnu.org Hi Ben, thanks for your patch. > * gnu/packages/python.scm (python-scikit-bio, > python2-scikit-bio): New variables. I think this should be on one line. In any case, breaking the line so soon looks a bit weird. > --- > gnu/packages/python.scm | 91 +++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 91 insertions(+) > > diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm > index 7aae6fc..b359422 100644 > --- a/gnu/packages/python.scm > +++ b/gnu/packages/python.scm > @@ -8945,6 +8945,97 @@ numbers (i.e. signed/unsigned floats or ints), o= r as versions.") > ("python2-enum34" ,python2-enum34) > ("python2-setuptools" ,python2-setuptools))))))) > =20 > +(define-public python-scikit-bio > + (package > + (name "python-scikit-bio") > + (version "0.4.2") > + (source > + (origin > + (method url-fetch) > + (uri (string-append > + "https://pypi.python.org/packages/source/s/scikit-bio/sci= kit-bio-" > + version > + ".tar.gz")) > + (sha256 > + (base32 > + "06nrcgfz6c3jb2dnaf1wnvx3dyww94p454c4126gvcvfgv6scczy")))) > + (build-system python-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + ;; Install procedure installs extraneous binaries. > + (add-after 'install 'remove-extraneous-files > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (bin (string-append out "/bin"))) > + (delete-file-recursively bin)) > + #t)) > + ;; `setup.py test' does not run tests, but there are many tes= t > + ;; failures anyway What does it mean that =E2=80=9Csetup.py test=E2=80=9D does not run tests= ? Is there another test target? > + ;; e.g. https://github.com/biocore/scikit-bio/issues/1308. R= un a > + ;; simple import test instead. > + (delete 'check) > + (add-after 'install 'check-after-install > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let ((pythonpath > + (string-append > + (getenv "PYTHONPATH") > + ":" (assoc-ref outputs "out") > + "/lib/python" > + (string-take (string-take-right > + (assoc-ref inputs "python") 5) 3) > + "/site-packages"))) > + (setenv "PYTHONPATH" pythonpath) I would not use a let here and replace =E2=80=9Cpythonpath=E2=80=9D with = the =E2=80=9C(string-append...)=E2=80=9D for the new PYTHONPATH. > + (zero? > + (with-directory-excursion "ci" > + (system* > + (string-append > + (assoc-ref inputs "python") > + "/bin/python") You can use =E2=80=9Cpython=E2=80=9D directly, or =E2=80=9C(which "python= ")=E2=80=9D. The PATH should include it at this point. > + "-c" > + (string-append "import matplotlib; " > + "matplotlib.use(\"Agg\"); " > + "import skbio")))))))))) > + (native-inputs > + `(("python-nose" ,python-nose) > + ("python-pep8" ,python-pep8) > + ("python-flake8" ,python-flake8) > + ("python-dateutil" ,python-dateutil-2))) > + (propagated-inputs > + `(("python-bz2file" ,python-bz2file) > + ("python-lockfile" ,python-lockfile) > + ("python-cachecontrol" ,python-cachecontrol) > + ("python-contextlib2" ,python-contextlib2) > + ("python-decorator" ,python-decorator) > + ("python-future" ,python-future) > + ("python-ipython" ,python-ipython) > + ("python-matplotlib" ,python-matplotlib) > + ("python-natsort" ,python-natsort) > + ("python-numpy" ,python-numpy) > + ("python-pandas" ,python-pandas) > + ("python-scipy" ,python-scipy) > + ("python-six" ,python-six))) > + (home-page "http://scikit-bio.org") > + (synopsis "Resources for bioinformatics") > + (description > + "Scikit-bio (canonically pronounced sigh-kit-buy-oh) is a library= for > +working with biological data in Python, providing data structures, alg= orithms > +and educational resources. It defines python packages for biological > +sequences, alignments, tree, visualisation, diversity calculation and = File > +I/O.") Please capitalise =E2=80=9Cpython=E2=80=9D throughout and replace =E2=80=9C= File=E2=80=9D with =E2=80=9Cfile=E2=80=9D. I=E2=80=99d also remove =E2=80=9C(canonically pronounced sigh-kit-buy-oh)= =E2=80=9D. > + (license bsd-3) > + (properties `((python2-variant . ,(delay python2-scikit-bio)))))) > + > +(define-public python2-scikit-bio > + (let ((base (package-with-python2 > + (strip-python2-variant python-scikit-bio)))) > + (package > + (inherit base) > + (native-inputs > + (append (package-native-inputs base) > + `(("python2-setuptools" ,python2-setuptools) > + ("python2-mock" ,python2-mock))))))) > + Looks good to me. ~~ Ricardo