From 0da98533602d37f008c2d3736182b2014618e81b Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Mon, 24 Nov 2014 20:51:29 +0100 Subject: gnu: Add numpy-bootstrap. * gnu/packages/python.scm (python-numpy-bootstrap, python2-numpy-bootstrap): New file-local variables. --- gnu/packages/python.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 378660482f..7967201f17 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -35,6 +35,8 @@ #:use-module (gnu packages readline) #:use-module (gnu packages openssl) #:use-module (gnu packages elf) + #:use-module (gnu packages maths) + #:use-module (gnu packages gcc) #:use-module (gnu packages pkg-config) #:use-module (gnu packages databases) #:use-module (gnu packages zip) @@ -1873,3 +1875,60 @@ writing C extensions for Python as easy as Python itself.") (name "python2-cython") (inputs `(("python-2" ,python-2))))) ; this is not automatically changed + +;; 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 + (package + (name "python-numpy-bootstrap") + (version "1.9.1") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/numpy" + "/numpy-" version ".tar.gz")) + (sha256 + (base32 + "070ybfvpgfmiz2hs94x445hvkh9dh52nyi0m8jp5kdihgvhbnx80")))) + (build-system python-build-system) + (inputs + `(("python-nose" ,python-nose) + ("atlas" ,atlas))) + (native-inputs + `(("gfortran" ,gfortran-4.8))) + (arguments + `(#:phases + (alist-cons-before + 'build 'set-environment-variables + (lambda* (#:key inputs #:allow-other-keys) + (let* ((atlas-threaded + (string-append (assoc-ref inputs "atlas") + "/lib/libtatlas.so")) + ;; On single core CPUs only the serial library is created. + (atlas-lib + (if (file-exists? atlas-threaded) + atlas-threaded + (string-append (assoc-ref inputs "atlas") + "/lib/libsatlas.so")))) + (setenv "ATLAS" atlas-lib))) + ;; Tests can only be run after the library has been installed and not + ;; within the source directory. + (alist-cons-after + 'install 'check + (lambda _ + (with-directory-excursion "/tmp" + (zero? (system* "python" "-c" "import numpy; numpy.test()")))) + (alist-delete + 'check + %standard-phases))))) + (home-page "http://www.numpy.org/") + (synopsis "Fundamental package for scientific computing with Python") + (description "NumPy is the fundamental package for scientific computing +with Python. It contains among other things: a powerful N-dimensional array +object, sophisticated (broadcasting) functions, tools for integrating C/C++ +and Fortran code, useful linear algebra, Fourier transform, and random number +capabilities.") + (license bsd-3))) + +(define python2-numpy-bootstrap + (package-with-python2 python-numpy-bootstrap)) -- cgit 1.4.1 From 15bfe6d63561bf9fbcaf9763a8cbc102dba242f1 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Tue, 25 Nov 2014 16:27:33 +0100 Subject: gnu: Add pyparsing. * gnu/packages/python.scm (python-pyparsing, python2-pyparsing): New variables. --- gnu/packages/python.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 7967201f17..c0eea3c631 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -1932,3 +1932,52 @@ capabilities.") (define python2-numpy-bootstrap (package-with-python2 python-numpy-bootstrap)) + +(define-public python-pyparsing + (package + (name "python-pyparsing") + (version "2.0.2") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/pyparsing" + "/pyparsing-" version ".tar.gz")) + (sha256 + (base32 + "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p")))) + (build-system python-build-system) + (outputs '("out" "doc")) + (arguments + `(#:tests? #f ; no test target + #:modules ((guix build python-build-system) + (guix build utils)) + #:phases + (alist-cons-after + 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((doc (string-append (assoc-ref outputs "doc") + "/share/doc/" ,name "-" ,version)) + (html-doc (string-append doc "/html")) + (examples (string-append doc "/examples"))) + (mkdir-p html-doc) + (mkdir-p examples) + (for-each + (lambda (dir tgt) + (map (lambda (file) + (copy-file file (string-append tgt "/" (basename file)))) + (find-files dir ".*"))) + (list "docs" "htmldoc" "examples") + (list doc html-doc examples)))) + %standard-phases))) + (home-page "http://pyparsing.wikispaces.com") + (synopsis "Python parsing class library") + (description + "The pyparsing module is an alternative approach to creating and +executing simple grammars, vs. the traditional lex/yacc approach, or the use +of regular expressions. The pyparsing module provides a library of classes +that client code uses to construct the grammar directly in Python code.") + (license expat))) + +(define-public python2-pyparsing + (package-with-python2 python-pyparsing)) + -- cgit 1.4.1 From ec00de358ed0df0a82b8520407f5e1440973ac93 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Wed, 26 Nov 2014 17:29:16 +0100 Subject: gnu: Add numpydoc. * gnu/packages/python.scm (python-numpydoc, python2-numpydoc): New variables. --- gnu/packages/python.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index c0eea3c631..68dc67f1f2 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -1981,3 +1981,37 @@ that client code uses to construct the grammar directly in Python code.") (define-public python2-pyparsing (package-with-python2 python-pyparsing)) +(define-public python-numpydoc + (package + (name "python-numpydoc") + (version "0.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/source/n/numpydoc/numpydoc-" + version ".tar.gz")) + (sha256 + (base32 + "0d4dnifaxkll50jx6czj05y8cb4ny60njd2wz299sj2jxfy51w4k")))) + (build-system python-build-system) + (inputs + `(("python-setuptools" ,python-setuptools) + ("python-docutils" ,python-docutils) + ("python-sphinx" ,python-sphinx) + ("python-nose" ,python-nose))) + (home-page "https://pypi.python.org/pypi/numpydoc") + (synopsis + "Numpy's Sphinx extensions") + (description + "Sphinx extension to support docstrings in Numpy format.") + (license bsd-2))) + +(define-public python2-numpydoc + (package + (inherit (package-with-python2 python-numpydoc)) + ;; With python-2 1 test (out of 30) fails because it doesn't find + ;; matplotlib. With python-3 it seems to detect at run-time the absence + ;; of matplotlib. + (arguments `(#:tests? #f + #:python ,python-2)))) -- cgit 1.4.1 From 1c65314c60405333dde009d8c8d2e37a0a465b6f Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Thu, 27 Nov 2014 20:11:53 +0100 Subject: gnu: Add matplotlib. * gnu/packages/python.scm (python-matplotlib, python2-matplotlib): New variables. --- gnu/packages/python.scm | 102 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 68dc67f1f2..dad68fdde5 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -41,12 +41,18 @@ #:use-module (gnu packages databases) #:use-module (gnu packages zip) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages texlive) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages image) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages fontutils) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system python) - #:use-module (guix build-system trivial)) + #:use-module (guix build-system trivial) + #:use-module (srfi srfi-1)) (define-public python-2 (package @@ -2015,3 +2021,97 @@ that client code uses to construct the grammar directly in Python code.") ;; of matplotlib. (arguments `(#:tests? #f #:python ,python-2)))) + +(define-public python-matplotlib + (package + (name "python-matplotlib") + (version "1.4.2") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/matplotlib" + "/matplotlib-" version ".tar.gz")) + (sha256 + (base32 + "0m6v9nwdldlwk22gcd339zg6mny5m301fxgks7z8sb8m9wawg8qp")))) + (build-system python-build-system) + (outputs '("out" "doc")) + (inputs + `(("python-setuptools" ,python-setuptools) + ("python-dateutil" ,python-dateutil-2) + ("python-pyparsing" ,python-pyparsing) + ("python-six" ,python-six) + ("python-pytz" ,python-pytz) + ("python-numpy" ,python-numpy-bootstrap) + ("python-sphinx" ,python-sphinx) + ("python-numpydoc" ,python-numpydoc) + ("python-nose" ,python-nose) + ("python-mock" ,python-mock) + ("libpng" ,libpng) + ("imagemagick" ,imagemagick) + ("freetype" ,freetype) + ;; FIXME: Add backends when available. + ;("python-pygtk" ,python-pygtk) + ;("python-pycairo" ,python-pycairo) + ;("python-pygobject" ,python-pygobject) + ;("python-wxpython" ,python-wxpython) + ;("python-pyqt" ,python-pyqt) + )) + (native-inputs + `(("pkg-config" ,pkg-config) + ("texlive" ,texlive) + ("texinfo" ,texinfo))) + (arguments + `(#:phases + (alist-cons-after + 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((data (string-append (assoc-ref outputs "doc") "/share")) + (doc (string-append data "/doc/" ,name "-" ,version)) + (info (string-append data "/info")) + (html (string-append doc "/html"))) + (with-directory-excursion "doc" + ;; Without setting this variable we get an encoding error. + (setenv "LANG" "en_US.UTF-8") + ;; Produce pdf in 'A4' format. + (substitute* (find-files "." "conf\\.py") + (("latex_paper_size = 'letter'") + "latex_paper_size = 'a4'")) + (mkdir-p html) + (mkdir-p info) + ;; The doc recommends to run the 'html' target twice. + (system* "python" "make.py" "html") + (system* "python" "make.py" "html") + (system* "python" "make.py" "latex") + (system* "python" "make.py" "texinfo") + (copy-file "build/texinfo/matplotlib.info" + (string-append info "/matplotlib.info")) + (copy-file "build/latex/Matplotlib.pdf" + (string-append doc "/Matplotlib.pdf")) + (with-directory-excursion "build/html" + (map (lambda (file) + (let* ((dir (dirname file)) + (tgt-dir (string-append html "/" dir))) + (unless (equal? "." dir) + (mkdir-p tgt-dir)) + (copy-file file (string-append html "/" file)))) + (find-files "." ".*")))))) + %standard-phases))) + (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 psfl))) + +(define-public python2-matplotlib + (let ((matplotlib (package-with-python2 python-matplotlib))) + (package (inherit matplotlib) + ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is + ;; customized for Python 2. + (inputs `(("python2-numpydoc" ,python2-numpydoc) + ,@(alist-delete "python-numpydoc" + (package-inputs matplotlib))))))) -- cgit 1.4.1 From 2ee8869a694803e582e203208d04a0725bfc8241 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Mon, 1 Dec 2014 13:28:24 +0100 Subject: gnu: Add numpy. * gnu/packages/python.scm (python-numpy, python2-numpy): New variables. --- gnu/packages/python.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index dad68fdde5..88f892799f 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -46,6 +46,8 @@ #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) #:use-module (gnu packages fontutils) + #:use-module (gnu packages which) + #:use-module (gnu packages perl) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) @@ -1939,6 +1941,75 @@ capabilities.") (define python2-numpy-bootstrap (package-with-python2 python-numpy-bootstrap)) +(define-public python-numpy + (package (inherit python-numpy-bootstrap) + (name "python-numpy") + (outputs '("out" "doc")) + (inputs + `(("which" ,which) + ("python-setuptools" ,python-setuptools) + ("python-matplotlib" ,python-matplotlib) + ("python-sphinx" ,python-sphinx) + ("python-pyparsing" ,python-pyparsing) + ("python-numpydoc" ,python-numpydoc) + ,@(package-inputs python-numpy-bootstrap))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("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 outputs #:allow-other-keys) + (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)) + (copy-file file (string-append html "/" file)))) + (find-files "." ".*")))))) + ,phases))))))) + +(define-public python2-numpy + (let ((numpy (package-with-python2 python-numpy))) + (package (inherit numpy) + ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is customized for + ;; Python 2. Since it is also an input to PYTHON2-MATPLOTLIB, we need to + ;; import the right version of 'matplotlib' as well. + (inputs `(("python2-numpydoc" ,python2-numpydoc) + ("python2-matplotlib" ,python2-matplotlib) + ,@(alist-delete "python-numpydoc" + (alist-delete "python-matplotlib" + (package-inputs numpy)))))))) + (define-public python-pyparsing (package (name "python-pyparsing") -- cgit 1.4.1 From b88e1b0a626aa434e3934732392140dc9e919dd6 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Mon, 17 Nov 2014 19:36:01 -0600 Subject: gnu: python: Add sqlite input. * gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch, gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch: New patches. * gnu-system.am (dist_patch_DATA): Add them. * gnu/packages/python.scm (python-2)[source]: Add patch. [inputs]: Add sqlite. (python)[source]: Add patch. --- gnu-system.am | 2 ++ gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch | 15 +++++++++++++++ gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch | 15 +++++++++++++++ gnu/packages/python.scm | 8 +++++++- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch create mode 100644 gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch (limited to 'gnu/packages/python.scm') diff --git a/gnu-system.am b/gnu-system.am index f7532f0164..161580f43f 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -417,6 +417,8 @@ dist_patch_DATA = \ gnu/packages/patches/pybugz-stty.patch \ gnu/packages/patches/python-fix-tests.patch \ gnu/packages/patches/python-libffi-mips-n32-fix.patch \ + gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch \ + gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch \ gnu/packages/patches/qt4-tests.patch \ gnu/packages/patches/ratpoison-shell.patch \ gnu/packages/patches/readline-link-ncurses.patch \ diff --git a/gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch b/gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch new file mode 100644 index 0000000000..2f8b159870 --- /dev/null +++ b/gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch @@ -0,0 +1,15 @@ +From resolution of upstream python issue #20901: http://bugs.python.org/issue20901 + +diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py +--- Lib/sqlite3/test/hooks.py ++++ Lib/sqlite3/test/hooks.py +@@ -162,7 +162,7 @@ class ProgressTests(unittest.TestCase): + create table bar (a, b) + """) + second_count = len(progress_calls) +- self.assertGreater(first_count, second_count) ++ self.assertGreaterEqual(first_count, second_count) + + def CheckCancelOperation(self): + """ + diff --git a/gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch b/gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch new file mode 100644 index 0000000000..f121e8852a --- /dev/null +++ b/gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch @@ -0,0 +1,15 @@ +From resolution of upstream python issue #20901: http://bugs.python.org/issue20901 + +diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py +--- Lib/sqlite3/test/hooks.py ++++ Lib/sqlite3/test/hooks.py +@@ -162,7 +162,7 @@ class ProgressTests(unittest.TestCase): + create table bar (a, b) + """) + second_count = len(progress_calls) +- self.assertTrue(first_count > second_count) ++ self.assertGreaterEqual(first_count, second_count) + + def CheckCancelOperation(self): + """ + diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 88f892799f..de60dca0a0 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -65,7 +65,8 @@ (method url-fetch) (uri (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) - (patches (list (search-patch "python-libffi-mips-n32-fix.patch"))) + (patches (list (search-patch "python-libffi-mips-n32-fix.patch") + (search-patch "python2-sqlite-3.8.4-test-fix.patch"))) (patch-flags '("-p0")) (sha256 (base32 @@ -119,6 +120,7 @@ (let ((bz2 (assoc-ref %build-inputs "bzip2")) (gdbm (assoc-ref %build-inputs "gdbm")) (libffi (assoc-ref %build-inputs "libffi")) + (sqlite (assoc-ref %build-inputs "sqlite")) (openssl (assoc-ref %build-inputs "openssl")) (readline (assoc-ref %build-inputs "readline")) (zlib (assoc-ref %build-inputs "zlib"))) @@ -127,6 +129,7 @@ (string-append "CPPFLAGS=" "-I" bz2 "/include " "-I" gdbm "/include " + "-I" sqlite "/include " "-I" openssl "/include " "-I" readline "/include " "-I" zlib "/include") @@ -134,6 +137,7 @@ "-L" bz2 "/lib " "-L" gdbm "/lib " "-L" libffi "/lib " + "-L" sqlite "/lib " "-L" openssl "/lib " "-L" readline "/lib " "-L" zlib "/lib"))) @@ -177,6 +181,7 @@ `(("bzip2" ,bzip2) ("gdbm" ,gdbm) ("libffi" ,libffi) ; for ctypes + ("sqlite" ,sqlite) ; for sqlite extension ("openssl" ,openssl) ("readline" ,readline) ("zlib" ,zlib) @@ -208,6 +213,7 @@ data types.") (uri (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) (patches (list (search-patch "python-fix-tests.patch") + (search-patch "python-sqlite-3.8.4-test-fix.patch") (search-patch "python-libffi-mips-n32-fix.patch"))) (patch-flags '("-p0")) (sha256 -- cgit 1.4.1 From 94914805c2501928c0d23fc8632a36ad4036fb9c Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 18 Nov 2014 18:31:57 -0600 Subject: gnu: Add python-sqlalchemy. * gnu/packages/python.scm (python-sqlalchemy, python2-sqlalchemy): New variables. --- gnu/packages/python.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index de60dca0a0..e8c80b2216 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2192,3 +2192,38 @@ toolkits.") (inputs `(("python2-numpydoc" ,python2-numpydoc) ,@(alist-delete "python-numpydoc" (package-inputs matplotlib))))))) + +(define-public python-sqlalchemy + (package + (name "python-sqlalchemy") + (version "0.9.7") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/S/" + "SQLAlchemy/SQLAlchemy-" version ".tar.gz")) + (sha256 + (base32 + "059ayifj5l08v6vv56anhyibyllscn10dlzr2fcw68gz1hfjdzsz")))) + (build-system python-build-system) + (native-inputs + `(("python-cython" ,python-cython) ;for c extensions + ("python-pytest" ,python-pytest) + ("python-mock" ,python-mock))) ;for tests + (arguments + `(#:phases (alist-replace + 'check + (lambda _ (zero? (system* "py.test"))) + %standard-phases))) + (home-page "http://www.sqlalchemy.org") + (synopsis "Database abstraction library") + (description + "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that +gives application developers the full power and flexibility of SQL. It +provides a full suite of well known enterprise-level persistence patterns, +designed for efficient and high-performing database access, adapted into a +simple and Pythonic domain language.") + (license x11))) + +(define-public python2-sqlalchemy + (package-with-python2 python-sqlalchemy)) -- cgit 1.4.1 From c937562e2fd2f27c2adcd2b1c78a43c2587c0efe Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Nov 2014 22:34:57 -0600 Subject: gnu: Add python-pillow. * gnu/packages/python.scm (python-pillow, python2-pillow): New variables. --- gnu/packages/python.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index e8c80b2216..0e9d7923ea 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -31,6 +31,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages gdbm) #:use-module (gnu packages icu4c) + #:use-module (gnu packages image) #:use-module (gnu packages libffi) #:use-module (gnu packages readline) #:use-module (gnu packages openssl) @@ -40,6 +41,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages databases) #:use-module (gnu packages zip) + #:use-module (gnu packages ghostscript) #:use-module (gnu packages multiprecision) #:use-module (gnu packages texlive) #:use-module (gnu packages texinfo) @@ -2227,3 +2229,53 @@ simple and Pythonic domain language.") (define-public python2-sqlalchemy (package-with-python2 python-sqlalchemy)) + +(define-public python-pillow + (package + (name "python-pillow") + (version "2.6.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/P/" + "Pillow/Pillow-" version ".tar.gz")) + (sha256 + (base32 + "0iw36c73wkhz88wa78v6l43llsb080ihw8yq7adhfqxdib7l4hzr")))) + (build-system python-build-system) + (native-inputs + `(("python-setuptools" ,python-setuptools) + ("python-nose" ,python-nose))) + (inputs + `(("lcms" ,lcms) + ("zlib" ,zlib) + ("libjpeg" ,libjpeg) + ("openjpeg" ,openjpeg) + ("libtiff" ,libtiff))) + (propagated-inputs + `(;; Used at runtime for pkg_resources + ("python-setuptools" ,python-setuptools))) + (arguments + `(#:phases (alist-cons-after + 'install 'check-installed + (lambda _ + (begin + (setenv "HOME" (getcwd)) + (and (zero? (system* "python" "selftest.py" "--installed")) + (zero? (system* "python" "test-installed.py"))))) + (alist-delete 'check %standard-phases)))) + (home-page "https://pypi.python.org/pypi/Pillow") + (synopsis "Fork of the Python Imaging Library") + (description + "The Python Imaging Library adds image processing capabilities to your +Python interpreter. This library provides extensive file format support, an +efficient internal representation, and fairly powerful image processing +capabilities. The core image library is designed for fast access to data +stored in a few basic pixel formats. It should provide a solid foundation for +a general image processing tool.") + (license (x11-style + "http://www.pythonware.com/products/pil/license.htm" + "The PIL Software License")))) + +(define-public python2-pillow + (package-with-python2 python-pillow)) -- cgit 1.4.1 From 1671c07cc713525bd91d5e0a704e01b5d423c0ba Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Nov 2014 22:35:41 -0600 Subject: gnu: Add python-distutils-extra. * gnu/packages/python.scm (python-distutils-extra, python2-distutils-extra): New variables. --- gnu/packages/python.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 0e9d7923ea..d024c1c360 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2230,6 +2230,32 @@ simple and Pythonic domain language.") (define-public python2-sqlalchemy (package-with-python2 python-sqlalchemy)) +(define-public python-distutils-extra + (package + (name "python-distutils-extra") + (version "2.38") + (source + (origin + (method url-fetch) + (uri (string-append "https://launchpad.net/python-distutils-extra/trunk/" + version "/+download/python-distutils-extra-" + version ".tar.gz")) + (sha256 + (base32 + "0lx15kcbby9zisx33p2h5hgakgwh2bvh0ibag8z0px4j6ifhs41x")))) + (build-system python-build-system) + (native-inputs + `(("python-setuptools" ,python-setuptools))) + (home-page "https://launchpad.net/python-distutils-extra/") + (synopsis "Enhancements to Python's distutils") + (description + "The python-distutils-extra module enables you to easily integrate +gettext support, themed icons, and scrollkeeper-based documentation into +Python's distutils.") + (license gpl2))) + +(define-public python2-distutils-extra + (package-with-python2 python-distutils-extra)) (define-public python-pillow (package (name "python-pillow") -- cgit 1.4.1 From ea5456c88cc79809035f2e95769aec96cb733095 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Nov 2014 22:36:34 -0600 Subject: gnu: Add python-elib.intl. * gnu/packages/python.scm (python-elib.intl, python2-elib.intl): New variables. --- gnu/packages/python.scm | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index d024c1c360..3b0e97e8fc 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -24,7 +24,7 @@ (define-module (gnu packages python) #:use-module ((guix licenses) #:select (asl2.0 bsd-3 bsd-2 bsd-style cc0 expat x11 x11-style - gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1+ + gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1+ lgpl3+ psfl public-domain)) #:use-module ((guix licenses) #:select (zlib) #:prefix license:) #:use-module (gnu packages) @@ -52,6 +52,7 @@ #:use-module (gnu packages perl) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system python) @@ -2256,6 +2257,41 @@ Python's distutils.") (define-public python2-distutils-extra (package-with-python2 python-distutils-extra)) + +(define-public python2-elib.intl + (package + (name "python2-elib.intl") + (version "0.0.3") + (source + (origin + ;; This project doesn't tag releases or publish tarballs, so we take + ;; source from a (semi-arbitrary, i.e. latest as of now) git commit. + (method git-fetch) + (uri (git-reference + (url "https://github.com/dieterv/elib.intl.git") + (commit "d09997cfef"))) + (sha256 + (base32 + "0y7vzff9xgbnaay7m0va1arl6g68ncwrvbgwl7jqlclsahzzb09d")))) + (build-system python-build-system) + (native-inputs + `(("python2-setuptools" ,python2-setuptools))) + (arguments + ;; incompatible with Python 3 (exception syntax) + `(#:python ,python-2 + #:tests? #f + ;; With standard flags, the install phase attempts to create a zip'd + ;; egg file, and fails with an error: 'ZIP does not support timestamps + ;; before 1980' + #:configure-flags '("--single-version-externally-managed" + "--record=elib.txt"))) + (home-page "https://github.com/dieterv/elib.intl") + (synopsis "Enhanced internationalization for Python") + (description + "The elib.intl module provides enhanced internationalization (I18N) +services for your Python modules and applications.") + (license lgpl3+))) + (define-public python-pillow (package (name "python-pillow") -- cgit 1.4.1 From fbcfa730744648bcd894c4fc15ef179d6a668d84 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Nov 2014 22:37:23 -0600 Subject: gnu: Add python-pycairo. * gnu/packages/gtk.scm (python-pycairo, python2-py2cairo): New variables. --- gnu/packages/gtk.scm | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ gnu/packages/python.scm | 2 +- 2 files changed, 107 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 15d6ab441b..862f6ccce3 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -634,3 +634,109 @@ extensive documentation, including API reference and a tutorial.") ("atkmm" ,atkmm) ("gtk+" ,gtk+-2) ("glibmm" ,glibmm))))) + +(define-public python-pycairo + (package + (name "python-pycairo") + (version "1.10.0") + (source + (origin + (method url-fetch) + (uri (string-append "http://cairographics.org/releases/pycairo-" + version ".tar.bz2")) + (sha256 + (base32 + "1gjkf8x6hyx1skq3hhwcbvwifxvrf9qxis5vx8x5igmmgs70g94s")))) + (build-system python-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (propagated-inputs ;pycairo.pc references cairo + `(("cairo" ,cairo))) + (arguments + `(#:tests? #f + #:phases (alist-cons-before + 'build 'configure + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "./waf" "configure" + (string-append "--prefix=" + (assoc-ref outputs "out"))))) + (alist-replace + 'build + (lambda _ + (zero? (system* "./waf" "build"))) + (alist-replace + 'install + (lambda _ + (zero? (system* "./waf" "install"))) + %standard-phases))))) + (home-page "http://cairographics.org/pycairo/") + (synopsis "Python bindings for cairo") + (description + "Pycairo is a set of Python bindings for the Cairo graphics library.") + (license license:lgpl3+))) + +(define-public python2-py2cairo + (package (inherit python-pycairo) + (name "python2-py2cairo") + (version "1.10.0") + (source + (origin + (method url-fetch) + (uri (string-append "http://cairographics.org/releases/py2cairo-" + version ".tar.bz2")) + (sha256 + (base32 + "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k")))) + (arguments + `(#:python ,python-2 + ,@(package-arguments python-pycairo))) + ;; Dual-licensed under LGPL 2.1 or Mozilla Public License 1.1 + (license '(license:lgpl2.1 license:mpl1.1)))) + +(define-public python2-pygtk + (package + (name "python2-pygtk") + (version "2.24.0") + (source + (origin + (method url-fetch) + (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources" + "/pygtk/" (version-major+minor version) + "/pygtk-" version ".tar.bz2")) + (sha256 + (base32 + "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("python" ,python-2) + ("glib" ,glib))) + (propagated-inputs + `(("python-pycairo" ,python2-py2cairo) ;loaded at runtime + ("python-pygobject" ,python2-pygobject-2) ;referenced in pc file + ("gtk+" ,gtk+-2))) + (arguments + `(#:tests? #f + #:phases (alist-cons-after + 'install 'install-pth + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; pygtk's modules are stored in a subdirectory of python's + ;; site-packages directory. Add a .pth file so that python + ;; will add that subdirectory to its module search path. + (let* ((out (assoc-ref outputs "out")) + (site (string-append out "/lib/python" + ,(version-major+minor + (package-version python-2)) + "/site-packages"))) + (call-with-output-file (string-append site "/pygtk.pth") + (lambda (port) + (format port "gtk-2.0~%"))))) + %standard-phases))) + (home-page "http://www.pygtk.org/") + (synopsis "Python bindings for GTK+") + (description + "PyGTK allows you to write full featured GTK programs in Python. It is +targetted at GTK 2.x, and can be used in conjunction with gnome-python to +write GNOME applications.") + (license license:lgpl2.1+))) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 3b0e97e8fc..b9c6b74167 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -24,7 +24,7 @@ (define-module (gnu packages python) #:use-module ((guix licenses) #:select (asl2.0 bsd-3 bsd-2 bsd-style cc0 expat x11 x11-style - gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1+ lgpl3+ + gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ psfl public-domain)) #:use-module ((guix licenses) #:select (zlib) #:prefix license:) #:use-module (gnu packages) -- cgit 1.4.1 From bb986599e6967f0a990f78b57a886970981cf9f8 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Wed, 3 Dec 2014 21:15:55 +0100 Subject: gnu: Add scipy. * gnu/packages/python.scm (python-scipy, python2-scipy): New variables. --- gnu/packages/python.scm | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index b9c6b74167..c9f9b16cfe 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2196,6 +2196,113 @@ toolkits.") ,@(alist-delete "python-numpydoc" (package-inputs matplotlib))))))) +;; Scipy 0.14.0 with Numpy 0.19.X fails several tests. This is known and +;; planned to be fixed in 0.14.1. It is claimed that the failures can safely +;; be ignored: +;; http://mail.scipy.org/pipermail/scipy-dev/2014-September/020043.html +;; https://github.com/scipy/scipy/issues/3853 +;; +;; The main test suite procedure prints the summary message: +;; +;; Ran 16412 tests in 245.033s +;; FAILED (KNOWNFAIL=277, SKIP=921, errors=327, failures=42) +;; +;; However, it still does return normally. +(define-public python-scipy + (package + (name "python-scipy") + (version "0.14.0") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/scipy" + "/scipy-" version ".tar.gz")) + (sha256 + (base32 + "053bmz4qmnk4dmxvspfak8r10rpmy6mzwfzgy33z338ppzka6hab")))) + (build-system python-build-system) + (inputs + `(("python-numpy" ,python-numpy) + ("python-matplotlib" ,python-matplotlib) + ("python-pyparsing" ,python-pyparsing) + ("python-nose" ,python-nose) + ("python-sphinx" ,python-sphinx) + ("atlas" ,atlas))) + (native-inputs + `(("gfortran" ,gfortran-4.8) + ("texlive" ,texlive) + ("perl" ,perl))) + (outputs '("out" "doc")) + (arguments + `(#:phases + (alist-cons-before + 'build 'set-environment-variables + (lambda* (#:key inputs #:allow-other-keys) + (let* ((atlas-threaded + (string-append (assoc-ref inputs "atlas") + "/lib/libtatlas.so")) + ;; On single core CPUs only the serial library is created. + (atlas-lib + (if (file-exists? atlas-threaded) + atlas-threaded + (string-append (assoc-ref inputs "atlas") + "/lib/libsatlas.so")))) + (setenv "ATLAS" atlas-lib))) + (alist-cons-after + 'install 'install-doc + (lambda* (#:key 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="))) + (with-directory-excursion "doc" + ;; Without setting this variable we get an encoding error. + (setenv "LANG" "en_US.UTF-8") + ;; 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))) + (unless (equal? "." dir) + (mkdir-p tgt-dir)) + (copy-file file (string-append html "/" file)))) + (find-files "." ".*")))))) + ;; Tests can only be run after the library has been installed and not + ;; within the source directory. + (alist-cons-after + 'install 'check + (lambda _ + (with-directory-excursion "/tmp" + (zero? (system* "python" "-c" "import scipy; scipy.test()")))) + (alist-delete + 'check + %standard-phases)))))) + (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 +the SciPy stack. It provides many user-friendly and efficient numerical +routines such as routines for numerical integration and optimization.") + (license bsd-3))) + +(define-public python2-scipy + (let ((scipy (package-with-python2 python-scipy))) + (package (inherit scipy) + ;; Use packages customized for python-2. + (inputs `(("python2-matplotlib" ,python2-matplotlib) + ("python2-numpy" ,python2-numpy) + ,@(alist-delete "python-matplotlib" + (alist-delete "python-numpy" + (package-inputs scipy)))))))) + (define-public python-sqlalchemy (package (name "python-sqlalchemy") @@ -2341,3 +2448,4 @@ a general image processing tool.") (define-public python2-pillow (package-with-python2 python-pillow)) + -- cgit 1.4.1 From a415f036e89b375c82cbaea8f783430788d0012f Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Mon, 8 Dec 2014 10:08:00 +0100 Subject: gnu: Add pycparser. * gnu/packages/python.scm (python-pycparser, python2-pycparser): New variables. --- gnu/packages/python.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index c9f9b16cfe..c30cffa68c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2449,3 +2449,50 @@ a general image processing tool.") (define-public python2-pillow (package-with-python2 python-pillow)) +(define-public python-pycparser + (package + (name "python-pycparser") + (version "2.10") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/p/" + "pycparser/pycparser-" version ".tar.gz")) + (sha256 + (base32 + "0v5qfq03yvd1pi0dwlgfai0p3dh9bq94pydn19c4pdn0c6v9hzcm")))) + (outputs '("out" "doc")) + (build-system python-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-setuptools" ,python-setuptools))) + (arguments + `(#:phases + (alist-replace + 'check + (lambda _ + (with-directory-excursion "tests" + (zero? (system* "python" "all_tests.py")))) + (alist-cons-after + 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((data (string-append (assoc-ref outputs "doc") "/share")) + (doc (string-append data "/doc/" ,name "-" ,version)) + (examples (string-append doc "/examples"))) + (mkdir-p examples) + (for-each (lambda (file) + (copy-file (string-append "." file) + (string-append doc file))) + '("/README.rst" "/CHANGES" "/LICENSE")) + (copy-recursively "examples" examples))) + %standard-phases)))) + (home-page "https://github.com/eliben/pycparser") + (synopsis "C parser in Python") + (description + "Pycparser is a complete parser of the C language, written in pure Python +using the PLY parsing library. It parses C code into an AST and can serve as +a front-end for C compilers or analysis tools.") + (license bsd-3))) + +(define-public python2-pycparser + (package-with-python2 python-pycparser)) -- cgit 1.4.1 From 57c3f71632692d1e2e12e5d2db5c2cc4c6e075c9 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Tue, 9 Dec 2014 15:58:24 +0100 Subject: gnu: Add cffi. * gnu/packages/python.scm (python-cffi, python2-cffi): New variables. --- gnu/packages/python.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index c30cffa68c..67effe77d6 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2496,3 +2496,48 @@ a front-end for C compilers or analysis tools.") (define-public python2-pycparser (package-with-python2 python-pycparser)) + +(define-public python-cffi + (package + (name "python-cffi") + (version "0.8.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/c/" + "cffi/cffi-" version ".tar.gz")) + (sha256 + (base32 "0406j3sgndmx88idv5zxkkrwfqxmjl18pj8gf47nsg4ymzixjci5")))) + (build-system python-build-system) + (outputs '("out" "doc")) + (inputs + `(("libffi" ,libffi))) + (propagated-inputs ; required at run-time + `(("python-pycparser" ,python-pycparser))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-sphinx" ,python-sphinx) + ("python-setuptools" ,python-setuptools))) + (arguments + `(#:tests? #f ; FIXME: requires pytest + #:phases + (alist-cons-after + 'install 'install-doc + (lambda* (#:key 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"))) + (with-directory-excursion "doc" + (system* "make" "html") + (mkdir-p html) + (copy-recursively "build/html" html)) + (copy-file "LICENSE" (string-append doc "/LICENSE")))) + %standard-phases))) + (home-page "http://cffi.readthedocs.org") + (synopsis "Foreign function interface for Python") + (description + "Foreign Function Interface for Python calling C code.") + (license expat))) + +(define-public python2-cffi + (package-with-python2 python-cffi)) -- cgit 1.4.1 From c1125a04bbd2c63ab25437c229cd3b6646c0bddb Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Sat, 13 Dec 2014 09:40:17 +0100 Subject: gnu: python-numpy-bootstrap: Make tests verbose. * gnu/packages/python.scm (python-numpy-bootstrap): Make tests verbose to allow test failure debugging on hydra. --- gnu/packages/python.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 67effe77d6..dc7def5507 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -1934,7 +1934,8 @@ writing C extensions for Python as easy as Python itself.") 'install 'check (lambda _ (with-directory-excursion "/tmp" - (zero? (system* "python" "-c" "import numpy; numpy.test()")))) + (zero? (system* "python" "-c" + "import numpy; numpy.test(verbose=2)")))) (alist-delete 'check %standard-phases))))) -- cgit 1.4.1