Package: guix-patches;
Reported by: Thomas Danckaert <post <at> thomasdanckaert.be>
Date: Wed, 22 Feb 2017 10:31:01 UTC
Severity: normal
Tags: patch
Merged with 25705
Done: Marius Bakke <mbakke <at> fastmail.com>
Bug is archived. No further changes may be made.
Message #50 received at 25834 <at> debbugs.gnu.org (full text, mbox):
From: Thomas Danckaert <post <at> thomasdanckaert.be> To: mbakke <at> fastmail.com, 25834 <at> debbugs.gnu.org Subject: bug#25834: [PATCH] Update scipy stack. Date: Mon, 27 Feb 2017 10:54:36 +0100 (CET)
[Message part 1 (text/plain, inline)]
Hi, here's a new and improved patch series, on top of the python-tests branch. It also needs python-cycler, which is currently only in master (cherry-picked commit included here for convenience). some comments: 1) matplotlib-documentation/numpy-documentation: I decided not to use “(inherits ...)” because - it got messy for matplotlib, where I think the “python2-variant” of the base matplotlib package interfered when trying to (package-with-python2 matplotlib-documentation), and - all of the input fields need to be rewritten anyway (the documentation packages only need a number of native inputs). 2) Building the latex version of scipy's documentation now fails due to missing unicode characters and a lot of unescaped inline math formulas, which are upstream issues IMO (I'll submit an issue on their github page). 3) From: Marius Bakke <mbakke <at> fastmail.com> Date: Thu, 23 Feb 2017 14:21:30 +0100 >> + (source >> + (origin >> + (method url-fetch) >> + (uri (string-append >> + "https://pypi.python.org/packages/ec/9c/" >> + >> "368086faa9c016efce5da3e0e13ba392c9db79e3ab740b763fe28620b18b/" >> + "backports.shutil_get_terminal_size-" version >> ".tar.gz")) > > Is it possible to use 'pypi-uri' here? I couldn't find a working pypi-uri, having tried all sorts of combinations of “backports.shutil-get-terminal-size” or “backports-shutil-get-terminal-size” (is there some sort of trick to find these? These simple urls are never listed on pypi, is my impression.). 4) I removed the patch related to the Matplotlib Tk backend, because it now seems to work just fine without it. But maybe I misunderstand the reason the patch was there... comments? cheers, Thomas
[update-scipy.patch (text/x-patch, inline)]
From 556764c10272b412b0b1aad26429be563bc711e3 Mon Sep 17 00:00:00 2001 From: Marius Bakke <mbakke <at> fastmail.com> Date: Thu, 19 Jan 2017 18:35:18 +0100 Subject: [PATCH 1/9] gnu: Add python-cycler. * gnu/packages/python.scm (python-cycler, python2-cycler): New variables. --- gnu/packages/python.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index e26e442e5..9d1996314 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3733,6 +3733,36 @@ transcendental functions).") (define-public python2-numexpr (package-with-python2 python-numexpr)) +(define-public python-cycler + (package + (name "python-cycler") + (version "0.10.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "cycler" version)) + (sha256 + (base32 + "1n69n23fak1gjxlrbhqisi2b9pv3ckrfj98llx3p53953082syyd")))) + (build-system python-build-system) + (arguments + ;; XXX: The current version requires 'coveralls' which we don't have. + ;; Enable this for the next release which uses 'python-pytest'. + '(#:tests? #f)) + (propagated-inputs + `(("python-six" ,python-six))) + (home-page "http://matplotlib.org/cycler/") + (synopsis "Composable keyword argument iterator") + (description + "When using @code{matplotlib} and plotting more than one line, it is +common to want to be able to want to be able to cycle over one or more artist +styles; but the plotting logic can quickly become involved. +To address this and enable easy cycling over arbitrary @code{kwargs}, the +@code{Cycler} class was developed.") + (license license:bsd-3))) + +(define-public python2-cycler + (package-with-python2 python-cycler)) + (define-public python-matplotlib (package (name "python-matplotlib") -- 2.11.1 From 9f229fce352b60c194c7300d9efe65d5e73e60f5 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Tue, 21 Feb 2017 13:33:20 +0100 Subject: [PATCH 2/9] gnu: Add python2-backports-shutil-get-terminal-size. * gnu/packages/python.scm (python2-backports-shutil-get-terminal-size): New variable. --- gnu/packages/python.scm | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 9d1996314..54c870d63 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -33,7 +33,7 @@ ;;; Copyright © 2016 Arun Isaac <arunisaac <at> systemreboot.net> ;;; Copyright © 2016, 2017 Julien Lepiller <julien <at> lepiller.eu> ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me <at> tobias.gr> -;;; Copyright © 2016 Thomas Danckaert <post <at> thomasdanckaert.be> +;;; Copyright © 2016, 2017 Thomas Danckaert <post <at> thomasdanckaert.be> ;;; Copyright © 2017 Carlo Zancanaro <carlo <at> zancanaro.id.au> ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis <at> gmail.com> ;;; @@ -6024,6 +6024,33 @@ connection to each user.") (define-public python2-backports-abc (package-with-python2 python-backports-abc)) +(define-public python2-backports-shutil-get-terminal-size + (package + (name "python2-backports-shutil-get-terminal-size") + (version "1.0.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/ec/9c/" + "368086faa9c016efce5da3e0e13ba392c9db79e3ab740b763fe28620b18b/" + "backports.shutil_get_terminal_size-" version ".tar.gz")) + (sha256 + (base32 + "107cmn7g3jnbkp826zlj8rrj19fam301qvaqf0f3905f5217lgki")))) + (build-system python-build-system) + (arguments + `(#:python ,python-2)) + (home-page + "https://github.com/chrippa/backports.shutil_get_terminal_size") + (synopsis + "Backport of Python 3.3's shutil.get_terminal_size") + (description + "A backport of the @code{get_terminal_size function} from Python 3.3's @code{shutil}. +Unlike the original version it is written in pure Python rather than C, so it +might be a tiny bit slower.") + (license license:expat))) + (define-public python-waf (package (name "python-waf") -- 2.11.1 From 49cc81a88f80b2e48ee248221b1b290f6bfaf64a Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Tue, 21 Feb 2017 21:33:02 +0100 Subject: [PATCH 3/9] gnu: Add python-colorspacious. * gnu/packages/python.scm (python-colorspacious, python2-colorspacious): New variables. --- gnu/packages/python.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 54c870d63..bab5f85e4 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3763,6 +3763,31 @@ To address this and enable easy cycling over arbitrary @code{kwargs}, the (define-public python2-cycler (package-with-python2 python-cycler)) +(define-public python-colorspacious + (package + (name "python-colorspacious") + (version "1.1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/njsmith/colorspacious/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version)) + (sha256 + (base32 "1vflh5jm32qb0skza2i8pjacv09w6gq84fqpp2nj77s0rbmzgr4k")))) + (build-system python-build-system) + (propagated-inputs + `(("python-numpy" ,python-numpy))) + (home-page "https://github.com/njsmith/colorspacious") + (synopsis "Python library for colorspace conversions") + (description "Colorspacious is a Python library that lets you easily convert +between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.") + (license license:expat))) + +(define-public python2-colorspacious + (package-with-python2 python-colorspacious)) + (define-public python-matplotlib (package (name "python-matplotlib") -- 2.11.1 From 70f5cbbab305dbf13a8c1c6215dd24e99bb62684 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Tue, 21 Feb 2017 20:28:27 +0100 Subject: [PATCH 4/9] gnu: python-numpy: Update to 1.12.0. * gnu/packages/python.scm (python-numpy): Update to 1.12.0. [source]: Use github instead of sourceforge. [native-inputs]: Add python-cython. To simplify the handling of dependency cycles (numpy documentation depends on matplotlib, which depends on numpy), we split out the documentation into a separate package: (python-numpy-bootstrap, python2-numpy-bootstrap): Remove variables. (python-numpy-documentation, python2-numpy-documentation): New variables. --- gnu/packages/python.scm | 148 +++++++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 66 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index bab5f85e4..4f1359324 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3402,24 +3402,26 @@ between language specification and implementation aspects.") ;; This version of numpy is missing the documentation and is only used to ;; build matplotlib which is required to build numpy's documentation. -(define python-numpy-bootstrap +(define-public python-numpy (package - (name "python-numpy-bootstrap") - (version "1.10.4") + (name "python-numpy") + (version "1.12.0") (source (origin (method url-fetch) - (uri (string-append "mirror://sourceforge/numpy/NumPy/" version - "/numpy-" version ".tar.gz")) + (uri (string-append + "https://github.com/numpy/numpy/archive/v" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1bjjhvncraka5s6i4lg644jrxij6bvycxy7an20gcz3a0m11iygp")))) + "025d4j4aakcp8w5i5diqh812cbbjgac7jszx1j56ivrbi1i8vv7d")))) (build-system python-build-system) (inputs `(("openblas" ,openblas) ("lapack" ,lapack))) (native-inputs - `(("python-nose" ,python-nose) + `(("python-cython" ,python-cython) + ("python-nose" ,python-nose) ("gfortran" ,gfortran))) (arguments `(#:phases @@ -3468,8 +3470,8 @@ and Fortran code, useful linear algebra, Fourier transform, and random number capabilities.") (license license:bsd-3))) -(define python2-numpy-bootstrap - (package-with-python2 python-numpy-bootstrap)) +(define-public python2-numpy + (package-with-python2 python-numpy)) (define-public python-munch (package @@ -3526,69 +3528,83 @@ Models, is a program for performing both single-SNP and SNP-set genome-wide association studies (GWAS) on extremely large data sets.") (license license:asl2.0))) -(define-public python-numpy - (package (inherit python-numpy-bootstrap) - (name "python-numpy") - (outputs '("out" "doc")) - (inputs - `(("which" ,which) - ,@(package-inputs python-numpy-bootstrap))) - (propagated-inputs - `(("python-matplotlib" ,python-matplotlib) - ("python-pyparsing" ,python-pyparsing) - ,@(package-propagated-inputs python-numpy-bootstrap))) +(define-public python-numpy-documentation + (package + (name "python-numpy-documentation") + (version (package-version python-numpy)) + (source (package-source python-numpy)) + (build-system python-build-system) (native-inputs - `(("pkg-config" ,pkg-config) + `(("python-matplotlib" ,python-matplotlib) + ("python-numpy" ,python-numpy) + ("pkg-config" ,pkg-config) ("python-sphinx" ,python-sphinx) ("python-numpydoc" ,python-numpydoc) ("texlive" ,texlive) ("texinfo" ,texinfo) ("perl" ,perl) - ,@(package-native-inputs python-numpy-bootstrap))) - (arguments - `(,@(substitute-keyword-arguments - (package-arguments python-numpy-bootstrap) - ((#:phases phases) - `(alist-cons-after - 'install 'install-doc - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; Make installed package available for building the - ;; documentation - (add-installed-pythonpath inputs outputs) - (let* ((data (string-append (assoc-ref outputs "doc") "/share")) - (doc (string-append - data "/doc/" ,name "-" - ,(package-version python-numpy-bootstrap))) - (info (string-append data "/info")) - (html (string-append doc "/html")) - (pyver ,(string-append "PYVER="))) - (with-directory-excursion "doc" - (mkdir-p html) - (system* "make" "html" pyver) - (system* "make" "latex" "PAPER=a4" pyver) - (system* "make" "-C" "build/latex" - "all-pdf" "PAPER=a4" pyver) - ;; FIXME: Generation of the info file fails. - ;; (system* "make" "info" pyver) - ;; (mkdir-p info) - ;; (copy-file "build/texinfo/numpy.info" - ;; (string-append info "/numpy.info")) - (for-each (lambda (file) - (copy-file (string-append "build/latex" file) - (string-append doc file))) - '("/numpy-ref.pdf" "/numpy-user.pdf")) - (with-directory-excursion "build/html" - (for-each (lambda (file) - (let* ((dir (dirname file)) - (tgt-dir (string-append html "/" dir))) - (unless (equal? "." dir) - (mkdir-p tgt-dir)) - (install-file file html))) - (find-files "." ".*")))))) - ,phases))))))) + ("scipy-sphinx-theme" + ,(origin ; The build script expects scipy-sphinx-theme as a git submodule + (method git-fetch) + (uri (git-reference + (url "https://github.com/scipy/scipy-sphinx-theme.git") + (commit "c466764e22"))) + (sha256 + (base32 + "0q2y87clwlsgc7wvlsn9pzyssybcq10plwhq2w1ydykfsyyqbmkl")))) + ,@(package-native-inputs python-numpy))) + (arguments + `(#:tests? #f ; we're only generating the documentation + #:phases + (modify-phases %standard-phases + (delete 'build) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((data (string-append (assoc-ref outputs "out") "/share")) + (doc (string-append + data "/doc/" ,name "-" + ,(package-version python-numpy))) + (info-reader (string-append data "/info")) + (html (string-append doc "/html")) + (scipy-sphinx-theme "scipy-sphinx-theme") + (sphinx-theme-checkout (assoc-ref inputs scipy-sphinx-theme)) + (pyver ,(string-append "PYVER="))) + (with-directory-excursion "doc" + (copy-recursively sphinx-theme-checkout scipy-sphinx-theme) + (mkdir-p html) + (system* "make" "html" pyver) + (system* "make" "latex" "PAPER=a4" pyver) + (system* "make" "-C" "build/latex" + "all-pdf" "PAPER=a4" pyver) + ;; FIXME: Generation of the info file fails. + ;; (system* "make" "info" pyver) + ;; (mkdir-p info) + ;; (copy-file "build/texinfo/numpy.info" + ;; (string-append info "/numpy.info")) + (for-each (lambda (file) + (copy-file (string-append "build/latex" file) + (string-append doc file))) + '("/numpy-ref.pdf" "/numpy-user.pdf")) + (with-directory-excursion "build/html" + (for-each (lambda (file) + (let* ((dir (dirname file)) + (tgt-dir (string-append html "/" dir))) + (unless (equal? "." dir) + (mkdir-p tgt-dir)) + (install-file file html))) + (find-files "." ".*"))))) + #t))))) + (home-page (package-home-page python-numpy)) + (synopsis "Documentation for the python-numpy package") + (description (package-description python-numpy)) + (license (package-license python-numpy)))) -(define-public python2-numpy - (package-with-python2 python-numpy)) +(define-public python2-numpy-documentation + (let ((numpy-documentation (package-with-python2 python-numpy-documentation))) + (package + (inherit numpy-documentation) + (native-inputs `(("python2-functools32" ,python2-functools32) + ,@(package-native-inputs numpy-documentation)))))) (define-public python-pygit2 (package @@ -3810,7 +3826,7 @@ between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.") ("gobject-introspection" ,gobject-introspection) ("python-tkinter" ,python "tk") ("python-dateutil" ,python-dateutil) - ("python-numpy" ,python-numpy-bootstrap) + ("python-numpy" ,python-numpy) ("python-pillow" ,python-pillow) ("python-pytz" ,python-pytz) ("python-six" ,python-six) -- 2.11.1 From c766e974d5e785b0940a588687986de79f98fede Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Tue, 21 Feb 2017 22:18:45 +0100 Subject: [PATCH 5/9] gnu: python-matplotlib: Update to 2.0.0. * gnu/packages/python.scm (python-matplotlib): Update to 2.0.0. [source]: Remove Tk backend patch, use Github instead of Sourceforge. [outputs]: Remove "doc" output. [inputs]: Add python-pyqt. [propagated-inputs]: Add python-cycler. [native-inputs]: Remove python-sphinx, python-numpydoc, texlive and texinfo. (python-matplotlib-documentation, python2-matplotlib-documentation): New variables. * gnu/packages/patches/matplotlib-setupext-tk.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove patch. --- gnu/local.mk | 1 - gnu/packages/patches/matplotlib-setupext-tk.patch | 34 ------- gnu/packages/python.scm | 118 ++++++++++++---------- 3 files changed, 67 insertions(+), 86 deletions(-) delete mode 100644 gnu/packages/patches/matplotlib-setupext-tk.patch diff --git a/gnu/local.mk b/gnu/local.mk index 899dc06b8..b2a176d45 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -747,7 +747,6 @@ dist_patch_DATA = \ %D%/packages/patches/make-impure-dirs.patch \ %D%/packages/patches/mars-install.patch \ %D%/packages/patches/mars-sfml-2.3.patch \ - %D%/packages/patches/matplotlib-setupext-tk.patch \ %D%/packages/patches/maxima-defsystem-mkdir.patch \ %D%/packages/patches/mcron-install.patch \ %D%/packages/patches/mcrypt-CVE-2012-4409.patch \ diff --git a/gnu/packages/patches/matplotlib-setupext-tk.patch b/gnu/packages/patches/matplotlib-setupext-tk.patch deleted file mode 100644 index 37c3d686e..000000000 --- a/gnu/packages/patches/matplotlib-setupext-tk.patch +++ /dev/null @@ -1,34 +0,0 @@ -Use 'pkg-config' instead of heuristics to find 'tk' flags. - ---- matplotlib-1.4.3/setupext.py.orig 2015-12-01 14:21:19.554417453 +0100 -+++ matplotlib-1.4.3/setupext.py 2015-12-02 10:39:47.282363530 +0100 -@@ -1457,7 +1457,7 @@ - p = subprocess.Popen( - '. %s ; eval echo ${%s}' % (file, varname), - shell=True, -- executable="/bin/sh", -+ executable="sh", - stdout=subprocess.PIPE) - result = p.communicate()[0] - return result.decode('ascii') -@@ -1601,8 +1601,19 @@ - # of distros. - - # Query Tcl/Tk system for library paths and version string -+ def getoutput(s): -+ ret = os.popen(s).read().strip() -+ return ret - try: -- tcl_lib_dir, tk_lib_dir, tk_ver = self.query_tcltk() -+ pkg_config_libs = getoutput('pkg-config --libs-only-L tk').split() -+ # drop '-L' part of strings -+ pkg_config_libs = [s[2:] for s in pkg_config_libs] -+ pkg_config_ver = getoutput('pkg-config --modversion tk') -+ tk_ver = re.match(r"(\d+.\d+)[\d.]*", pkg_config_ver).group(1) -+ tcl_lib_dir = next(s for s in pkg_config_libs -+ if re.match(r".*-tcl-.*", s)) + '/tcl' + tk_ver -+ tk_lib_dir = next(s for s in pkg_config_libs -+ if re.match(r".*-tk-.*", s)) + '/tk' + tk_ver - except: - tk_ver = '' - result = self.hardcoded_tcl_config() diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 4f1359324..78a7cf1f0 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -89,6 +89,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) + #:use-module (gnu packages qt) #:use-module (gnu packages readline) #:use-module (gnu packages sdl) #:use-module (gnu packages shells) @@ -3807,21 +3808,20 @@ between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.") (define-public python-matplotlib (package (name "python-matplotlib") - (version "1.4.3") + (version "2.0.0") (source (origin (method url-fetch) - (uri (string-append "mirror://sourceforge/matplotlib/matplotlib" - "/matplotlib-" version - "/matplotlib-" version ".tar.gz")) + (uri (string-append + "https://github.com/matplotlib/matplotlib/archive/v" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1dn05cvd0g984lzhh72wa0z93psgwshbbg93fkab6slx5m3l95av")) - (patches (search-patches "matplotlib-setupext-tk.patch")))) + "0w3k5m5qb3wsd7yhvmg042xddvligklvcq2visk2c5wnph3hhsln")))) (build-system python-build-system) - (outputs '("out" "doc")) (propagated-inputs ; the following packages are all needed at run time - `(("python-pyparsing" ,python-pyparsing) + `(("python-cycler" ,python-cycler) + ("python-pyparsing" ,python-pyparsing) ("python-pygobject" ,python-pygobject) ("gobject-introspection" ,gobject-introspection) ("python-tkinter" ,python "tk") @@ -3853,17 +3853,13 @@ between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.") ("glib" ,glib) ;; FIXME: Add backends when available. ;("python-wxpython" ,python-wxpython) - ;("python-pyqt" ,python-pyqt) + ("python-pyqt" ,python-pyqt) ("tcl" ,tcl) ("tk" ,tk))) (native-inputs `(("pkg-config" ,pkg-config) - ("python-sphinx" ,python-sphinx-1.2.3) - ("python-numpydoc" ,python-numpydoc) ("python-nose" ,python-nose) - ("python-mock" ,python-mock) - ("texlive" ,texlive) - ("texinfo" ,texinfo))) + ("python-mock" ,python-mock))) (arguments `(#:phases (modify-phases %standard-phases @@ -3882,26 +3878,66 @@ between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.") basedirlist = ~a,~a~% [rc_options]~% backend = TkAgg~%" - (assoc-ref inputs "tcl") - (assoc-ref inputs "tk")))) - #t))) - (add-after 'install 'install-doc + (assoc-ref inputs "tcl") + (assoc-ref inputs "tk"))))) + #t))))) + (home-page "http://matplotlib.org") + (synopsis "2D plotting library for Python") + (description + "Matplotlib is a Python 2D plotting library which produces publication +quality figures in a variety of hardcopy formats and interactive environments +across platforms. Matplotlib can be used in Python scripts, the python and +ipython shell, web application servers, and six graphical user interface +toolkits.") + (license license:psfl) + (properties `((python2-variant . ,(delay python2-matplotlib)))))) + +(define-public python2-matplotlib + (let ((matplotlib (package-with-python2 + (strip-python2-variant python-matplotlib)))) + (package (inherit matplotlib) + ;; Make sure to use special packages for Python 2 instead + ;; of those automatically rewritten by package-with-python2. + (propagated-inputs + `(("python2-pycairo" ,python2-pycairo) + ("python2-pygobject-2" ,python2-pygobject-2) + ("python2-tkinter" ,python-2 "tk") + ,@(fold alist-delete (package-propagated-inputs matplotlib) + '("python-pycairo" "python-pygobject" "python-tkinter"))))))) + +(define-public python-matplotlib-documentation + (package + (name "python-matplotlib-documentation") + (version (package-version python-matplotlib)) + (source (package-source python-matplotlib)) + (build-system python-build-system) + (native-inputs + `(("python-matplotlib" ,python-matplotlib) + ("python-colorspacious" ,python-colorspacious) + ("python-sphinx" ,python-sphinx) + ("python-numpydoc" ,python-numpydoc) + ("python-ipython" ,python-ipython) + ("texlive" ,texlive) + ("texinfo" ,texinfo) + ,@(package-native-inputs python-matplotlib))) + (arguments + `(#:tests? #f ; we're only generating documentation + #:phases + (modify-phases %standard-phases + (delete 'build) + (replace 'install (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((data (string-append (assoc-ref outputs "doc") "/share")) + (let* ((data (string-append (assoc-ref outputs "out") "/share")) (doc (string-append data "/doc/" ,name "-" ,version)) (info (string-append data "/info")) (html (string-append doc "/html"))) ;; Make installed package available for building the ;; documentation - (add-installed-pythonpath inputs outputs) (with-directory-excursion "doc" ;; Produce pdf in 'A4' format. (substitute* (find-files "." "conf\\.py") (("latex_paper_size = 'letter'") "latex_paper_size = 'a4'")) - (substitute* "users/intro.rst" - ;; Fix reST markup error (see <https://github.com/sphinx-doc/sphinx/issues/3044>) - (("[[][*][]]") "[#]")) (mkdir-p html) (mkdir-p info) ;; The doc recommends to run the 'html' target twice. @@ -3923,35 +3959,15 @@ backend = TkAgg~%" (copy-file "build/texinfo/matplotlib.info" (string-append info "/matplotlib.info")) (copy-file "build/latex/Matplotlib.pdf" - (string-append doc "/Matplotlib.pdf"))) - #t)))))) - (home-page "http://matplotlib.org") - (synopsis "2D plotting library for Python") - (description - "Matplotlib is a Python 2D plotting library which produces publication -quality figures in a variety of hardcopy formats and interactive environments -across platforms. Matplotlib can be used in Python scripts, the python and -ipython shell, web application servers, and six graphical user interface -toolkits.") - (license license:psfl) - (properties `((python2-variant . ,(delay python2-matplotlib)))))) + (string-append doc "/Matplotlib.pdf")))) + #t))))) + (home-page (package-home-page python-matplotlib)) + (synopsis "Documentation for the python-matplotlib package") + (description (package-description python-matplotlib)) + (license (package-license python-matplotlib)))) -(define-public python2-matplotlib - (let ((matplotlib (package-with-python2 - (strip-python2-variant python-matplotlib)))) - (package (inherit matplotlib) - ;; Make sure to use special packages for Python 2 instead - ;; of those automatically rewritten by package-with-python2. - (native-inputs - `(("python2-sphinx" ,python2-sphinx-1.2.3) - ,@(fold alist-delete (package-native-inputs matplotlib) - '("python-sphinx")))) - (propagated-inputs - `(("python2-pycairo" ,python2-pycairo) - ("python2-pygobject-2" ,python2-pygobject-2) - ("python2-tkinter" ,python-2 "tk") - ,@(fold alist-delete (package-propagated-inputs matplotlib) - '("python-pycairo" "python-pygobject" "python-tkinter"))))))) +(define-public python2-matplotlib-documentation + (package-with-python2 python-matplotlib-documentation)) (define-public python2-pysnptools (package -- 2.11.1 From dca7c6aab5a15eb2064287c2c355ed4fc19fde39 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Fri, 24 Feb 2017 17:07:27 +0100 Subject: [PATCH 6/9] gnu: python-testpath: Fix library location for python2 version. * gnu/packages/python.scm (python-testpath)[arguments]: Install module in the proper "lib/pythonx.y" location for all Python versions. --- gnu/packages/python.scm | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 78a7cf1f0..d8948d1c5 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5153,20 +5153,26 @@ installing @code{kernelspec}s for use with Jupyter frontends.") (build-system python-build-system) (arguments `(#:tests? #f ; this package does not even have a setup.py + #:modules ((guix build python-build-system) + (guix build utils) + (srfi srfi-1)) + #:imported-modules (,@%python-build-system-modules + (srfi srfi-1)) #:phases (modify-phases %standard-phases (delete 'install) (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((dir (string-append - (assoc-ref outputs "out") - "/lib/python" - (string-take (string-take-right - (assoc-ref inputs "python") 5) 3) - "/site-packages/testpath"))) - (mkdir-p dir) - (copy-recursively "testpath" dir)) - #t))))) + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((version (last + (string-split (assoc-ref inputs "python") #\-))) + (x.y (string-join (take (string-split version #\.) 2) + ".")) + (dir (string-append + (assoc-ref outputs "out") + "/lib/python" x.y "/site-packages/testpath"))) + (mkdir-p dir) + (copy-recursively "testpath" dir)) + #t))))) (home-page "https://github.com/takluyver/testpath") (synopsis "Test utilities for code working with files and commands") (description -- 2.11.1 From 0dde6387dfb61f111e86331064fb30340ed3d972 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Tue, 21 Feb 2017 12:41:09 +0100 Subject: [PATCH 7/9] gnu: python-ipython: Update to 5.2.2. * gnu/packages/python.scm (python-ipython): Update to 5.2.2. [propagated-inputs]: Add pyhon-prompt-toolkit and python-nbformat. (python2-ipython) [arguments]: Enable tests. [propagated-inputs]: Add python2-backports-shutil-get-terminal-size. --- gnu/packages/python.scm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index d8948d1c5..691e11757 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5187,17 +5187,18 @@ tools for mocking system commands and recording calls to those.") (define-public python-ipython (package (name "python-ipython") - (version "4.0.3") + (version "5.2.2") (source (origin (method url-fetch) (uri (pypi-uri "ipython" version ".tar.gz")) (sha256 - (base32 "1h2gp1p06sww9rzfkfzqy489bh47gj3910y2b1wdk3dcx1cqz4is")))) + (base32 "1qhjwa9cyz1np7rhv3p4ip13lkgbqsad62l24xkwiq1ic2gwiqbf")))) (build-system python-build-system) (outputs '("out" "doc")) (propagated-inputs `(("python-pyzmq" ,python-pyzmq) + ("python-prompt-toolkit" ,python-prompt-toolkit) ("python-terminado" ,python-terminado) ("python-matplotlib" ,python-matplotlib) ("python-numpy" ,python-numpy) @@ -5210,6 +5211,7 @@ tools for mocking system commands and recording calls to those.") ("python-jsonschema" ,python-jsonschema) ("python-traitlets" ,python-traitlets) ("python-ipykernel" ,python-ipykernel) + ("python-nbformat" ,python-nbformat) ("python-pygments" ,python-pygments))) (inputs `(("readline" ,readline) @@ -5220,6 +5222,7 @@ tools for mocking system commands and recording calls to those.") ("python-testpath" ,python-testpath) ("python-nose" ,python-nose) ("python-sphinx" ,python-sphinx) + ("python-shpinx-rtd-theme" ,python-sphinx-rtd-theme) ("texlive" ,texlive) ("texinfo" ,texinfo))) (arguments @@ -5233,15 +5236,16 @@ tools for mocking system commands and recording calls to those.") (html (string-append doc "/html")) (man1 (string-append data "/man/man1")) (info (string-append data "/info")) - (examples (string-append doc "/examples"))) + (examples (string-append doc "/examples")) + (python-arg (string-append "PYTHON=" (which "python")))) (setenv "LANG" "en_US.utf8") ;; Make installed package available for running the tests (add-installed-pythonpath inputs outputs) (with-directory-excursion "docs" ;; FIXME: pdf fails to build ;;(system* "make" "pdf" "PAPER=a4") - (system* "make" "html") - (system* "make" "info")) + (system* "make" python-arg "html") + (system* "make" python-arg "info")) (copy-recursively "docs/man" man1) (copy-recursively "examples" examples) (copy-recursively "docs/build/html" html) @@ -5291,10 +5295,12 @@ computing.") (let ((ipython (package-with-python2 (strip-python2-variant python-ipython)))) (package (inherit ipython) - ;; FIXME: some tests are failing - (arguments - `(#:tests? #f ,@(package-arguments ipython))) ;; FIXME: add pyreadline once available. + (propagated-inputs + `(("python2-backports-shutil-get-terminal-size" + ,python2-backports-shutil-get-terminal-size) + ("python2-pathlib2" ,python2-pathlib2) + ,@(package-propagated-inputs ipython))) (native-inputs `(("python2-mock" ,python2-mock) ,@(package-native-inputs ipython)))))) -- 2.11.1 From 1a4c6d3f1f18c696809b2987abac428c429beb5f Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <post <at> thomasdanckaert.be> Date: Tue, 21 Feb 2017 11:45:06 +0100 Subject: [PATCH 8/9] gnu: python-scipy: Update to 0.18.1. * gnu/packages/python.scm (python-scipy): Update to 0.18.1. [source]: Use github instead of sourceforge. [native-inputs]: Add python-cython. --- gnu/packages/python.scm | 104 ++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 56 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 691e11757..f164fff13 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -4049,16 +4049,16 @@ functions.") (define-public python-scipy (package (name "python-scipy") - (version "0.16.0") + (version "0.18.1") (source (origin (method url-fetch) -; http://downloads.sourceforge.net/project/scipy/scipy/0.16.1/scipy-0.16.1.tar.gz - (uri (string-append "mirror://sourceforge/scipy/scipy/" version - "/scipy-" version ".tar.xz")) + (uri (string-append "https://github.com/scipy/scipy/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "0wa0a4skpda3gx7lb12yn19nhbairlyxrvda2lz2bcawk3x5qzz2")))) + "17slsrfawjp7if6qrlx03zhgp05350ginxx8ddpw9zqx43x905sn")))) (build-system python-build-system) (propagated-inputs `(("python-numpy" ,python-numpy) @@ -4068,21 +4068,16 @@ functions.") `(("lapack" ,lapack) ("openblas" ,openblas))) (native-inputs - `(("python-nose" ,python-nose) - ("python-sphinx" ,python-sphinx-1.2.3) + `(("python-cython" ,python-cython) + ("python-nose" ,python-nose) + ("python-sphinx" ,python-sphinx) ("python-numpydoc" ,python-numpydoc) ("gfortran" ,gfortran) - ("texlive" ,texlive) ("perl" ,perl))) (outputs '("out" "doc")) (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'fix-tests - (lambda _ - (substitute* "scipy/integrate/tests/test_quadpack.py" - (("libm.so") "libm.so.6")) - #t)) (add-before 'build 'configure-openblas (lambda* (#:key inputs #:allow-other-keys) (call-with-output-file "site.cfg" @@ -4102,40 +4097,44 @@ atlas_libs = openblas (assoc-ref inputs "openblas") (assoc-ref inputs "openblas")))) #t)) - (delete 'check) - (add-after 'install 'install-doc - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((data (string-append (assoc-ref outputs "doc") "/share")) - (doc (string-append data "/doc/" ,name "-" ,version)) - (html (string-append doc "/html")) - (pyver ,(string-append "PYVER="))) - ;; Make installed package available for building the - ;; documentation - (add-installed-pythonpath inputs outputs) - (with-directory-excursion "doc" - ;; Fix generation of images for mathematical expressions. - (substitute* (find-files "source" "conf\\.py") - (("pngmath_use_preview = True") - "pngmath_use_preview = False")) - (mkdir-p html) - (system* "make" "html" pyver) - (system* "make" "latex" "PAPER=a4" pyver) - (system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" pyver) - (copy-file "build/latex/scipy-ref.pdf" - (string-append doc "/scipy-ref.pdf")) - (with-directory-excursion "build/html" - (for-each (lambda (file) - (let* ((dir (dirname file)) - (tgt-dir (string-append html "/" dir))) - (install-file file html))) - (find-files "." ".*")))) - #t))) - (add-after 'install-doc 'check - (lambda _ - ;; Tests can only be run after the library has been installed and not - ;; within the source directory. - (with-directory-excursion "/tmp" - (zero? (system* "python" "-c" "import scipy; scipy.test()")))))))) + (add-after 'install 'install-doc + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((data (string-append (assoc-ref outputs "doc") "/share")) + (doc (string-append data "/doc/" ,name "-" ,version)) + (html (string-append doc "/html")) + (pyver ,(string-append "PYVER="))) + ;; Make installed package available for building the + ;; documentation + (add-installed-pythonpath inputs outputs) + (with-directory-excursion "doc" + ;; Fix generation of images for mathematical expressions. + (substitute* (find-files "source" "conf\\.py") + (("pngmath_use_preview = True") + "pngmath_use_preview = False")) + (mkdir-p html) + (system* "make" "html" pyver) + (with-directory-excursion "build/html" + (for-each (lambda (file) + (let* ((dir (dirname file)) + (tgt-dir (string-append html "/" dir))) + (install-file file html))) + (find-files "." ".*"))))) + #t)) + (add-after 'unpack 'fix-tests + (lambda _ + (substitute* "scipy/integrate/tests/test_quadpack.py" + (("libm.so") "libm.so.6")) + #t)) + ;; Tests can only be run after the library has been installed and not + ;; within the source directory. + (delete 'check) + (add-after 'install 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs) + (with-directory-excursion "/tmp" + (zero? (system* "python" "-c" + "import scipy; scipy.test('full')"))) + #t))))) (home-page "http://www.scipy.org/") (synopsis "The Scipy library provides efficient numerical routines") (description "The SciPy library is one of the core packages that make up @@ -4145,15 +4144,8 @@ routines such as routines for numerical integration and optimization.") (license license:bsd-3))) (define-public python2-scipy - (let ((scipy (package-with-python2 - (strip-python2-variant python-scipy)))) - (package (inherit scipy) - ;; Make sure to use special packages for Python 2 instead - ;; of those automatically rewritten by package-with-python2. - (native-inputs - `(("python2-sphinx" ,python2-sphinx-1.2.3) - ,@(fold alist-delete (package-native-inputs scipy) - '("python-sphinx"))))))) + (package-with-python2 + (strip-python2-variant python-scipy))) (define-public python-socksipy-branch (package -- 2.11.1 From f48c4ae867e21f0843bd1487a9c1cc54bd2d78d6 Mon Sep 17 00:00:00 2001 From: Thomas Danckaert <thomas.danckaert <at> gmail.com> Date: Sat, 25 Feb 2017 23:35:22 +0100 Subject: [PATCH 9/9] gnu: Remove python-sphinx-1.2.3. * gnu/packages/python.scm (python-sphinx-1.2.3, python2-sphinx-1.2.3): Remove variables. --- gnu/packages/python.scm | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index f164fff13..22c4d7aae 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3029,24 +3029,6 @@ sources.") (propagated-inputs `(("python2-pytz" ,python2-pytz) ,@(package-propagated-inputs base)))))) -;; This is needed for python-matplotlib <at> 1.4 and python-scipy <at> 0.16, at least. -;; Try removing this when they are updated. -(define-public python-sphinx-1.2.3 - (package (inherit python-sphinx) - (version "1.2.3") - (source (origin - (method url-fetch) - (uri (pypi-uri "Sphinx" version)) - (sha256 - (base32 - "011xizm3jnmf4cvs5i6kgf6c5nn046h79i8j0vd0f27yw9j3p4wl")))) - ;; XXX: "'NoneType' object has no attribute 'split'". - (arguments '(#:tests? #f)))) - -(define-public python2-sphinx-1.2.3 - (package (inherit (package-with-python2 - (strip-python2-variant python-sphinx-1.2.3))))) - (define-public python-sphinx-rtd-theme (package (name "python-sphinx-rtd-theme") -- 2.11.1
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.