gnu: Add icedtea7.
[jackhill/guix/guix.git] / gnu / packages / python.scm
CommitLineData
a01b6da7
NK
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
da6dd842 3;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
03411993 4;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
e99f4211 5;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
a480bc41 6;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
da6ce3f1 7;;; Copyright © 2014, 2015 Federico Beffa <beffa@fbengineering.ch>
e99f4211 8;;; Copyright © 2015 Omar Radwan <toxemicsquire4@gmail.com>
d95a56c6 9;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu>
ad320b20 10;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
a01b6da7
NK
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
1ffa7090 27(define-module (gnu packages python)
011b18c3 28 #:use-module ((guix licenses)
166191b3 29 #:select (asl2.0 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
fbcfa730 30 gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+
4ed20663 31 psfl public-domain x11-style))
bd3fa666 32 #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
3fdc99da 33 #:use-module (gnu packages)
1ffa7090 34 #:use-module (gnu packages compression)
4ed20663 35 #:use-module (gnu packages databases)
4ed20663 36 #:use-module (gnu packages fontutils)
3fdc99da 37 #:use-module (gnu packages gdbm)
4ed20663
AE
38 #:use-module (gnu packages gcc)
39 #:use-module (gnu packages ghostscript)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
421a80a2 42 #:use-module (gnu packages icu4c)
c937562e 43 #:use-module (gnu packages image)
4ed20663 44 #:use-module (gnu packages imagemagick)
b10ab723 45 #:use-module (gnu packages libffi)
0da98533 46 #:use-module (gnu packages maths)
4ed20663 47 #:use-module (gnu packages multiprecision)
be7134bf 48 #:use-module (gnu packages ncurses)
4ed20663
AE
49 #:use-module (gnu packages openssl)
50 #:use-module (gnu packages perl)
b10ab723 51 #:use-module (gnu packages pkg-config)
4ed20663 52 #:use-module (gnu packages readline)
1c65314c
FB
53 #:use-module (gnu packages texlive)
54 #:use-module (gnu packages texinfo)
8d12be1e 55 #:use-module (gnu packages web)
ce0614dd 56 #:use-module (gnu packages base)
26b307e2 57 #:use-module (gnu packages xml)
6fa14469 58 #:use-module (gnu packages xorg)
4ed20663 59 #:use-module (gnu packages zip)
a01b6da7
NK
60 #:use-module (guix packages)
61 #:use-module (guix download)
ea5456c8 62 #:use-module (guix git-download)
11bb85a1 63 #:use-module (guix utils)
acc26ff1 64 #:use-module (guix build-system gnu)
898238b9 65 #:use-module (guix build-system python)
1c65314c
FB
66 #:use-module (guix build-system trivial)
67 #:use-module (srfi srfi-1))
a01b6da7 68
b24d1cfc 69(define-public python-2
a01b6da7
NK
70 (package
71 (name "python")
ee2b5109 72 (version "2.7.6")
a01b6da7
NK
73 (source
74 (origin
75 (method url-fetch)
9b43a0ff 76 (uri (string-append "https://www.python.org/ftp/python/"
a01b6da7 77 version "/Python-" version ".tar.xz"))
b88e1b0a
EB
78 (patches (list (search-patch "python-libffi-mips-n32-fix.patch")
79 (search-patch "python2-sqlite-3.8.4-test-fix.patch")))
32d5c729 80 (patch-flags '("-p0"))
a01b6da7
NK
81 (sha256
82 (base32
ee2b5109 83 "18gnpyh071dxa0rv3silrz92jw9qpblswzwv4gzqcwxzz20qxmhz"))))
a01b6da7 84 (build-system gnu-build-system)
3fdc99da 85 (arguments
af807dea
AE
86 `(#:tests? #f
87;; 258 tests OK.
88;; 103 tests failed:
89;; test_bz2 test_distutils test_file test_file2k test_popen2
90;; test_shutil test_signal test_site test_slice test_smtplib
91;; test_smtpnet test_socket test_socketserver test_softspace
92;; test_sort test_sqlite test_ssl test_startfile test_str
93;; test_strftime test_string test_stringprep test_strop test_strptime
94;; test_strtod test_struct test_structmembers test_structseq
95;; test_subprocess test_sunaudiodev test_sundry test_symtable
96;; test_syntax test_sys test_sys_setprofile test_sys_settrace
97;; test_sysconfig test_tarfile test_tcl test_telnetlib test_tempfile
98;; test_textwrap test_thread test_threaded_import
99;; test_threadedtempfile test_threading test_threading_local
100;; test_threadsignals test_time test_timeout test_tk test_tokenize
101;; test_tools test_trace test_traceback test_transformer
102;; test_ttk_guionly test_ttk_textonly test_tuple test_typechecks
103;; test_ucn test_unary test_undocumented_details test_unicode
104;; test_unicode_file test_unicodedata test_univnewlines
105;; test_univnewlines2k test_unpack test_urllib test_urllib2
106;; test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse
107;; test_userdict test_userlist test_userstring test_uu test_uuid
108;; test_wait3 test_wait4 test_warnings test_wave test_weakref
109;; test_weakset test_whichdb test_winreg test_winsound test_with
110;; test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c
111;; test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile
112;; test_zipfile64 test_zipimport test_zipimport_support test_zlib
113;; 31 tests skipped:
114;; test_aepack test_al test_applesingle test_ascii_formatd test_bsddb
115;; test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn
116;; test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
117;; test_codecmaps_tw test_ctypes test_curses test_dl test_gdb test_gl
118;; test_imageop test_imgfile test_ioctl test_kqueue
119;; test_linuxaudiodev test_macos test_macostools test_msilib
120;; test_multiprocessing test_ossaudiodev test_pep277
121;; test_scriptpackages
122;; 7 skips unexpected on linux2:
123;; test_ascii_formatd test_bsddb test_bsddb3 test_ctypes test_gdb
124;; test_ioctl test_multiprocessing
125;; One of the typical errors:
126;; test_unicode
127;; test test_unicode crashed -- <type 'exceptions.OSError'>: [Errno 2] No such file or directory
128 #:test-target "test"
3fdc99da
CR
129 #:configure-flags
130 (let ((bz2 (assoc-ref %build-inputs "bzip2"))
131 (gdbm (assoc-ref %build-inputs "gdbm"))
b10ab723 132 (libffi (assoc-ref %build-inputs "libffi"))
b88e1b0a 133 (sqlite (assoc-ref %build-inputs "sqlite"))
3fdc99da
CR
134 (openssl (assoc-ref %build-inputs "openssl"))
135 (readline (assoc-ref %build-inputs "readline"))
1f434457
MW
136 (zlib (assoc-ref %build-inputs "zlib"))
137 (out (assoc-ref %outputs "out")))
fd982732 138 (list "--enable-shared" ; allow embedding
b10ab723 139 "--with-system-ffi" ; build ctypes
fd982732 140 (string-append "CPPFLAGS="
3fdc99da
CR
141 "-I" bz2 "/include "
142 "-I" gdbm "/include "
b88e1b0a 143 "-I" sqlite "/include "
3fdc99da
CR
144 "-I" openssl "/include "
145 "-I" readline "/include "
146 "-I" zlib "/include")
147 (string-append "LDFLAGS="
148 "-L" bz2 "/lib "
149 "-L" gdbm "/lib "
b10ab723 150 "-L" libffi "/lib "
b88e1b0a 151 "-L" sqlite "/lib "
3fdc99da
CR
152 "-L" openssl "/lib "
153 "-L" readline "/lib "
1f434457
MW
154 "-L" zlib "/lib "
155 "-Wl,-rpath=" out "/lib")))
fd982732
LC
156
157 #:phases
1f434457
MW
158 (alist-cons-before
159 'configure 'patch-lib-shells
160 (lambda _
161 ;; Filter for existing files, since some may not exist in all
162 ;; versions of python that are built with this recipe.
163 (substitute* (filter file-exists?
164 '("Lib/subprocess.py"
165 "Lib/popen2.py"
166 "Lib/distutils/tests/test_spawn.py"
167 "Lib/test/test_subprocess.py"))
168 (("/bin/sh") (which "sh"))))
d4bf49b1 169 (alist-cons-before
1f434457 170 'check 'pre-check
d4bf49b1 171 (lambda _
1f434457
MW
172 ;; 'Lib/test/test_site.py' needs a valid $HOME
173 (setenv "HOME" (getcwd)))
174 %standard-phases))))
a01b6da7 175 (inputs
3fdc99da
CR
176 `(("bzip2" ,bzip2)
177 ("gdbm" ,gdbm)
b10ab723 178 ("libffi" ,libffi) ; for ctypes
b88e1b0a 179 ("sqlite" ,sqlite) ; for sqlite extension
a01b6da7 180 ("openssl" ,openssl)
3fdc99da 181 ("readline" ,readline)
1f434457 182 ("zlib" ,zlib)))
b10ab723
CR
183 (native-inputs
184 `(("pkg-config" ,pkg-config)))
9be8d7c8
LC
185 (native-search-paths
186 (list (search-path-specification
187 (variable "PYTHONPATH")
af070955 188 (files '("lib/python2.7/site-packages")))))
a01b6da7
NK
189 (home-page "http://python.org")
190 (synopsis
35b9e423 191 "High-level, dynamically-typed programming language")
a01b6da7
NK
192 (description
193 "Python is a remarkably powerful dynamic programming language that
194is used in a wide variety of application domains. Some of its key
195distinguishing features include: clear, readable syntax; strong
196introspection capabilities; intuitive object orientation; natural
197expression of procedural code; full modularity, supporting hierarchical
198packages; exception-based error handling; and very high level dynamic
199data types.")
200 (license psfl)))
acc26ff1 201
b24d1cfc
AE
202(define-public python
203 (package (inherit python-2)
08c04509 204 (version "3.4.3")
717003e3
LC
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "https://www.python.org/ftp/python/"
208 version "/Python-" version ".tar.xz"))
08c04509 209 (patches (list (search-patch "python-fix-tests.patch")))
717003e3
LC
210 (patch-flags '("-p0"))
211 (sha256
212 (base32
08c04509 213 "1f4nm4z08sy0kqwisvv95l02crv6dyysdmx44p1mz3bn6csrdcxm"))))
1f434457
MW
214 (arguments (substitute-keyword-arguments (package-arguments python-2)
215 ((#:tests? _) #t)))
1aebc0cb
AE
216 (native-search-paths
217 (list (search-path-specification
218 (variable "PYTHONPATH")
0e05d01e
SB
219 (files (list (string-append "lib/python"
220 (version-major+minor version)
221 "/site-packages"))))))))
f26a77ff 222
898238b9
AE
223(define-public python-wrapper
224 (package (inherit python)
225 (name "python-wrapper")
226 (source #f)
227 (build-system trivial-build-system)
3c0f2329 228 (propagated-inputs `(("python" ,python)))
898238b9
AE
229 (arguments
230 `(#:modules ((guix build utils))
231 #:builder
232 (begin
233 (use-modules (guix build utils))
234 (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
235 (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
236 (mkdir-p bin)
237 (for-each
238 (lambda (old new)
239 (symlink (string-append python old)
240 (string-append bin "/" new)))
241 `("python3", "pydoc3", "idle3")
242 `("python", "pydoc", "idle"))))))
243 (description (string-append (package-description python)
244 "\n\nThis wrapper package provides symbolic links to the python binaries
245 without version suffix."))))
246
247
89114f39 248(define-public python-pytz
acc26ff1 249 (package
89114f39 250 (name "python-pytz")
acc26ff1
CR
251 (version "2013b")
252 (source
253 (origin
254 (method url-fetch)
255 (uri (string-append "https://launchpad.net/pytz/main/" version
256 "/+download/pytz-" version ".tar.bz2"))
257 (sha256
258 (base32
259 "19giwgfcrg0nr1gdv49qnmf2jb2ilkcfc7qyqvfpz4dp0p64ksv5"))))
260 (build-system python-build-system)
8498b8cf 261 (arguments `(#:tests? #f)) ; no test target
acc26ff1 262 (home-page "https://launchpad.net/pytz")
9e771e3b 263 (synopsis "Python timezone library")
acc26ff1
CR
264 (description
265 "This library allows accurate and cross platform timezone calculations
266using Python 2.4 or higher and provides access to the Olson timezone database.")
267 (license x11)))
5ace6e2f 268
89114f39 269(define-public python2-pytz
11bb85a1 270 (package-with-python2 python-pytz))
89114f39 271
fc50e9c6 272
89114f39 273(define-public python-babel
5ace6e2f 274 (package
89114f39 275 (name "python-babel")
e1804763 276 (version "1.3")
5ace6e2f
CR
277 (source
278 (origin
279 (method url-fetch)
e1804763 280 (uri (string-append "https://pypi.python.org/packages/source/B/Babel/Babel-"
5ace6e2f
CR
281 version ".tar.gz"))
282 (sha256
283 (base32
e1804763 284 "0bnin777lc53nxd1hp3apq410jj5wx92n08h7h4izpl4f4sx00lz"))))
5ace6e2f
CR
285 (build-system python-build-system)
286 (inputs
e1804763
AE
287 `(("python-pytz" ,python-pytz)
288 ("python-setuptools" ,python-setuptools)))
8498b8cf 289 (arguments `(#:tests? #f)) ; no test target
e1804763 290 (home-page "http://babel.pocoo.org/")
5ace6e2f
CR
291 (synopsis
292 "Tools for internationalizing Python applications")
293 (description
294 "Babel is composed of two major parts:
295- tools to build and work with gettext message catalogs
296- a Python interface to the CLDR (Common Locale Data Repository), providing
297access to various locale display names, localized number and date formatting,
298etc. ")
299 (license bsd-3)))
89114f39
AE
300
301(define-public python2-babel
11bb85a1 302 (package-with-python2 python-babel))
73adf220 303
ef5cbf9b
RW
304(define-public python-h5py
305 (package
306 (name "python-h5py")
307 (version "2.4.0")
308 (source
309 (origin
310 (method url-fetch)
311 (uri (string-append "https://pypi.python.org/packages/source/h/h5py/h5py-"
312 version ".tar.gz"))
313 (sha256
314 (base32
315 "0q4f9l8grf6pwp64xbv8bmyxx416s7h4522nnxac056ap3savbps"))))
316 (build-system python-build-system)
317 (inputs
318 `(("python-cython" ,python-cython)
319 ("python-numpy" ,python-numpy)
320 ("hdf5" ,hdf5)))
321 (native-inputs
322 `(("python-setuptools" ,python-setuptools)))
323 (arguments `(#:tests? #f)) ; no test target
324 (home-page "http://www.h5py.org/")
325 (synopsis "Read and write HDF5 files from Python")
326 (description
327 "The h5py package provides both a high- and low-level interface to the
328HDF5 library from Python. The low-level interface is intended to be a
329complete wrapping of the HDF5 API, while the high-level component supports
330access to HDF5 files, datasets and groups using established Python and NumPy
331concepts.")
332 (license bsd-3)))
333
334(define-public python2-h5py
335 (let ((h5py (package-with-python2 python-h5py)))
336 (package (inherit h5py)
337 (inputs
338 `(("python2-numpy" ,python2-numpy)
339 ,@(alist-delete
340 "python-numpy"
341 (package-inputs h5py)))))))
342
c1448c69
EB
343(define-public python-lockfile
344 (package
345 (name "python-lockfile")
346 (version "0.9.1")
347 (source
348 (origin
349 (method url-fetch)
350 (uri (string-append "https://pypi.python.org/packages/source/l/lockfile/"
351 "lockfile-" version ".tar.gz"))
352 (sha256
353 (base32
354 "0iwif7i84gwpvrnpv4brshdk8j6l77smvknm8k3bg77mj6f5ini3"))))
355 (build-system python-build-system)
356 (arguments '(#:test-target "check"))
357 (home-page "http://code.google.com/p/pylockfile/")
358 (synopsis "Platform-independent file locking module")
359 (description
360 "The lockfile package exports a LockFile class which provides a simple
361API for locking files.")
bd3fa666 362 (license license:expat)))
c1448c69
EB
363
364(define-public python2-lockfile
365 (package-with-python2 python-lockfile))
366
5a1a4bf6
EB
367(define-public python-mock
368 (package
369 (name "python-mock")
370 (version "1.0.1")
371 (source
372 (origin
373 (method url-fetch)
374 (uri (string-append "https://pypi.python.org/packages/source/m/mock/"
375 "mock-" version ".tar.gz"))
376 (sha256
377 (base32
378 "0kzlsbki6q0awf89rc287f3aj8x431lrajf160a70z0ikhnxsfdq"))))
379 (build-system python-build-system)
380 (arguments '(#:test-target "check"))
07af3e5e 381 (home-page "http://code.google.com/p/mock/")
9e771e3b 382 (synopsis "Python mocking and patching library for testing")
5a1a4bf6
EB
383 (description
384 "Mock is a library for testing in Python. It allows you to replace parts
385of your system under test with mock objects and make assertions about how they
386have been used.")
bd3fa666 387 (license license:expat)))
5a1a4bf6
EB
388
389(define-public python2-mock
390 (package-with-python2 python-mock))
391
fc50e9c6 392
73adf220
AE
393(define-public python-setuptools
394 (package
395 (name "python-setuptools")
d3d656c5 396 (version "12.1")
73adf220
AE
397 (source
398 (origin
399 (method url-fetch)
400 (uri (string-append "https://pypi.python.org/packages/source/s/setuptools/setuptools-"
401 version ".tar.gz"))
402 (sha256
403 (base32
d3d656c5 404 "04bfk7si1pwj3b5k2b1x9b1zkiclybmzpw6alrs5bciri56lg9zs"))))
73adf220 405 (build-system python-build-system)
d3d656c5
AE
406 ;; FIXME: Tests require pytest, which itself relies on setuptools.
407 ;; One could bootstrap with an internal untested setuptools.
73adf220 408 (arguments
824af8ca 409 `(#:tests? #f))
73adf220
AE
410 (home-page "https://pypi.python.org/pypi/setuptools")
411 (synopsis
412 "Library designed to facilitate packaging Python projects")
413 (description
414 "Setuptools is a fully-featured, stable library designed to facilitate
415packaging Python projects, where packaging includes:
416Python package and module definitions,
417distribution package metadata,
418test hooks,
419project installation,
420platform-specific details,
421Python 3 support.")
422 (license psfl)))
423
424(define-public python2-setuptools
425 (package-with-python2 python-setuptools))
fc50e9c6
AE
426
427
cafc3f5a
EB
428(define-public python-pycrypto
429 (package
430 (name "python-pycrypto")
431 (version "2.6.1")
432 (source
433 (origin
434 (method url-fetch)
435 (uri (string-append "https://pypi.python.org/packages/source/p/"
436 "pycrypto/pycrypto-" version ".tar.gz"))
437 (sha256
438 (base32
439 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
440 (build-system python-build-system)
441 (native-inputs
442 `(("python-setuptools" ,python-setuptools)))
443 (inputs
444 `(("python" ,python)
445 ("gmp" ,gmp)))
446 (arguments
447 `(#:phases
448 (alist-cons-before
449 'build 'set-build-env
450 ;; pycrypto runs an autoconf configure script behind the scenes
451 (lambda _
452 (setenv "CONFIG_SHELL" (which "bash")))
453 %standard-phases)))
454 (home-page "http://www.pycrypto.org/")
455 (synopsis "Cryptographic modules for Python")
456 (description
457 "Pycrypto is a collection of both secure hash functions (such as SHA256
458and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
35b9e423 459etc.). The package is structured to make adding new modules easy.")
cafc3f5a
EB
460 (license public-domain)))
461
462(define-public python-keyring
463 (package
464 (name "python-keyring")
465 (version "3.8")
466 (source
467 (origin
468 (method url-fetch)
469 (uri (string-append "https://pypi.python.org/packages/source/k/"
470 "keyring/keyring-" version ".zip"))
471 (sha256
472 (base32
473 "1vxazfbcwggyfyramh55shkxs08skhpqrkm6lrrjnygnm8c1l2zg"))))
474 (build-system python-build-system)
475 (native-inputs
476 `(("unzip" ,unzip)
477 ("python-setuptools" ,python-setuptools)
478 ("python-mock" ,python-mock)))
479 (inputs
480 `(("python-pycrypto" ,python-pycrypto)))
481 (arguments
482 `(#:tests? #f ;TODO: tests require pytest
483 #:phases
484 (alist-replace
485 'unpack
486 (lambda _
487 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
488 "/bin/unzip"))
489 (source (assoc-ref %build-inputs "source")))
490 (and (zero? (system* unzip source))
491 (chdir (string-append "keyring-" ,version)))))
492 %standard-phases)))
493 (home-page "http://bitbucket.org/kang/python-keyring-lib")
494 (synopsis "Store and access your passwords safely")
495 (description
496 "The Python keyring lib provides a easy way to access the system keyring
35b9e423 497service from python. It can be used in any application that needs safe
cafc3f5a
EB
498password storage.")
499 ;; "MIT" and PSF dual license
500 (license x11)))
501
a480bc41
EB
502(define-public python-six
503 (package
504 (name "python-six")
505 (version "1.7.2")
506 (source
507 (origin
508 (method url-fetch)
509 (uri (string-append "https://pypi.python.org/packages/source/s/"
510 "six/six-" version ".tar.gz"))
511 (sha256
512 (base32
513 "164rns26aqfqx2hwi0qq3scl50s69japn0fvgvrjsbyg7r1mxf67"))))
514 (build-system python-build-system)
515 (inputs
516 `(("python-setuptools" ,python-setuptools)))
517 (home-page "http://pypi.python.org/pypi/six/")
518 (synopsis "Python 2 and 3 compatibility utilities")
519 (description
35b9e423 520 "Six is a Python 2 and 3 compatibility library. It provides utility
a480bc41
EB
521functions for smoothing over the differences between the Python versions with
522the goal of writing Python code that is compatible on both Python versions.
35b9e423 523Six supports every Python version since 2.5. It is contained in only one
a480bc41
EB
524Python file, so it can be easily copied into your project.")
525 (license x11)))
526
0c20025c
AE
527(define-public python2-six
528 (package-with-python2 python-six))
529
cafc3f5a
EB
530(define-public python-dateutil-2
531 (package
532 (name "python-dateutil")
533 (version "2.2")
534 (source
535 (origin
536 (method url-fetch)
537 (uri (string-append "https://pypi.python.org/packages/source/p/"
538 name "/" name "-" version ".tar.gz"))
539 (sha256
540 (base32
541 "0s74ad6r789810s10dxgvaf48ni6adac2icrdad34zxygqq6bj7f"))))
542 (build-system python-build-system)
543 (inputs
544 `(("python-setuptools" ,python-setuptools)
545 ("python-six" ,python-six)))
546 (home-page "http://labix.org/python-dateutil")
547 (synopsis "Extensions to the standard datetime module")
548 (description
549 "The dateutil module provides powerful extensions to the standard
550datetime module, available in Python 2.3+.")
551 (license bsd-3)))
552
553(define-public python2-dateutil-2
554 (package-with-python2 python-dateutil-2))
555
fc50e9c6
AE
556(define-public python-dateutil
557 (package
558 (name "python-dateutil")
559 (version "1.5") ; last version for python < 3
560 (source
561 (origin
562 (method url-fetch)
cafc3f5a
EB
563 (uri (string-append "http://labix.org/download/python-dateutil/"
564 "python-dateutil-" version ".tar.gz"))
fc50e9c6
AE
565 (sha256
566 (base32
567 "0fqfglhy5khbvsipr3x7m6bcaqljh8xl5cw33vbfxy7qhmywm2n0"))))
568 (build-system python-build-system)
569 (inputs
570 `(("python-setuptools" ,python-setuptools)))
571 (home-page "http://labix.org/python-dateutil")
cafc3f5a 572 (synopsis "Extensions to the standard datetime module")
fc50e9c6
AE
573 (description
574 "The dateutil module provides powerful extensions to the standard
575datetime module, available in Python 2.3+.")
576 (license psfl)))
577
578(define-public python2-dateutil
579 (package-with-python2 python-dateutil))
1d08c01f 580
cafc3f5a
EB
581(define-public python-parsedatetime
582 (package
583 (name "python-parsedatetime")
584 (version "1.2")
585 (source
586 (origin
587 (method url-fetch)
588 (uri (string-append "https://pypi.python.org/packages/source/p/"
589 "parsedatetime/parsedatetime-" version ".tar.gz"))
590 (sha256
591 (base32
592 "1zcj0pzxvpl4j2ma9awmpkfxldybi2kjaahjjpmgfbg5cxwcjsqv"))))
593 (build-system python-build-system)
594 (native-inputs
595 `(("python-setuptools" ,python-setuptools)))
596 (arguments `(#:tests? #f)) ;no test target
597 (home-page "http://github.com/bear/parsedatetime/")
598 (synopsis
599 "Parse human-readable date/time text")
600 (description
601 "Parse human-readable date/time text")
602 (license asl2.0)))
603
604(define-public python-tzlocal
605 (package
606 (name "python-tzlocal")
607 (version "1.1.1")
608 (source
609 (origin
610 (method url-fetch)
611 (uri (string-append "https://pypi.python.org/packages/source/t/"
612 "tzlocal/tzlocal-" version ".zip"))
613 (sha256
614 (base32
615 "1m3y918c3chf41fwg2bx4w42bqsjzn3dyvvcmwwy13c8gj6zssv9"))))
616 (build-system python-build-system)
617 (native-inputs
618 `(("unzip" ,unzip)
619 ("python-setuptools" ,python-setuptools)))
620 (inputs `(("python-pytz" ,python-pytz)))
621 (arguments
622 `(#:phases
623 (alist-replace
624 'unpack
625 (lambda _
626 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
627 "/bin/unzip"))
628 (source (assoc-ref %build-inputs "source")))
629 (and (zero? (system* unzip source))
630 (chdir (string-append "tzlocal-" ,version)))))
631 %standard-phases)))
632 (home-page "https://github.com/regebro/tzlocal")
633 (synopsis
35b9e423 634 "Local timezone information for Python")
cafc3f5a
EB
635 (description
636 "Tzlocal returns a tzinfo object with the local timezone information.
637This module attempts to fix a glaring hole in pytz, that there is no way to
638get the local timezone information, unless you know the zoneinfo name, and
639under several distributions that's hard or impossible to figure out.")
640 (license cc0)))
641
be7134bf
RW
642(define-public python-pysam
643 (package
644 (name "python-pysam")
645 (version "0.8.1")
646 (source
647 (origin
648 (method url-fetch)
649 (uri (string-append "https://pypi.python.org/packages/source/p/pysam/pysam-"
650 version ".tar.gz"))
651 (sha256
652 (base32
653 "1fb6i6hbpzxaxb62kyyp5alaidwhj40f7c6gwbhr6njzlqd5l459"))))
654 (build-system python-build-system)
655 (arguments
656 `(#:tests? #f ; tests are excluded in the manifest
657 #:phases
658 (alist-cons-before
659 'build 'set-flags
660 (lambda _
661 (setenv "LDFLAGS" "-lncurses")
662 (setenv "CFLAGS" "-D_CURSES_LIB=1"))
663 %standard-phases)))
664 (inputs
665 `(("python-cython" ,python-cython)
666 ("python-setuptools" ,python-setuptools)
667 ("ncurses" ,ncurses)
668 ("zlib" ,zlib)))
669 (home-page "https://github.com/pysam-developers/pysam")
670 (synopsis "Python bindings to the SAMtools C API")
671 (description
672 "Pysam is a Python module for reading and manipulating files in the
673SAM/BAM format. Pysam is a lightweight wrapper of the SAMtools C API. It
674also includes an interface for tabix.")
bd3fa666 675 (license license:expat)))
be7134bf
RW
676
677(define-public python2-pysam
678 (package-with-python2 python-pysam))
1d08c01f
AE
679
680(define-public python2-pysqlite
681 (package
682 (name "python2-pysqlite")
7a03af70 683 (version "2.6.3a") ; see below
1d08c01f
AE
684 (source
685 (origin
686 (method url-fetch)
7a03af70
LC
687 ;; During the switch from code.google.com to pypi.python.org, the 2.6.3
688 ;; tarball was modified, but the version number was kept:
689 ;; <https://lists.gnu.org/archive/html/guix-devel/2014-02/msg00077.html>.
690 ;; Here we want to refer to the pypi-hosted 2.6.3 tarball.
691 (uri (string-append
692 "https://pypi.python.org/packages/source/p/pysqlite/pysqlite-"
693 "2.6.3" ".tar.gz"))
1d08c01f
AE
694 (sha256
695 (base32
7a03af70 696 "13djzgnbi71znjjyaw4nybg6smilgszcid646j5qav7mdchkb77y"))))
1d08c01f
AE
697 (build-system python-build-system)
698 (inputs
699 `(("sqlite" ,sqlite)))
700 (arguments
701 `(#:python ,python-2 ; incompatible with Python 3
702 #:tests? #f)) ; no test target
7a03af70
LC
703 (home-page "https://pypi.python.org/pypi/pysqlite")
704 (synopsis "SQLite bindings for Python")
1d08c01f
AE
705 (description
706 "Pysqlite provides SQLite bindings for Python that comply to the
707Database API 2.0T.")
ed0cdf83 708 (license license:zlib)))
1d08c01f 709
2875caf5
AE
710
711(define-public python2-mechanize
712 (package
713 (name "python2-mechanize")
714 (version "0.2.5")
715 (source
716 (origin
717 (method url-fetch)
718 (uri (string-append "https://pypi.python.org/packages/source/m/mechanize/mechanize-"
719 version ".tar.gz"))
720 (sha256
721 (base32
722 "0rj7r166i1dyrq0ihm5rijfmvhs8a04im28lv05c0c3v206v4rrf"))))
723 (build-system python-build-system)
724 (inputs
725 `(("python2-setuptools" ,python2-setuptools)))
726 (arguments
727 `(#:python ,python-2 ; apparently incompatible with Python 3
728 #:tests? #f))
729 ;; test fails with message
730 ;; AttributeError: 'module' object has no attribute 'test_pullparser'
731 ;; (python-3.3.2) or
732 ;; AttributeError: 'module' object has no attribute 'test_urllib2_localnet'
733 ;; (python-2.7.5).
734 ;; The source code is from March 2011 and probably not up-to-date
735 ;; with respect to python unit tests.
736 (home-page "http://wwwsearch.sourceforge.net/mechanize/")
737 (synopsis
738 "Stateful programmatic web browsing in Python")
739 (description
740 "Mechanize implements stateful programmatic web browsing in Python,
741after Andy Lester’s Perl module WWW::Mechanize.")
166191b3 742 (license (non-copyleft "file://COPYING"
2875caf5
AE
743 "See COPYING in the distribution."))))
744
0352532e
AE
745
746(define-public python-simplejson
747 (package
748 (name "python-simplejson")
749 (version "3.3.0")
750 (source
751 (origin
752 (method url-fetch)
753 (uri (string-append "https://pypi.python.org/packages/source/s/simplejson/simplejson-"
754 version ".tar.gz"))
755 (sha256
756 (base32
757 "07wsry5j44l5zzm74l4j2bvasiq8n5m32f31n2p7c68i5vc6p2ks"))))
758 (build-system python-build-system)
759 (home-page "http://simplejson.readthedocs.org/en/latest/")
760 (synopsis
761 "Json library for Python")
762 (description
763 "JSON (JavaScript Object Notation) is a subset of JavaScript syntax
cc20a22a 764 (ECMA-262 3rd edition) used as a lightweight data interchange format.
0352532e
AE
765
766Simplejson exposes an API familiar to users of the standard library marshal
767and pickle modules. It is the externally maintained version of the json
768library contained in Python 2.6, but maintains compatibility with Python 2.5
769and (currently) has significant performance advantages, even without using
770the optional C extension for speedups. Simplejson is also supported on
771Python 3.3+.")
772 (license x11)))
773
774(define-public python2-simplejson
775 (package-with-python2 python-simplejson))
421a80a2
AE
776
777
778(define-public python2-pyicu
779 (package
780 (name "python2-pyicu")
569ac046 781 (version "1.8")
421a80a2
AE
782 (source
783 (origin
784 (method url-fetch)
785 (uri (string-append "https://pypi.python.org/packages/source/P/PyICU/PyICU-"
786 version ".tar.gz"))
787 (sha256
788 (base32
569ac046 789 "1y361x82lnh9k9srmdx3q92z5iag112z7r5fxm0n1sfwb349yjdw"))))
421a80a2
AE
790 (build-system python-build-system)
791 (inputs
792 `(("icu4c" ,icu4c)))
793 (arguments
794 `(#:python ,python-2 ; Python 3 works also, but needs special care for
795 ; linking with libpython3.3m
796 #:tests? #f)) ; no check target
797 (home-page "http://pyicu.osafoundation.org/")
9e771e3b 798 (synopsis "Python extension wrapping the ICU C++ API")
421a80a2
AE
799 (description
800 "PyICU is a python extension wrapping the ICU C++ API.")
801 (license x11)))
cc20a22a
LC
802
803(define-public python2-dogtail
804 ;; Python 2 only, as it leads to "TabError: inconsistent use of tabs and
805 ;; spaces in indentation" with Python 3.
806 (package
807 (name "python2-dogtail")
808 (version "0.8.2")
809 (source (origin
810 (method url-fetch)
811 (uri (string-append
812 "https://fedorahosted.org/released/dogtail/dogtail-"
813 version ".tar.gz"))
814 (sha256
815 (base32
816 "1yc4cg7ip87z15gyd4wy2vzbywrjc52a3m8r8gqy2b50d65llcg1"))))
817 (build-system python-build-system)
818 (arguments `(#:python ,python-2
819 #:tests? #f)) ; invalid command "test"
820 (home-page "https://fedorahosted.org/dogtail/")
821 (synopsis "GUI test tool and automation framework written in ​Python")
822 (description
35b9e423 823 "Dogtail is a GUI test tool and automation framework written in Python.
cc20a22a
LC
824It uses Accessibility (a11y) technologies to communicate with desktop
825applications. dogtail scripts are written in Python and executed like any
826other Python program.")
827 (license gpl2+)))
515e6878 828
011b18c3
LC
829(define-public python2-empy
830 (package
831 (name "python2-empy")
832 (version "3.3")
833 (source (origin
834 (method url-fetch)
835 (uri (string-append "http://www.alcyone.com/software/empy/empy-"
836 version ".tar.gz"))
837 (sha256
838 (base32
839 "01g8mmkfnvjdmlhsihwyx56lrg7r5m5d2fg6mnxsvy6g0dnl69f6"))))
840 (build-system python-build-system)
841 (arguments
842 `(#:python ,python-2
843 #:phases (alist-replace
844 'check
845 (lambda _
846 (zero? (system* "./test.sh")))
847 %standard-phases)))
848 (home-page "http://www.alcyone.com/software/empy/")
849 (synopsis "Templating system for Python")
850 (description
851 "EmPy is a system for embedding Python expressions and statements in
852template text; it takes an EmPy source file, processes it, and produces
853output. This is accomplished via expansions, which are special signals to the
854EmPy system and are set off by a special prefix (by default the at sign, @).
855EmPy can expand arbitrary Python expressions and statements in this way, as
856well as a variety of special forms. Textual data not explicitly delimited in
857this way is sent unaffected to the output, allowing Python to be used in
858effect as a markup language. Also supported are callbacks via hooks,
859recording and playback via diversions, and dynamic, chainable filters. The
860system is highly configurable via command line options and embedded
861commands.")
862 (license lgpl2.1+)))
863
8deeda0c
LC
864(define-public python2-element-tree
865 (package
866 (name "python2-element-tree")
867 (version "1.2.6")
868 (source (origin
869 (method url-fetch)
870 (uri (string-append
871 "http://effbot.org/media/downloads/elementtree-"
872 version "-20050316.tar.gz"))
873 (sha256
874 (base32
875 "016bphqnlg0l4vslahhw4r0aanw95bpypy65r1i1acyb2wj5z7dj"))))
876 (build-system python-build-system)
877 (arguments
878 `(#:python ,python-2 ; seems to be part of Python 3
879 #:tests? #f)) ; no 'test' sub-command
880 (synopsis "Toolkit for XML processing in Python")
881 (description
882 "ElementTree is a Python library supporting lightweight XML processing.")
883 (home-page "http://effbot.org/zone/element-index.htm")
884 (license (x11-style "http://docs.python.org/2/license.html"
885 "Like \"CWI LICENSE AGREEMENT FOR PYTHON \
8860.9.0 THROUGH 1.2\"."))))
887
888(define-public python2-pybugz
889 (package
890 (name "python2-pybugz")
891 (version "0.6.11")
892 (source (origin
893 (method url-fetch)
894 (uri (string-append
895 "http://bits.liquidx.net/projects/pybugz/pybugz-"
896 version ".tar.gz"))
897 (sha256
898 (base32
6f194a1e
LC
899 "17ni00p08gp5lkxlrrcnvi3x09fmajnlbz4da03qcgl9q21ym4jd"))
900 (patches (map search-patch
901 (list "pybugz-stty.patch"
902 "pybugz-encode-error.patch")))))
8deeda0c
LC
903 (build-system python-build-system)
904 (arguments
905 `(#:python ,python-2 ; SyntaxError with Python 3
906 #:tests? #f)) ; no 'test' sub-command
907 (inputs `(("element-tree" ,python2-element-tree)))
908 (synopsis "Python and command-line interface to Bugzilla")
909 (description
910 "PyBugz is a Python library and command-line tool to query the Bugzilla
911bug tracking system. It is meant as an aid to speed up interaction with the
912bug tracker.")
913 (home-page "http://www.liquidx.net/pybugz/")
914 (license gpl2)))
915
a480bc41
EB
916(define-public python-enum34
917 (package
918 (name "python-enum34")
919 (version "1.0")
920 (source
921 (origin
922 (method url-fetch)
923 (uri (string-append "https://pypi.python.org/packages/source/e/"
924 "enum34/enum34-" version ".tar.gz"))
925 (sha256
926 (base32
927 "0dg6mpg9n4g9diyrbnbb5vd9d1qw9f265zwhknqy0mxh0cvmjjrq"))))
928 (build-system python-build-system)
929 (inputs
930 `(("python-setuptools" ,python-setuptools)))
931 (arguments
932 `(#:phases
933 (alist-replace
934 'check
935 (lambda _ (zero? (system* "python" "enum/test_enum.py")))
936 %standard-phases)))
937 (home-page "https://pypi.python.org/pypi/enum34")
938 (synopsis "Backported Python 3.4 Enum")
939 (description
940 "Enum34 is the new Python stdlib enum module available in Python 3.4
941backported for previous versions of Python from 2.4 to 3.3.")
942 (license bsd-3)))
943
944(define-public python-parse-type
945 (package
946 (name "python-parse-type")
947 (version "0.3.4")
948 (source
949 (origin
950 (method url-fetch)
951 (uri (string-append "https://pypi.python.org/packages/source/p/"
952 "parse_type/parse_type-" version ".tar.gz"))
953 (sha256
954 (base32
955 "0iv1c34npr4iynwpgv1vkjx9rjd18a85ir8c01gc5f7wp8iv7l1x"))))
956 (build-system python-build-system)
957 (inputs
958 `(("python-setuptools" ,python-setuptools)
959 ("python-six" ,python-six)
960 ("python-parse" ,python-parse)
961 ("python-enum34" ,python-enum34))) ;required for python<3.4
962 (arguments '(#:tests? #f)) ;TODO: tests require pytest
963 (home-page "https://github.com/jenisys/parse_type")
964 (synopsis "Extended parse module")
965 (description
966 "Parse_type extends the python parse module.")
967 (license bsd-3)))
968
969(define-public python-parse
970 (package
971 (name "python-parse")
972 (version "1.6.4")
973 (source
974 (origin
975 (method url-fetch)
976 (uri (string-append "https://pypi.python.org/packages/source/p/"
977 "parse/parse-" version ".tar.gz"))
978 (sha256
979 (base32
980 "0m30q64l6szl7s9mhvqy64w2fdhdn8lb91fmacjiwbv3479cmk57"))))
981 (build-system python-build-system)
982 (arguments
983 `(#:phases
984 (alist-replace
985 'check
986 (lambda _ (zero? (system* "python" "test_parse.py")))
987 %standard-phases)))
988 (home-page "https://github.com/r1chardj0n3s/parse")
989 (synopsis "Parse strings")
990 (description
991 "Parse strings using a specification based on the Python format()
992syntax.")
993 (license x11)))
994
995
515e6878
LC
996(define-public scons
997 (package
998 (name "scons")
999 (version "2.1.0")
1000 (source (origin
1001 (method url-fetch)
1002 (uri (string-append "mirror://sourceforge/scons/scons-"
1003 version ".tar.gz"))
1004 (sha256
1005 (base32
1006 "07cjn4afb2cljjrd3cr7xf062qq58z8q96f58z6yplhdyqafsfa1"))))
1007 (build-system python-build-system)
1008 (arguments
1009 ;; With Python 3.x, fails to build with a syntax error.
1010 `(#:python ,python-2
1011 #:tests? #f)) ; no 'python setup.py test' command
1012 (home-page "http://scons.org/")
1013 (synopsis "Software construction tool written in Python")
1014 (description
1015 "SCons is a software construction tool. Think of SCons as an improved,
1016cross-platform substitute for the classic Make utility with integrated
1017functionality similar to autoconf/automake and compiler caches such as ccache.
1018In short, SCons is an easier, more reliable and faster way to build
1019software.")
1020 (license x11)))
011b18c3 1021
c15a5c0e
DT
1022(define-public python-extras
1023 (package
1024 (name "python-extras")
1025 (version "0.0.3")
1026 (source
1027 (origin
1028 (method url-fetch)
1029 (uri (string-append
1030 "https://pypi.python.org/packages/source/e/extras/extras-"
1031 version ".tar.gz"))
1032 (sha256
1033 (base32
1034 "1h7zx4dfyclalg0fqnfjijpn0f793a9mx8sy3b27gd31nr6dhq3s"))))
1035 (build-system python-build-system)
1036 (inputs
1037 `(("python-setuptools" ,python-setuptools)))
1038 (arguments
1039 ;; error in setup.cfg: command 'test' has no such option 'buffer'
1040 '(#:tests? #f))
1041 (home-page "https://github.com/testing-cabal/extras")
1042 (synopsis "Useful extensions to the Python standard library")
1043 (description
1044 "Extras is a set of extensions to the Python standard library.")
bd3fa666 1045 (license license:expat)))
c15a5c0e
DT
1046
1047(define-public python2-extras
1048 (package-with-python2 python-extras))
1049
56ea0efd
DT
1050(define-public python-mimeparse
1051 (package
1052 (name "python-mimeparse")
1053 (version "0.1.4")
1054 (source
1055 (origin
1056 (method url-fetch)
1057 (uri (string-append
1058 "https://pypi.python.org/packages/source/p/python-mimeparse/python-mimeparse-"
1059 version ".tar.gz"))
1060 (sha256
1061 (base32
1062 "1hyxg09kaj02ri0rmwjqi86wk4nd1akvv7n0dx77azz76wga4s9w"))))
1063 (build-system python-build-system)
1064 (inputs
1065 `(("python-setuptools" ,python-setuptools)))
1066 (arguments
1067 '(#:tests? #f)) ; no setup.py test command
1068 (home-page
1069 "https://github.com/dbtsai/python-mimeparse")
9e771e3b 1070 (synopsis "Python library for parsing MIME types")
56ea0efd
DT
1071 (description
1072 "Mimeparse provides basic functions for parsing MIME type names and
1073matching them against a list of media-ranges.")
bd3fa666 1074 (license license:expat)))
56ea0efd
DT
1075
1076(define-public python2-mimeparse
1077 (package-with-python2 python-mimeparse))
1078
4435427e
DT
1079(define-public python-nose
1080 (package
1081 (name "python-nose")
1082 (version "1.3.4")
1083 (source
1084 (origin
1085 (method url-fetch)
1086 (uri (string-append
1087 "https://pypi.python.org/packages/source/n/nose/nose-"
1088 version ".tar.gz"))
1089 (sha256
1090 (base32
1091 "00qymfgwg4iam4xi0w9bnv7lcb3fypq1hzfafzgs1rfmwaj67g3n"))))
1092 (build-system python-build-system)
1093 (inputs
1094 `(("python-setuptools" ,python-setuptools)))
1095 (arguments
1096 '(#:tests? #f)) ; FIXME: test suite fails
1097 (home-page "http://readthedocs.org/docs/nose/")
1098 (synopsis "Python testing library")
1099 (description
1100 "Nose extends the unittest library to make testing easier.")
1101 (license lgpl2.0+)))
1102
1103(define-public python2-nose
1104 (package-with-python2 python-nose))
1105
6cd9c356
DT
1106(define-public python-unittest2
1107 (package
1108 (name "python-unittest2")
1109 (version "0.5.1")
1110 (source
1111 (origin
1112 (method url-fetch)
1113 (uri (string-append
1114 "https://pypi.python.org/packages/source/u/unittest2py3k/unittest2py3k-"
1115 version ".tar.gz"))
1116 (sha256
1117 (base32
1118 "00yl6lskygcrddx5zspkhr0ibgvpknl4678kkm6s626539grq93q"))))
1119 (build-system python-build-system)
1120 (inputs
1121 `(("python-setuptools" ,python-setuptools)))
1122 (home-page "http://pypi.python.org/pypi/unittest2")
1123 (synopsis "Python unit testing library")
1124 (description
1125 "Unittest2 is a replacement for the unittest module in the Python
1126standard library.")
1127 (license psfl)))
1128
1129(define-public python2-unittest2
1130 (package (inherit python-unittest2)
1131 (name "python2-unittest2")
1132 (version "0.5.1")
1133 (source
1134 (origin
1135 (method url-fetch)
1136 (uri (string-append
1137 "https://pypi.python.org/packages/source/u/unittest2/unittest2-"
1138 version ".tar.gz"))
1139 (sha256
1140 (base32
1141 "0wbs4i4x3x7klr3v35ss6p9mcqz883i1xgcpkhvl7n2lyv6yhpda"))))
1142 (inputs
1143 `(("python2-setuptools" ,python-setuptools)))
1144 (arguments
1145 `(#:python ,python-2
1146 #:tests? #f)))) ; no setup.py test command
1147
542ad60f
DT
1148(define-public python-py
1149 (package
1150 (name "python-py")
1151 (version "1.4.23")
1152 (source
1153 (origin
1154 (method url-fetch)
1155 (uri (string-append
1156 "https://pypi.python.org/packages/source/p/py/py-"
1157 version ".tar.gz"))
1158 (sha256
1159 (base32
1160 "1jkhffpai419v5rickm2vz86p9bkg3b3kcm2k4bi5wfajhw2m3xs"))))
1161 (build-system python-build-system)
1162 (inputs
1163 `(("python-setuptools" ,python-setuptools)))
1164 (home-page "http://pylib.readthedocs.org/")
1165 (synopsis "Python library for parsing, I/O, instrospection, and logging")
1166 (description
1167 "Py is a Python library for file name parsing, .ini file parsing, I/O,
1168code introspection, and logging.")
bd3fa666 1169 (license license:expat)))
542ad60f
DT
1170
1171(define-public python2-py
1172 (package-with-python2 python-py))
1173
855d4761
DT
1174(define-public python-pytest
1175 (package
1176 (name "python-pytest")
1177 (version "2.6.1")
1178 (source
1179 (origin
1180 (method url-fetch)
1181 (uri (string-append
1182 "https://pypi.python.org/packages/source/p/pytest/pytest-"
1183 version ".tar.gz"))
1184 (sha256
1185 (base32
1186 "0g2w4p0n42wvz8rq4k6gnzpkakgz3g8sfanxk8jrsra9675snkcr"))
1187 (modules '((guix build utils)))
1188 (snippet
1189 ;; One of the tests involves the /usr directory, so it fails.
1190 '(substitute* "testing/test_argcomplete.py"
1191 (("def test_remove_dir_prefix\\(self\\):")
1192 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):")))))
1193 (build-system python-build-system)
1194 (inputs
1195 `(("python-setuptools" ,python-setuptools)
1196 ("python-py" ,python-py)
1197 ("python-nose" ,python-nose)
1198 ("python-mock" ,python-mock)))
1199 (home-page "http://pytest.org")
1200 (synopsis "Python testing library")
1201 (description
1202 "Pytest is a testing tool that provides auto-discovery of test modules
1203and functions, detailed info on failing assert statements, modular fixtures,
1204and many external plugins.")
bd3fa666 1205 (license license:expat)))
855d4761
DT
1206
1207(define-public python2-pytest
1208 (package-with-python2 python-pytest))
1209
84d24017
DT
1210(define-public python-scripttest
1211 (package
1212 (name "python-scripttest")
1213 (version "1.3")
1214 (source
1215 (origin
1216 (method url-fetch)
1217 (uri (string-append
1218 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
1219 version ".tar.gz"))
1220 (sha256
1221 (base32
1222 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1223 (build-system python-build-system)
1224 (inputs
1225 `(("python-setuptools" ,python-setuptools)
1226 ("python-pytest" ,python-pytest)))
1227 (home-page "http://pythonpaste.org/scripttest/")
1228 (synopsis "Python library to test command-line scripts")
1229 (description "Scripttest is a Python helper library for testing
1230interactive command-line applications. With it you can run a script in a
1231subprocess and see the output as well as any file modifications.")
bd3fa666 1232 (license license:expat)))
84d24017
DT
1233
1234(define-public python2-scripttest
1235 (package-with-python2 python-scripttest))
1236
d8fa80e1
DT
1237(define-public python-testtools
1238 (package
1239 (name "python-testtools")
1240 (version "1.0.0")
1241 (source
1242 (origin
1243 (method url-fetch)
1244 (uri (string-append
1245 "https://pypi.python.org/packages/source/t/testtools/testtools-"
1246 version ".tar.gz"))
1247 (sha256
1248 (base32
1249 "1dyml28ykpl5jb9khdmcdvhy1cxqingys6qvj2k04fzlaj6z3bbx"))))
1250 (build-system python-build-system)
1251 (inputs
1252 `(("python-setuptools" ,python-setuptools)
1253 ("python-mimeparse" ,python-mimeparse)
1254 ("python-extras" ,python-extras)))
1255 (home-page "https://github.com/testing-cabal/testtools")
1256 (synopsis
1257 "Extensions to the Python standard library unit testing framework")
1258 (description
1259 "Testtools extends the Python standard library unit testing framework to
1260provide matchers, more debugging information, and cross-Python
1261compatibility.")
1262 (license psfl)))
1263
1264(define-public python2-testtools
1265 (package-with-python2 python-testtools))
1266
5bf3afea
DT
1267(define-public python-testscenarios
1268 (package
1269 (name "python-testscenarios")
1270 (version "0.4")
1271 (source
1272 (origin
1273 (method url-fetch)
1274 (uri (string-append
1275 "https://pypi.python.org/packages/source/t/testscenarios/testscenarios-"
1276 version ".tar.gz"))
1277 (sha256
1278 (base32
1279 "1671jvrvqlmbnc42j7pc5y6vc37q44aiwrq0zic652pxyy2fxvjg"))))
1280 (build-system python-build-system)
1281 (inputs
1282 `(("python-setuptools" ,python-setuptools)
1283 ("python-testtools" ,python-testtools)
1284 ("python-mimeparse" ,python-mimeparse)))
1285 (home-page "https://launchpad.net/testscenarios")
1286 (synopsis "Pyunit extension for dependency injection")
1287 (description
1288 "Testscenarios provides clean dependency injection for Python unittest
1289style tests.")
1290 (license (list bsd-3 asl2.0)))) ; at the user's option
1291
1292(define-public python2-testscenarios
1293 (package-with-python2 python-testscenarios))
1294
dac79ecc
DT
1295(define-public python-testresources
1296 (package
1297 (name "python-testresources")
1298 (version "0.2.7")
1299 (source
1300 (origin
1301 (method url-fetch)
1302 (uri (string-append
1303 "https://pypi.python.org/packages/source/t/testresources/testresources-"
1304 version ".tar.gz"))
1305 (sha256
1306 (base32
1307 "0cbj3plbllyz42c4b5xxgwaa7mml54lakslrn4kkhinxhdri22md"))))
1308 (build-system python-build-system)
1309 (inputs
1310 `(("python-setuptools" ,python-setuptools)))
1311 (home-page "https://launchpad.net/testresources")
1312 (synopsis
1313 "Pyunit extension for managing test resources")
1314 (description
1315 "Testresources is an extension to Python's unittest to allow declarative
1316use of resources by test cases.")
1317 (license (list bsd-3 asl2.0)))) ; at the user's option
1318
1319(define-public python2-testresources
1320 (package-with-python2 python-testresources))
1321
070ab058
DT
1322(define-public python-subunit
1323 (package
1324 (name "python-subunit")
1325 (version "0.0.21")
1326 (source
1327 (origin
1328 (method url-fetch)
1329 (uri (string-append
1330 "https://pypi.python.org/packages/source/p/python-subunit/python-subunit-"
1331 version ".tar.gz"))
1332 (sha256
1333 (base32
1334 "1nkw9wfbvizmpajbj3in8ns07g7lwkiv8hip14jjlwk3cacls6jv"))))
1335 (build-system python-build-system)
1336 (inputs
1337 `(("python-setuptools" ,python-setuptools)
1338 ("python-testtools" ,python-testtools)
1339 ("python-mimeparse" ,python-mimeparse)
1340 ("python-testscenarios" ,python-testscenarios)))
1341 (home-page "http://launchpad.net/subunit")
1342 (synopsis "Python implementation of the subunit protocol")
1343 (description
1344 "Python-subunit is a Python implementation of the subunit test streaming
1345protocol.")
1346 (license (list bsd-3 asl2.0)))) ; at the user's option
1347
1348(define-public python2-subunit
1349 (package-with-python2 python-subunit))
1350
cd49454b
DT
1351(define-public python-fixtures
1352 (package
1353 (name "python-fixtures")
1354 (version "0.3.16")
1355 (source
1356 (origin
1357 (method url-fetch)
1358 (uri (string-append
1359 "https://pypi.python.org/packages/source/f/fixtures/fixtures-"
1360 version ".tar.gz"))
1361 (sha256
1362 (base32
1363 "0x9r2gwilcig5g54k60bxzg96zabizq1855lrprlb4zckalp9asc"))))
1364 (build-system python-build-system)
1365 (inputs
1366 `(("python-setuptools" ,python-setuptools)))
1367 (arguments
1368 '(#:tests? #f)) ; no setup.py test command
1369 (home-page "https://launchpad.net/python-fixtures")
1370 (synopsis "Python test fixture library")
1371 (description
1372 "Fixtures provides a way to create reusable state, useful when writing
1373Python tests.")
1374 (license (list bsd-3 asl2.0)))) ; at user's option
1375
1376(define-public python2-fixtures
1377 (package-with-python2 python-fixtures))
1378
b24a0c00
DT
1379(define-public python-testrepository
1380 (package
1381 (name "python-testrepository")
1382 (version "0.0.20")
1383 (source
1384 (origin
1385 (method url-fetch)
1386 (uri (string-append
1387 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1388 version ".tar.gz"))
1389 (sha256
1390 (base32
1391 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1392 (build-system python-build-system)
1393 (inputs
1394 `(("python-setuptools" ,python-setuptools)
1395 ("python-testtools" ,python-testtools)
1396 ("python-subunit" ,python-subunit)
1397 ("python-fixtures" ,python-fixtures)
1398 ("python-mimeparse" ,python-mimeparse)))
1399 (home-page "https://launchpad.net/testrepository")
1400 (synopsis "Database for Python test results")
1401 (description "Testrepository provides a database of test results which can
1402be used as part of a developer's workflow to check things such as what tests
1403have failed since the last commit or what tests are currently failing.")
1404 (license (list bsd-3 asl2.0)))) ; at user's option
1405
1406(define-public python2-testrepository
1407 (package-with-python2 python-testrepository))
1408
243a009a
DT
1409(define-public python-coverage
1410 (package
1411 (name "python-coverage")
1412 (version "3.7.1")
1413 (source
1414 (origin
1415 (method url-fetch)
1416 (uri (string-append
1417 "https://pypi.python.org/packages/source/c/coverage/coverage-"
1418 version ".tar.gz"))
1419 (sha256
1420 (base32
1421 "0knlbq79g2ww6xzsyknj9rirrgrgc983dpa2d9nkdf31mb2a3bni"))))
1422 (build-system python-build-system)
1423 (inputs
1424 `(("python-setuptools" ,python-setuptools)))
1425 (home-page "http://nedbatchelder.com/code/coverage")
1426 (synopsis "Code coverage measurement for Python")
1427 (description
1428 "Coverage measures code coverage, typically during test execution. It
1429uses the code analysis tools and tracing hooks provided in the Python standard
1430library to determine which lines are executable, and which have been
1431executed.")
1432 (license bsd-3)))
1433
1434(define-public python2-coverage
1435 (package-with-python2 python-coverage))
1436
041358fb
DT
1437(define-public python-discover
1438 (package
1439 (name "python-discover")
1440 (version "0.4.0")
1441 (source
1442 (origin
1443 (method url-fetch)
1444 (uri (string-append
1445 "https://pypi.python.org/packages/source/d/discover/discover-"
1446 version ".tar.gz"))
1447 (sha256
1448 (base32
1449 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1450 (build-system python-build-system)
1451 (inputs
1452 `(("python-setuptools" ,python-setuptools)))
1453 (home-page "http://pypi.python.org/pypi/discover/")
1454 (synopsis
1455 "Python test discovery for unittest")
1456 (description
1457 "Discover provides test discovery for unittest, a feature that has been
1458backported from Python 2.7 for Python 2.4+")
1459 (license bsd-3)))
1460
1461(define-public python2-discover
1462 (package-with-python2 python-discover))
1463
a480bc41
EB
1464(define-public behave
1465 (package
1466 (name "behave")
1467 (version "1.2.4")
1468 (source (origin
1469 (method url-fetch)
1470 (uri (string-append "https://pypi.python.org/packages/source/b/"
1471 name "/" name "-" version ".tar.gz"))
1472 (sha256
1473 (base32
1474 "1v2rfy8xnf0rk7cj4cgr7lam4015d458i7bg0xqs9czfv6njlm14"))))
1475 (build-system python-build-system)
1476 (inputs
1477 `(("python-setuptools" ,python-setuptools)
1478 ("python-six" ,python-six)
1479 ("python-enum43" ,python-enum34)
1480 ("python-parse" ,python-parse)
1481 ("python-parse-type" ,python-parse-type)))
1482 (arguments `(#:tests? #f)) ;TODO: tests require nose>=1.3 and
1483 ;PyHamcrest>=1.8
1484 (home-page "http://github.com/behave/behave")
1485 (synopsis "Python behavior-driven development")
1486 (description
1487 "Behave is a tool for behavior-driven development in python.
1488Behavior-driven development (or BDD) is an agile software development
1489technique that encourages collaboration between developers, QA and
1490non-technical or business participants in a software project. Behave uses
1491tests written in a natural language style, backed up by Python code.")
1492 (license x11)))
c7303d3c
DT
1493
1494(define-public python-exif-read
1495 (package
1496 (name "python-exif-read")
1497 (version "1.4.2")
1498 (source (origin
1499 (method url-fetch)
1500 (uri
1501 (string-append
1502 "https://pypi.python.org/packages/source/E/ExifRead/ExifRead-"
1503 version ".tar.gz"))
1504 (sha256
1505 (base32
1506 "17c627gcdmyc05hz4zk8qs4pjgw6rc68qzjzgz8gh1cmpsd7acf1"))))
1507 (build-system python-build-system)
1508 (inputs
1509 `(("python-setuptools" ,python-setuptools)))
1510 (arguments `(#:tests? #f)) ; no tests
1511 (home-page "https://github.com/ianare/exif-py")
1512 (synopsis "Python library to extract EXIF data from image files")
1513 (description
1514 "ExifRead is a Python library to extract EXIF data from tiff and jpeg
1515files.")
1516 (license bsd-3)))
1517
1518(define-public python2-exif-read
1519 (package-with-python2 python-exif-read))
d5f89b22
DT
1520
1521(define-public python-pyld
1522 (package
1523 (name "python-pyld")
1524 (version "0.6.0")
1525 (source (origin
1526 (method url-fetch)
1527 (uri
1528 (string-append
1529 "https://pypi.python.org/packages/source/P/PyLD/PyLD-"
1530 version ".tar.gz"))
1531 (sha256
1532 (base32
1533 "1l9ymj85fsvayqplinzpk0kyiq6m74ps9xd3a9fhlxfn1rldf8x8"))))
1534 (build-system python-build-system)
1535 (inputs
1536 `(("python-setuptools" ,python-setuptools)))
1537 (arguments `(#:tests? #f)) ; no tests
1538 (home-page "http://github.com/digitalbazaar/pyld")
1539 (synopsis "Python implementation of the JSON-LD specification")
1540 (description
1541 "PyLD is an implementation of the JSON-LD specification.")
1542 (license bsd-3)))
1543
1544(define-public python2-pyld
1545 (package-with-python2 python-pyld))
3a1f9a68
DT
1546
1547(define-public python-certifi
1548 (package
1549 (name "python-certifi")
1550 (version "14.05.14")
1551 (source (origin
1552 (method url-fetch)
1553 (uri
1554 (string-append
1555 "https://pypi.python.org/packages/source/c/certifi/certifi-"
1556 version ".tar.gz"))
1557 (sha256
1558 (base32
1559 "0s8vxzfz6s4m6fvxc7z25k9j35w0rh6jkw3wwcd1az1mssncn6qy"))))
1560 (build-system python-build-system)
1561 (inputs
1562 `(("python-setuptools" ,python-setuptools)))
1563 (arguments `(#:tests? #f)) ; no tests
1564 (home-page "http://python-requests.org/")
1565 (synopsis "Python CA certificate bundle")
1566 (description
1567 "Certifi is a Python library that contains a CA certificate bundle, which
1568is used by the Requests library to verify HTTPS requests.")
1569 (license asl2.0)))
1570
1571(define-public python2-certifi
1572 (package-with-python2 python-certifi))
e6cfbd36 1573
ae641128 1574(define-public python-requests
e6cfbd36 1575 (package
ae641128 1576 (name "python-requests")
e6cfbd36
DT
1577 (version "2.4.0")
1578 (source (origin
1579 (method url-fetch)
1580 (uri
1581 (string-append
1582 "https://pypi.python.org/packages/source/r/requests/requests-"
1583 version ".tar.gz"))
1584 (sha256
1585 (base32
1586 "0gknlfx1wakrrm1zi8gi03x2lzj4dsns0vjw0nsmgqvkphyf01vh"))))
1587 (build-system python-build-system)
1588 (inputs
1589 `(("python-setuptools" ,python-setuptools)
1590 ("python-certifi" ,python-certifi)))
ae641128 1591 (arguments `(#:tests? #f)) ; no tests
e6cfbd36
DT
1592 (home-page "http://python-requests.org/")
1593 (synopsis "Python HTTP library")
1594 (description
1595 "Requests is a Python HTTP client library. It aims to be easier to use
1596than Python’s urllib2 library.")
1597 (license asl2.0)))
864b5211 1598
ae641128
DT
1599(define-public python2-requests
1600 (package-with-python2 python-requests))
1601
864b5211
DT
1602(define-public python-jsonschema
1603 (package
1604 (name "python-jsonschema")
1605 (version "2.4.0")
1606 (source (origin
1607 (method url-fetch)
1608 (uri
1609 (string-append
1610 "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-"
1611 version ".tar.gz"))
1612 (sha256
1613 (base32
1614 "1yik3031ziygvq66rj3mzfqdgxj29sg1bkfc46wsgi7lnbqs560j"))))
1615 (build-system python-build-system)
1616 (inputs
1617 `(("python-setuptools" ,python-setuptools)))
1618 (home-page "http://github.com/Julian/jsonschema")
1619 (synopsis "Implementation of JSON Schema for Python")
1620 (description
1621 "Jsonschema is an implementation of JSON Schema for Python.")
bd3fa666 1622 (license license:expat)))
864b5211
DT
1623
1624(define-public python2-jsonschema
1625 (package-with-python2 python-jsonschema))
850189b8
DT
1626
1627(define-public python-unidecode
1628 (package
1629 (name "python-unidecode")
1630 (version "0.04.16")
1631 (source (origin
1632 (method url-fetch)
1633 (uri
1634 (string-append
1635 "https://pypi.python.org/packages/source/U/Unidecode/Unidecode-"
1636 version ".tar.gz"))
1637 (sha256
1638 (base32
1639 "0yv56vc49rvippyxgxvcyz7jklc07ky38rcspax7p00sgmriiljc"))))
1640 (build-system python-build-system)
1641 (inputs
1642 `(("python-setuptools" ,python-setuptools)))
1643 (home-page "https://pypi.python.org/pypi/Unidecode")
1644 (synopsis "ASCII transliterations of Unicode text")
1645 (description
1646 "Unidecode provides ASCII transliterations of Unicode text. Unidecode is
1647useful when integrating with legacy code that doesn't support Unicode, or for
1648ease of entry of non-Roman names on a US keyboard, or when constructing ASCII
1649machine identifiers from human-readable Unicode strings that should still be
1650somewhat intelligeble.")
1651 (license gpl2+)))
1652
1653(define-public python2-unidecode
1654 (package-with-python2 python-unidecode))
6d45fef4
DT
1655
1656(define-public python-pyjwt
1657 (package
1658 (name "python-pyjwt")
1659 (version "0.2.1")
1660 (source
1661 (origin
1662 (method url-fetch)
1663 (uri (string-append
1664 "https://pypi.python.org/packages/source/P/PyJWT/PyJWT-"
1665 version ".tar.gz"))
1666 (sha256
1667 (base32
1668 "1ahqblfy2sj3xz34wsa48cn9rp0dspzq56p54i5znmws3b8gml6g"))))
1669 (build-system python-build-system)
1670 (inputs
1671 `(("python-setuptools" ,python-setuptools)))
1672 (arguments
1673 '(#:tests? #f)) ; test suite doesn't work
1674 (home-page "http://github.com/progrium/pyjwt")
1675 (synopsis "JSON Web Token implementation in Python")
1676 (description
1677 "PyJWT is a JSON Web Token implementation written in Python.")
bd3fa666 1678 (license license:expat)))
6d45fef4
DT
1679
1680(define-public python2-pyjwt
1681 (package-with-python2 python-pyjwt))
1682
2cec1f6f
DT
1683(define-public python-oauthlib
1684 (package
1685 (name "python-oauthlib")
1686 (version "0.6.3")
1687 (source (origin
1688 (method url-fetch)
1689 (uri
1690 (string-append
1691 "https://pypi.python.org/packages/source/o/oauthlib/oauthlib-"
1692 version ".tar.gz"))
1693 (sha256
1694 (base32
1695 "1yaj3j64la4arwsbhbfmpnickzh3jpg9nlpyg409v8pp24isn48a"))))
1696 (build-system python-build-system)
1697 (inputs
1698 `(("python-setuptools" ,python-setuptools)
1699 ("python-pyjwt" ,python-pyjwt)
1700 ("python-pycrypto" ,python-pycrypto)
1701 ("python-nose" ,python-nose)
1702 ("python-mock" ,python-mock)))
1703 (home-page "https://github.com/idan/oauthlib")
1704 (synopsis "OAuth implementation for Python")
1705 (description
1706 "Oauthlib is a generic, spec-compliant, thorough implementation of the
1707OAuth request-signing logic.")
1708 (license bsd-3)))
1709
1710(define-public python2-oauthlib
1711 (let ((base (package-with-python2 python-oauthlib)))
1712 (package
1713 (inherit base)
2cec1f6f
DT
1714 (inputs
1715 (append (package-inputs base)
1716 `(("python2-unittest2" ,python2-unittest2)))))))
ec5dbb5c
DT
1717
1718(define-public python-itsdangerous
1719 (package
1720 (name "python-itsdangerous")
1721 (version "0.24")
1722 (source
1723 (origin
1724 (method url-fetch)
1725 (uri (string-append
1726 "https://pypi.python.org/packages/source/i/itsdangerous/itsdangerous-"
1727 version ".tar.gz"))
1728 (sha256
1729 (base32
1730 "06856q6x675ly542ig0plbqcyab6ksfzijlyf1hzhgg3sgwgrcyb"))))
1731 (build-system python-build-system)
1732 (inputs
1733 `(("python-setuptools" ,python-setuptools)))
1734 (home-page "http://github.com/mitsuhiko/itsdangerous")
1735 (synopsis "Python library for passing data to/from untrusted environments")
1736 (description
1737 "Itsdangerous provides various helpers to pass trusted data to untrusted
1738environments and back.")
1739 (license bsd-3)))
1740
1741(define-public python2-itsdangerous
1742 (package-with-python2 python-itsdangerous))
5731cae3 1743
8d12be1e
RW
1744(define-public python-pyyaml
1745 (package
1746 (name "python-pyyaml")
1747 (version "3.11")
1748 (source
1749 (origin
1750 (method url-fetch)
1751 (uri (string-append
1752 "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-"
1753 version ".tar.gz"))
1754 (sha256
1755 (base32
1756 "1s26125vfnskng58ym37xhwv8v0mm95b2cwbjfag8prfhy596v63"))))
1757 (build-system python-build-system)
1758 (inputs
1759 `(("libyaml" ,libyaml)))
1760 (native-inputs
1761 `(("python-setuptools" ,python-setuptools)))
1762 (home-page "http://pyyaml.org/wiki/PyYAML")
1763 (synopsis "YAML parser and emitter for Python")
1764 (description
1765 "PyYAML is a YAML parser and emitter for Python. PyYAML features a
1766complete YAML 1.1 parser, Unicode support, pickle support, capable extension
1767API, and sensible error messages. PyYAML supports standard YAML tags and
1768provides Python-specific tags that allow to represent an arbitrary Python
1769object.")
1770 (license license:expat)))
1771
1772(define-public python2-pyyaml
1773 (package-with-python2 python-pyyaml))
1774
5731cae3
DT
1775(define-public python-virtualenv
1776 (package
1777 (name "python-virtualenv")
1778 (version "1.11.6")
1779 (source
1780 (origin
1781 (method url-fetch)
1782 (uri (string-append
1783 "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-"
1784 version ".tar.gz"))
1785 (sha256
1786 (base32
1787 "1xq4prmg25n9cz5zcvbqx68lmc3kl39by582vd8pzs9f3qalqyiy"))))
1788 (build-system python-build-system)
1789 (inputs
1790 `(("python-setuptools" ,python-setuptools)
1791 ("python-mock" ,python-mock)
1792 ("python-nose" ,python-nose)))
1793 (home-page "https://virtualenv.pypa.io/")
1794 (synopsis "Virtual Python environment builder")
1795 (description
1796 "Virtualenv is a tool to create isolated Python environments.")
bd3fa666 1797 (license license:expat)))
5731cae3
DT
1798
1799(define-public python2-virtualenv
1800 (package-with-python2 python-virtualenv))
8176d4d5
DT
1801
1802(define-public python-markupsafe
1803 (package
1804 (name "python-markupsafe")
1805 (version "0.23")
1806 (source
1807 (origin
1808 (method url-fetch)
1809 (uri (string-append
1810 "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-"
1811 version ".tar.gz"))
1812 (sha256
1813 (base32
1814 "1hvip33wva3fnmvfp9x5klqri7hpl1hkgqmjbss18nmrb7zimv54"))))
1815 (build-system python-build-system)
1816 (inputs
1817 `(("python-setuptools" ,python-setuptools)))
1818 (home-page "http://github.com/mitsuhiko/markupsafe")
1819 (synopsis "XML/HTML/XHTML markup safe string implementation for Python")
1820 (description
1821 "Markupsafe provides an XML/HTML/XHTML markup safe string implementation
1822for Python.")
1823 (license bsd-3)))
1824
1825(define-public python2-markupsafe
1826 (package-with-python2 python-markupsafe))
fe34f0d1
DT
1827
1828(define-public python-jinja2
1829 (package
1830 (name "python-jinja2")
1831 (version "2.7.3")
1832 (source
1833 (origin
1834 (method url-fetch)
1835 (uri (string-append
1836 "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-"
1837 version ".tar.gz"))
1838 (sha256
1839 (base32
1840 "1nwg9yfqgy421lncnm63k1zf9xkd1klc0jm0fr4p3dad01fsq91f"))))
1841 (build-system python-build-system)
1842 (inputs
1843 `(("python-setuptools" ,python-setuptools)
1844 ("python-markupsafe" ,python-markupsafe)))
1845 (home-page "http://jinja.pocoo.org/")
1846 (synopsis "Python template engine")
1847 (description
1848 "Jinja2 is a small but fast and easy to use stand-alone template engine
1849written in pure Python.")
1850 (license bsd-3)))
1851
1852(define-public python2-jinja2
1853 (package-with-python2 python-jinja2))
3580ab8b
DT
1854
1855(define-public python-docutils
1856 (package
1857 (name "python-docutils")
1858 (version "0.12")
1859 (source
1860 (origin
1861 (method url-fetch)
1862 (uri (string-append
1863 "https://pypi.python.org/packages/source/d/docutils/docutils-"
1864 version ".tar.gz"))
1865 (sha256
1866 (base32
1867 "1ylnjnw1x4b2y7blr6x35ncdzn69k253kw4cdkv6asdb21w73ny7"))))
1868 (build-system python-build-system)
1869 (inputs
1870 `(("python-setuptools" ,python-setuptools)))
1871 (arguments
1872 '(#:tests? #f)) ; no setup.py test command
1873 (home-page "http://docutils.sourceforge.net/")
1874 (synopsis "Python Documentation Utilities")
1875 (description
1876 "Docutils is a modular system for processing documentation into useful
1877formats, such as HTML, XML, and LaTeX. For input Docutils supports
1878reStructuredText.")
1879 ;; Most of the source code is public domain, but some source files are
1880 ;; licensed under the PFSL, BSD 2-clause, and GPLv3+ licenses.
1881 (license (list public-domain psfl bsd-2 gpl3+))))
1882
1883(define-public python2-docutils
1884 (package-with-python2 python-docutils))
fb35b7c0
DT
1885
1886(define-public python-pygments
1887 (package
1888 (name "python-pygments")
1889 (version "1.6")
1890 (source
1891 (origin
1892 (method url-fetch)
1893 (uri (string-append
1894 "https://pypi.python.org/packages/source/P/Pygments/Pygments-"
1895 version ".tar.gz"))
1896 (sha256
1897 (base32
1898 "1h11r6ss8waih51vcksfvzghfxiav2f8svc0812fa5kmyz5d97kr"))))
1899 (build-system python-build-system)
1900 (inputs
1901 `(("python-setuptools" ,python-setuptools)))
1902 (home-page "http://pygments.org/")
1903 (synopsis "Syntax highlighting")
1904 (description
1905 "Pygments is a syntax highlighting package written in Python.")
1906 (license bsd-2)))
1907
1908(define-public python2-pygments
1909 (package-with-python2 python-pygments))
9dd6078d
DT
1910
1911(define-public python-sphinx
1912 (package
1913 (name "python-sphinx")
1914 (version "1.2.3")
1915 (source
1916 (origin
1917 (method url-fetch)
1918 (uri (string-append
1919 "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-"
1920 version ".tar.gz"))
1921 (sha256
1922 (base32
1923 "011xizm3jnmf4cvs5i6kgf6c5nn046h79i8j0vd0f27yw9j3p4wl"))))
1924 (build-system python-build-system)
1925 (inputs
1926 `(("python-setuptools" ,python-setuptools)
1927 ("python-jinja2" ,python-jinja2)
1928 ("python-docutils" ,python-docutils)
1929 ("python-pygments" ,python-pygments)))
1930 (home-page "http://sphinx-doc.org/")
1931 (synopsis "Python documentation generator")
1932 (description "Sphinx is a tool that makes it easy to create documentation
1933for Python projects or other documents consisting of multiple reStructuredText
1934sources.")
1935 (license bsd-3)))
1936
1937(define-public python2-sphinx
1938 (package-with-python2 python-sphinx))
6888830b 1939
ad320b20
RW
1940(define-public python-sphinx-rtd-theme
1941 (package
1942 (name "python-sphinx-rtd-theme")
1943 (version "0.1.6")
1944 (source
1945 (origin
1946 (method url-fetch)
1947 (uri (string-append "https://pypi.python.org/packages/source/s/"
1948 "sphinx_rtd_theme/sphinx_rtd_theme-"
1949 version ".tar.gz"))
1950 (sha256
1951 (base32
1952 "19nw3rn7awplcdrz63kg1njqwkbymfg9lwn7l2grhdyhyr2gaa8g"))))
1953 (build-system python-build-system)
1954 (arguments
1955 `(;; With standard flags, the install phase attempts to create a zip'd
1956 ;; egg file, and fails with an error: 'ZIP does not support timestamps
1957 ;; before 1980'
1958 #:configure-flags '("--single-version-externally-managed"
1959 "--record=sphinx-rtd-theme.txt")))
1960 (native-inputs
1961 `(("python-setuptools" ,python-setuptools)))
1962 (inputs
1963 `(("python-docutils" ,python-docutils)
1964 ("python-sphinx" ,python-sphinx)))
1965 (home-page "https://github.com/snide/sphinx_rtd_theme/")
1966 (synopsis "ReadTheDocs.org theme for Sphinx")
1967 (description "A theme for Sphinx used by ReadTheDocs.org.")
bd3fa666 1968 (license license:expat)))
ad320b20
RW
1969
1970(define-public python2-sphinx-rtd-theme
1971 (package-with-python2 python-sphinx-rtd-theme))
1972
240ca4aa
RW
1973(define-public python-scikit-learn
1974 (package
1975 (name "python-scikit-learn")
1976 (version "0.15.2")
1977 (source
1978 (origin
1979 (method url-fetch)
1980 (uri (string-append
1981 "https://github.com/scikit-learn/scikit-learn/archive/"
1982 version ".tar.gz"))
1983 (sha256
1984 (base32
1985 "1rb93h2q15f219sz60sczjb65rg70xjmnp0q4pkkaairx5s05q55"))))
1986 (build-system python-build-system)
1987 (arguments
1988 `(#:phases
1989 (alist-cons-before
1990 'build 'set-environment-variables
1991 (lambda* (#:key inputs #:allow-other-keys)
1992 (let* ((atlas-threaded
1993 (string-append (assoc-ref inputs "atlas")
1994 "/lib/libtatlas.so"))
1995 ;; On single core CPUs only the serial library is created.
1996 (atlas-lib
1997 (if (file-exists? atlas-threaded)
1998 atlas-threaded
1999 (string-append (assoc-ref inputs "atlas")
2000 "/lib/libsatlas.so"))))
2001 (setenv "ATLAS" atlas-lib)))
2002 (alist-cons-before
2003 'check 'set-HOME
2004 ;; some tests require access to "$HOME"
2005 (lambda _ (setenv "HOME" "/tmp"))
2006 ;; Tests can only be run after the library has been installed and not
2007 ;; within the source directory.
2008 (alist-cons-after
2009 'install 'check
2010 (lambda _
2011 (with-directory-excursion "/tmp"
2012 ;; With Python 3 one test of 3334 fails
2013 ;; (sklearn.tests.test_common.test_transformers); see
2014 ;; https://github.com/scikit-learn/scikit-learn/issues/3693
2015 (system* "nosetests" "-v" "sklearn")))
2016 (alist-delete 'check %standard-phases))))))
2017 (inputs
2018 `(("atlas" ,atlas)
2019 ("python-nose" ,python-nose)))
2020 (propagated-inputs
2021 `(("python-numpy" ,python-numpy)
2022 ("python-scipy" ,python-scipy)))
2023 (home-page "http://scikit-learn.org/")
2024 (synopsis "Machine Learning in Python")
2025 (description
2026 "Scikit-learn provides simple and efficient tools for data
2027mining and data analysis.")
2028 (license bsd-3)))
2029
2030(define-public python2-scikit-learn
2031 (let ((scikit (package-with-python2 python-scikit-learn)))
2032 (package (inherit scikit)
2033 (propagated-inputs
2034 `(("python2-numpy" ,python2-numpy)
2035 ("python2-scipy" ,python2-scipy)
2036 ,@(alist-delete
2037 "python-numpy"
2038 (alist-delete
2039 "python-scipy" (package-propagated-inputs scikit))))))))
2040
6888830b
FB
2041(define-public python-cython
2042 (package
2043 (name "python-cython")
2044 (version "0.21.1")
2045 (source
2046 (origin
2047 (method url-fetch)
2048 (uri (string-append "http://cython.org/release/Cython-"
2049 version ".tar.gz"))
2050 (sha256
2051 (base32
2052 "0ddz2l2dvcy5hdkxx4xlfiwpccvwia7ixgcy4h0pdv46a4i4vxj3"))))
2053 (build-system python-build-system)
2054 ;; we need the full python package and not just the python-wrapper
2055 ;; because we need libpython3.3m.so
2056 (inputs
2057 `(("python" ,python)))
2058 (arguments
2059 `(#:phases
2060 (alist-cons-before
2061 'check 'set-HOME
2062 ;; some tests require access to "$HOME/.cython"
2063 (lambda* _ (setenv "HOME" "/tmp"))
2064 (alist-replace
2065 'check
2066 (lambda _ (zero? (system* "python" "runtests.py" "-vv")))
2067 %standard-phases))))
2068 (home-page "http://cython.org/")
2069 (synopsis "C extensions for Python")
2070 (description "Cython is an optimising static compiler for both the Python
2071programming language and the extended Cython programming language. It makes
2072writing C extensions for Python as easy as Python itself.")
2073 (license asl2.0)))
2074
2075(define-public python2-cython
2076 (package (inherit (package-with-python2 python-cython))
2077 (name "python2-cython")
2078 (inputs
2079 `(("python-2" ,python-2))))) ; this is not automatically changed
0da98533
FB
2080
2081;; This version of numpy is missing the documentation and is only used to
2082;; build matplotlib which is required to build numpy's documentation.
2083(define python-numpy-bootstrap
2084 (package
2085 (name "python-numpy-bootstrap")
2086 (version "1.9.1")
2087 (source
2088 (origin
2089 (method url-fetch)
2090 (uri (string-append "mirror://sourceforge/numpy"
2091 "/numpy-" version ".tar.gz"))
2092 (sha256
2093 (base32
2094 "070ybfvpgfmiz2hs94x445hvkh9dh52nyi0m8jp5kdihgvhbnx80"))))
2095 (build-system python-build-system)
2096 (inputs
2097 `(("python-nose" ,python-nose)
2098 ("atlas" ,atlas)))
2099 (native-inputs
2100 `(("gfortran" ,gfortran-4.8)))
2101 (arguments
2102 `(#:phases
2103 (alist-cons-before
2104 'build 'set-environment-variables
2105 (lambda* (#:key inputs #:allow-other-keys)
2106 (let* ((atlas-threaded
89b5c60e 2107 (string-append (assoc-ref inputs "atlas")
0da98533
FB
2108 "/lib/libtatlas.so"))
2109 ;; On single core CPUs only the serial library is created.
2110 (atlas-lib
2111 (if (file-exists? atlas-threaded)
2112 atlas-threaded
89b5c60e 2113 (string-append (assoc-ref inputs "atlas")
0da98533
FB
2114 "/lib/libsatlas.so"))))
2115 (setenv "ATLAS" atlas-lib)))
6a843168
FB
2116 ;; Tests can only be run after the library has been installed and not
2117 ;; within the source directory.
2118 (alist-cons-after
2119 'install 'check
89b5c60e 2120 (lambda _
6a843168 2121 (with-directory-excursion "/tmp"
89b5c60e 2122 (zero? (system* "python" "-c"
6a843168 2123 "import numpy; numpy.test(verbose=2)"))))
89b5c60e
AE
2124 (alist-delete
2125 'check
6a843168 2126 %standard-phases)))))
0da98533
FB
2127 (home-page "http://www.numpy.org/")
2128 (synopsis "Fundamental package for scientific computing with Python")
2129 (description "NumPy is the fundamental package for scientific computing
2130with Python. It contains among other things: a powerful N-dimensional array
2131object, sophisticated (broadcasting) functions, tools for integrating C/C++
2132and Fortran code, useful linear algebra, Fourier transform, and random number
2133capabilities.")
2134 (license bsd-3)))
2135
2136(define python2-numpy-bootstrap
2137 (package-with-python2 python-numpy-bootstrap))
15bfe6d6 2138
2ee8869a
FB
2139(define-public python-numpy
2140 (package (inherit python-numpy-bootstrap)
2141 (name "python-numpy")
2142 (outputs '("out" "doc"))
89b5c60e 2143 (inputs
2ee8869a
FB
2144 `(("which" ,which)
2145 ("python-setuptools" ,python-setuptools)
2146 ("python-matplotlib" ,python-matplotlib)
2147 ("python-sphinx" ,python-sphinx)
2148 ("python-pyparsing" ,python-pyparsing)
2149 ("python-numpydoc" ,python-numpydoc)
2150 ,@(package-inputs python-numpy-bootstrap)))
2151 (native-inputs
2152 `(("pkg-config" ,pkg-config)
2153 ("texlive" ,texlive)
2154 ("texinfo" ,texinfo)
2155 ("perl" ,perl)
2156 ,@(package-native-inputs python-numpy-bootstrap)))
2157 (arguments
89b5c60e 2158 `(,@(substitute-keyword-arguments
2ee8869a
FB
2159 (package-arguments python-numpy-bootstrap)
2160 ((#:phases phases)
2161 `(alist-cons-after
2162 'install 'install-doc
2163 (lambda* (#:key outputs #:allow-other-keys)
2164 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
89b5c60e
AE
2165 (doc (string-append
2166 data "/doc/" ,name "-"
2ee8869a
FB
2167 ,(package-version python-numpy-bootstrap)))
2168 (info (string-append data "/info"))
2169 (html (string-append doc "/html"))
2170 (pyver ,(string-append "PYVER=")))
2171 (with-directory-excursion "doc"
2172 (mkdir-p html)
2173 (system* "make" "html" pyver)
2174 (system* "make" "latex" "PAPER=a4" pyver)
89b5c60e 2175 (system* "make" "-C" "build/latex"
2ee8869a
FB
2176 "all-pdf" "PAPER=a4" pyver)
2177 ;; FIXME: Generation of the info file fails.
2178 ;; (system* "make" "info" pyver)
2179 ;; (mkdir-p info)
2180 ;; (copy-file "build/texinfo/numpy.info"
2181 ;; (string-append info "/numpy.info"))
2182 (for-each (lambda (file)
2183 (copy-file (string-append "build/latex" file)
2184 (string-append doc file)))
2185 '("/numpy-ref.pdf" "/numpy-user.pdf"))
2186 (with-directory-excursion "build/html"
2187 (for-each (lambda (file)
2188 (let* ((dir (dirname file))
2189 (tgt-dir (string-append html "/" dir)))
2190 (unless (equal? "." dir)
2191 (mkdir-p tgt-dir))
2192 (copy-file file (string-append html "/" file))))
2193 (find-files "." ".*"))))))
2194 ,phases)))))))
2195
764c077b
LC
2196(define-public python2-numpy
2197 (let ((numpy (package-with-python2 python-numpy)))
2198 (package (inherit numpy)
88c26834
AE
2199 ;; Make sure we use exactly PYTHON2-MATPLOTLIB, which is customized for
2200 ;; Python 2.
2201 (inputs `(("python2-matplotlib" ,python2-matplotlib)
2202 ,@(alist-delete "python-matplotlib"
2203 (package-inputs numpy)))))))
2ee8869a 2204
15bfe6d6
FB
2205(define-public python-pyparsing
2206 (package
2207 (name "python-pyparsing")
e0669289 2208 (version "2.0.3")
15bfe6d6
FB
2209 (source
2210 (origin
2211 (method url-fetch)
2212 (uri (string-append "mirror://sourceforge/pyparsing"
2213 "/pyparsing-" version ".tar.gz"))
2214 (sha256
2215 (base32
e0669289 2216 "0kw4py7gn45j93q8r7bzajfrjdc3xlsn2yzln41lf9zmrghjkrq6"))))
15bfe6d6
FB
2217 (build-system python-build-system)
2218 (outputs '("out" "doc"))
2219 (arguments
2220 `(#:tests? #f ; no test target
2221 #:modules ((guix build python-build-system)
2222 (guix build utils))
2223 #:phases
2224 (alist-cons-after
2225 'install 'install-doc
2226 (lambda* (#:key outputs #:allow-other-keys)
89b5c60e 2227 (let* ((doc (string-append (assoc-ref outputs "doc")
15bfe6d6
FB
2228 "/share/doc/" ,name "-" ,version))
2229 (html-doc (string-append doc "/html"))
2230 (examples (string-append doc "/examples")))
2231 (mkdir-p html-doc)
2232 (mkdir-p examples)
89b5c60e 2233 (for-each
15bfe6d6 2234 (lambda (dir tgt)
89b5c60e 2235 (map (lambda (file)
15bfe6d6
FB
2236 (copy-file file (string-append tgt "/" (basename file))))
2237 (find-files dir ".*")))
2238 (list "docs" "htmldoc" "examples")
2239 (list doc html-doc examples))))
2240 %standard-phases)))
2241 (home-page "http://pyparsing.wikispaces.com")
2242 (synopsis "Python parsing class library")
2243 (description
2244 "The pyparsing module is an alternative approach to creating and
2245executing simple grammars, vs. the traditional lex/yacc approach, or the use
2246of regular expressions. The pyparsing module provides a library of classes
2247that client code uses to construct the grammar directly in Python code.")
bd3fa666 2248 (license license:expat)))
15bfe6d6
FB
2249
2250(define-public python2-pyparsing
2251 (package-with-python2 python-pyparsing))
2252
ec00de35
FB
2253(define-public python-numpydoc
2254 (package
2255 (name "python-numpydoc")
2256 (version "0.5")
2257 (source
2258 (origin
2259 (method url-fetch)
89b5c60e 2260 (uri (string-append
ec00de35
FB
2261 "https://pypi.python.org/packages/source/n/numpydoc/numpydoc-"
2262 version ".tar.gz"))
2263 (sha256
2264 (base32
5e4d8f67
AE
2265 "0d4dnifaxkll50jx6czj05y8cb4ny60njd2wz299sj2jxfy51w4k"))
2266 (modules '((guix build utils)))
2267 (snippet
2268 '(begin
2269 ;; Drop a test requiring matplotlib, which we cannot add as an
2270 ;; input since it would create a circular dependency: Extend the
2271 ;; test for Python 3, where it is already dropped, to Python 2.
2272 (substitute* "numpydoc/tests/test_plot_directive.py"
2273 (("3") "2"))))))
ec00de35
FB
2274 (build-system python-build-system)
2275 (inputs
2276 `(("python-setuptools" ,python-setuptools)
2277 ("python-docutils" ,python-docutils)
2278 ("python-sphinx" ,python-sphinx)
2279 ("python-nose" ,python-nose)))
2280 (home-page "https://pypi.python.org/pypi/numpydoc")
2281 (synopsis
2282 "Numpy's Sphinx extensions")
2283 (description
2284 "Sphinx extension to support docstrings in Numpy format.")
2285 (license bsd-2)))
2286
2287(define-public python2-numpydoc
5e4d8f67 2288 (package-with-python2 python-numpydoc))
1c65314c
FB
2289
2290(define-public python-matplotlib
2291 (package
2292 (name "python-matplotlib")
2293 (version "1.4.2")
2294 (source
2295 (origin
2296 (method url-fetch)
2297 (uri (string-append "mirror://sourceforge/matplotlib"
2298 "/matplotlib-" version ".tar.gz"))
2299 (sha256
2300 (base32
2301 "0m6v9nwdldlwk22gcd339zg6mny5m301fxgks7z8sb8m9wawg8qp"))))
2302 (build-system python-build-system)
2303 (outputs '("out" "doc"))
25f9a068
FB
2304 (propagated-inputs ; the following packages are all needed at run time
2305 `(("python-pyparsing" ,python-pyparsing)
2306 ("python-pygobject" ,python-pygobject)
2307 ("gobject-introspection" ,gobject-introspection)
2308 ;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
2309 ;; from 'gtk+') provides the required 'typelib' files used by
2310 ;; 'gobject-introspection'. The location of these files is set with the
2311 ;; help of the environment variable GI_TYPELIB_PATH. At build time this
2312 ;; is done automatically by a 'native-search-path' procedure. However,
2313 ;; at run-time the user must set this variable as follows:
2314 ;;
2315 ;; export GI_TYPELIB_PATH=~/.guix-profile/lib/girepository-1.0
25f9a068
FB
2316 ("gtk+" ,gtk+)
2317 ;; From version 1.4.0 'matplotlib' makes use of 'cairocffi' instead of
2318 ;; 'pycairo'. However, 'pygobject' makes use of a 'pycairo' 'context'
2319 ;; object. For this reason we need to import both libraries.
2320 ;; https://pythonhosted.org/cairocffi/cffi_api.html#converting-pycairo
2321 ("python-pycairo" ,python-pycairo)
2322 ("python-cairocffi" ,python-cairocffi)))
1c65314c
FB
2323 (inputs
2324 `(("python-setuptools" ,python-setuptools)
2325 ("python-dateutil" ,python-dateutil-2)
1c65314c
FB
2326 ("python-six" ,python-six)
2327 ("python-pytz" ,python-pytz)
2328 ("python-numpy" ,python-numpy-bootstrap)
2329 ("python-sphinx" ,python-sphinx)
2330 ("python-numpydoc" ,python-numpydoc)
2331 ("python-nose" ,python-nose)
2332 ("python-mock" ,python-mock)
2333 ("libpng" ,libpng)
2334 ("imagemagick" ,imagemagick)
2335 ("freetype" ,freetype)
25f9a068
FB
2336 ("cairo" ,cairo)
2337 ("glib" ,glib)
4e7a137a 2338 ("python-pillow" ,python-pillow)
1c65314c 2339 ;; FIXME: Add backends when available.
1c65314c
FB
2340 ;("python-wxpython" ,python-wxpython)
2341 ;("python-pyqt" ,python-pyqt)
2342 ))
2343 (native-inputs
2344 `(("pkg-config" ,pkg-config)
2345 ("texlive" ,texlive)
2346 ("texinfo" ,texinfo)))
2347 (arguments
2348 `(#:phases
25f9a068
FB
2349 (alist-cons-before
2350 'build 'configure-environment
2351 (lambda* (#:key outputs inputs #:allow-other-keys)
2352 (let ((cairo (assoc-ref inputs "cairo"))
2353 (gtk+ (assoc-ref inputs "gtk+")))
2354 ;; Setting these directories in the 'basedirlist' of 'setup.cfg'
2355 ;; has not effect.
25f9a068
FB
2356 (setenv "LD_LIBRARY_PATH"
2357 (string-append cairo "/lib:" gtk+ "/lib"))
2358 (setenv "HOME" (getcwd))
2359 (call-with-output-file "setup.cfg"
2360 (lambda (port)
2361 (format port "[rc_options]~%
2362backend = GTK3Agg~%")))))
2363 (alist-cons-after
2364 'install 'install-doc
2365 (lambda* (#:key outputs #:allow-other-keys)
2366 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2367 (doc (string-append data "/doc/" ,name "-" ,version))
2368 (info (string-append data "/info"))
2369 (html (string-append doc "/html")))
2370 (with-directory-excursion "doc"
25f9a068
FB
2371 ;; Produce pdf in 'A4' format.
2372 (substitute* (find-files "." "conf\\.py")
2373 (("latex_paper_size = 'letter'")
2374 "latex_paper_size = 'a4'"))
2375 (mkdir-p html)
2376 (mkdir-p info)
2377 ;; The doc recommends to run the 'html' target twice.
2378 (system* "python" "make.py" "html")
2379 (system* "python" "make.py" "html")
2380 (system* "python" "make.py" "latex")
2381 (system* "python" "make.py" "texinfo")
2382 (copy-file "build/texinfo/matplotlib.info"
2383 (string-append info "/matplotlib.info"))
2384 (copy-file "build/latex/Matplotlib.pdf"
2385 (string-append doc "/Matplotlib.pdf"))
2386 (copy-recursively "build/html" html))))
2387 %standard-phases))))
1c65314c
FB
2388 (home-page "http://matplotlib.org")
2389 (synopsis "2D plotting library for Python")
2390 (description
2391 "Matplotlib is a Python 2D plotting library which produces publication
2392quality figures in a variety of hardcopy formats and interactive environments
2393across platforms. Matplotlib can be used in Python scripts, the python and
2394ipython shell, web application servers, and six graphical user interface
2395toolkits.")
2396 (license psfl)))
2397
764c077b
LC
2398(define-public python2-matplotlib
2399 (let ((matplotlib (package-with-python2 python-matplotlib)))
2400 (package (inherit matplotlib)
88c26834
AE
2401 ;; Make sure to use special packages for Python 2 instead
2402 ;; of those automatically rewritten by package-with-python2.
89b5c60e 2403 (propagated-inputs
7ca0dbc3 2404 `(("python2-pycairo" ,python2-pycairo)
764c077b
LC
2405 ("python2-pygobject-2" ,python2-pygobject-2)
2406 ,@(alist-delete "python-pycairo"
2407 (alist-delete "python-pygobject"
89b5c60e 2408 (package-propagated-inputs
88c26834 2409 matplotlib))))))))
94914805 2410
bb986599
FB
2411(define-public python-scipy
2412 (package
2413 (name "python-scipy")
da6ce3f1 2414 (version "0.15.0")
bb986599
FB
2415 (source
2416 (origin
2417 (method url-fetch)
2418 (uri (string-append "mirror://sourceforge/scipy"
da6ce3f1 2419 "/scipy-" version ".tar.xz"))
bb986599
FB
2420 (sha256
2421 (base32
da6ce3f1 2422 "0fsqi05s035d7p6s8h3h2pvk1axias16chy17rw9l1bxvrfhmncf"))))
bb986599
FB
2423 (build-system python-build-system)
2424 (inputs
2425 `(("python-numpy" ,python-numpy)
2426 ("python-matplotlib" ,python-matplotlib)
2427 ("python-pyparsing" ,python-pyparsing)
2428 ("python-nose" ,python-nose)
2429 ("python-sphinx" ,python-sphinx)
2430 ("atlas" ,atlas)))
2431 (native-inputs
2432 `(("gfortran" ,gfortran-4.8)
2433 ("texlive" ,texlive)
2434 ("perl" ,perl)))
2435 (outputs '("out" "doc"))
2436 (arguments
2437 `(#:phases
2438 (alist-cons-before
2439 'build 'set-environment-variables
2440 (lambda* (#:key inputs #:allow-other-keys)
2441 (let* ((atlas-threaded
89b5c60e 2442 (string-append (assoc-ref inputs "atlas")
bb986599
FB
2443 "/lib/libtatlas.so"))
2444 ;; On single core CPUs only the serial library is created.
2445 (atlas-lib
2446 (if (file-exists? atlas-threaded)
2447 atlas-threaded
89b5c60e 2448 (string-append (assoc-ref inputs "atlas")
bb986599
FB
2449 "/lib/libsatlas.so"))))
2450 (setenv "ATLAS" atlas-lib)))
2451 (alist-cons-after
2452 'install 'install-doc
2453 (lambda* (#:key outputs #:allow-other-keys)
2454 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2455 (doc (string-append data "/doc/" ,name "-" ,version))
2456 (html (string-append doc "/html"))
2457 (pyver ,(string-append "PYVER=")))
2458 (with-directory-excursion "doc"
bb986599
FB
2459 ;; Fix generation of images for mathematical expressions.
2460 (substitute* (find-files "source" "conf\\.py")
2461 (("pngmath_use_preview = True")
2462 "pngmath_use_preview = False"))
2463 (mkdir-p html)
2464 (system* "make" "html" pyver)
2465 (system* "make" "latex" "PAPER=a4" pyver)
2466 (system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" pyver)
2467 (copy-file "build/latex/scipy-ref.pdf"
2468 (string-append doc "/scipy-ref.pdf"))
2469 (with-directory-excursion "build/html"
2470 (for-each (lambda (file)
2471 (let* ((dir (dirname file))
2472 (tgt-dir (string-append html "/" dir)))
2473 (unless (equal? "." dir)
2474 (mkdir-p tgt-dir))
2475 (copy-file file (string-append html "/" file))))
2476 (find-files "." ".*"))))))
2477 ;; Tests can only be run after the library has been installed and not
2478 ;; within the source directory.
2479 (alist-cons-after
2480 'install 'check
89b5c60e 2481 (lambda _
bb986599
FB
2482 (with-directory-excursion "/tmp"
2483 (zero? (system* "python" "-c" "import scipy; scipy.test()"))))
89b5c60e
AE
2484 (alist-delete
2485 'check
bb986599
FB
2486 %standard-phases))))))
2487 (home-page "http://www.scipy.org/")
2488 (synopsis "The Scipy library provides efficient numerical routines")
2489 (description "The SciPy library is one of the core packages that make up
2490the SciPy stack. It provides many user-friendly and efficient numerical
2491routines such as routines for numerical integration and optimization.")
2492 (license bsd-3)))
2493
764c077b
LC
2494(define-public python2-scipy
2495 (let ((scipy (package-with-python2 python-scipy)))
2496 (package (inherit scipy)
2497 ;; Use packages customized for python-2.
2498 (inputs `(("python2-matplotlib" ,python2-matplotlib)
2499 ("python2-numpy" ,python2-numpy)
89b5c60e
AE
2500 ,@(alist-delete "python-matplotlib"
2501 (alist-delete "python-numpy"
764c077b 2502 (package-inputs scipy))))))))
bb986599 2503
94914805
EB
2504(define-public python-sqlalchemy
2505 (package
2506 (name "python-sqlalchemy")
2507 (version "0.9.7")
2508 (source
2509 (origin
2510 (method url-fetch)
2511 (uri (string-append "https://pypi.python.org/packages/source/S/"
2512 "SQLAlchemy/SQLAlchemy-" version ".tar.gz"))
2513 (sha256
2514 (base32
2515 "059ayifj5l08v6vv56anhyibyllscn10dlzr2fcw68gz1hfjdzsz"))))
2516 (build-system python-build-system)
2517 (native-inputs
2518 `(("python-cython" ,python-cython) ;for c extensions
2519 ("python-pytest" ,python-pytest)
2520 ("python-mock" ,python-mock))) ;for tests
2521 (arguments
2522 `(#:phases (alist-replace
2523 'check
2524 (lambda _ (zero? (system* "py.test")))
2525 %standard-phases)))
2526 (home-page "http://www.sqlalchemy.org")
2527 (synopsis "Database abstraction library")
2528 (description
2529 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2530gives application developers the full power and flexibility of SQL. It
2531provides a full suite of well known enterprise-level persistence patterns,
2532designed for efficient and high-performing database access, adapted into a
2533simple and Pythonic domain language.")
2534 (license x11)))
2535
2536(define-public python2-sqlalchemy
2537 (package-with-python2 python-sqlalchemy))
c937562e 2538
1671c07c
EB
2539(define-public python-distutils-extra
2540 (package
2541 (name "python-distutils-extra")
2542 (version "2.38")
2543 (source
2544 (origin
2545 (method url-fetch)
2546 (uri (string-append "https://launchpad.net/python-distutils-extra/trunk/"
2547 version "/+download/python-distutils-extra-"
2548 version ".tar.gz"))
2549 (sha256
2550 (base32
2551 "0lx15kcbby9zisx33p2h5hgakgwh2bvh0ibag8z0px4j6ifhs41x"))))
2552 (build-system python-build-system)
2553 (native-inputs
2554 `(("python-setuptools" ,python-setuptools)))
2555 (home-page "https://launchpad.net/python-distutils-extra/")
2556 (synopsis "Enhancements to Python's distutils")
2557 (description
2558 "The python-distutils-extra module enables you to easily integrate
2559gettext support, themed icons, and scrollkeeper-based documentation into
2560Python's distutils.")
2561 (license gpl2)))
2562
2563(define-public python2-distutils-extra
2564 (package-with-python2 python-distutils-extra))
ea5456c8
EB
2565
2566(define-public python2-elib.intl
2567 (package
2568 (name "python2-elib.intl")
2569 (version "0.0.3")
2570 (source
2571 (origin
2572 ;; This project doesn't tag releases or publish tarballs, so we take
2573 ;; source from a (semi-arbitrary, i.e. latest as of now) git commit.
2574 (method git-fetch)
2575 (uri (git-reference
2576 (url "https://github.com/dieterv/elib.intl.git")
2577 (commit "d09997cfef")))
2578 (sha256
2579 (base32
2580 "0y7vzff9xgbnaay7m0va1arl6g68ncwrvbgwl7jqlclsahzzb09d"))))
2581 (build-system python-build-system)
2582 (native-inputs
2583 `(("python2-setuptools" ,python2-setuptools)))
2584 (arguments
2585 ;; incompatible with Python 3 (exception syntax)
2586 `(#:python ,python-2
2587 #:tests? #f
2588 ;; With standard flags, the install phase attempts to create a zip'd
2589 ;; egg file, and fails with an error: 'ZIP does not support timestamps
2590 ;; before 1980'
2591 #:configure-flags '("--single-version-externally-managed"
2592 "--record=elib.txt")))
2593 (home-page "https://github.com/dieterv/elib.intl")
2594 (synopsis "Enhanced internationalization for Python")
2595 (description
2596 "The elib.intl module provides enhanced internationalization (I18N)
2597services for your Python modules and applications.")
2598 (license lgpl3+)))
2599
c937562e
EB
2600(define-public python-pillow
2601 (package
2602 (name "python-pillow")
2603 (version "2.6.1")
2604 (source
2605 (origin
2606 (method url-fetch)
2607 (uri (string-append "https://pypi.python.org/packages/source/P/"
2608 "Pillow/Pillow-" version ".tar.gz"))
2609 (sha256
2610 (base32
2611 "0iw36c73wkhz88wa78v6l43llsb080ihw8yq7adhfqxdib7l4hzr"))))
2612 (build-system python-build-system)
2613 (native-inputs
2614 `(("python-setuptools" ,python-setuptools)
2615 ("python-nose" ,python-nose)))
2616 (inputs
2617 `(("lcms" ,lcms)
2618 ("zlib" ,zlib)
2619 ("libjpeg" ,libjpeg)
2620 ("openjpeg" ,openjpeg)
2621 ("libtiff" ,libtiff)))
2622 (propagated-inputs
2623 `(;; Used at runtime for pkg_resources
2624 ("python-setuptools" ,python-setuptools)))
2625 (arguments
2626 `(#:phases (alist-cons-after
2627 'install 'check-installed
2628 (lambda _
2629 (begin
2630 (setenv "HOME" (getcwd))
2631 (and (zero? (system* "python" "selftest.py" "--installed"))
2632 (zero? (system* "python" "test-installed.py")))))
2633 (alist-delete 'check %standard-phases))))
2634 (home-page "https://pypi.python.org/pypi/Pillow")
2635 (synopsis "Fork of the Python Imaging Library")
2636 (description
2637 "The Python Imaging Library adds image processing capabilities to your
2638Python interpreter. This library provides extensive file format support, an
2639efficient internal representation, and fairly powerful image processing
2640capabilities. The core image library is designed for fast access to data
2641stored in a few basic pixel formats. It should provide a solid foundation for
2642a general image processing tool.")
2643 (license (x11-style
2644 "http://www.pythonware.com/products/pil/license.htm"
2645 "The PIL Software License"))))
2646
2647(define-public python2-pillow
2648 (package-with-python2 python-pillow))
bb986599 2649
a415f036
FB
2650(define-public python-pycparser
2651 (package
2652 (name "python-pycparser")
2653 (version "2.10")
2654 (source
2655 (origin
2656 (method url-fetch)
2657 (uri (string-append "https://pypi.python.org/packages/source/p/"
2658 "pycparser/pycparser-" version ".tar.gz"))
2659 (sha256
2660 (base32
2661 "0v5qfq03yvd1pi0dwlgfai0p3dh9bq94pydn19c4pdn0c6v9hzcm"))))
2662 (outputs '("out" "doc"))
2663 (build-system python-build-system)
2664 (native-inputs
2665 `(("pkg-config" ,pkg-config)
2666 ("python-setuptools" ,python-setuptools)))
2667 (arguments
89b5c60e 2668 `(#:phases
a415f036
FB
2669 (alist-replace
2670 'check
2671 (lambda _
2672 (with-directory-excursion "tests"
2673 (zero? (system* "python" "all_tests.py"))))
2674 (alist-cons-after
2675 'install 'install-doc
2676 (lambda* (#:key outputs #:allow-other-keys)
2677 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2678 (doc (string-append data "/doc/" ,name "-" ,version))
2679 (examples (string-append doc "/examples")))
2680 (mkdir-p examples)
2681 (for-each (lambda (file)
2682 (copy-file (string-append "." file)
2683 (string-append doc file)))
2684 '("/README.rst" "/CHANGES" "/LICENSE"))
2685 (copy-recursively "examples" examples)))
2686 %standard-phases))))
2687 (home-page "https://github.com/eliben/pycparser")
2688 (synopsis "C parser in Python")
2689 (description
2690 "Pycparser is a complete parser of the C language, written in pure Python
2691using the PLY parsing library. It parses C code into an AST and can serve as
2692a front-end for C compilers or analysis tools.")
2693 (license bsd-3)))
2694
2695(define-public python2-pycparser
2696 (package-with-python2 python-pycparser))
57c3f716
FB
2697
2698(define-public python-cffi
2699 (package
2700 (name "python-cffi")
2701 (version "0.8.6")
2702 (source
2703 (origin
2704 (method url-fetch)
2705 (uri (string-append "https://pypi.python.org/packages/source/c/"
2706 "cffi/cffi-" version ".tar.gz"))
89b5c60e 2707 (sha256
57c3f716
FB
2708 (base32 "0406j3sgndmx88idv5zxkkrwfqxmjl18pj8gf47nsg4ymzixjci5"))))
2709 (build-system python-build-system)
2710 (outputs '("out" "doc"))
2711 (inputs
2712 `(("libffi" ,libffi)))
2713 (propagated-inputs ; required at run-time
2714 `(("python-pycparser" ,python-pycparser)))
2715 (native-inputs
2716 `(("pkg-config" ,pkg-config)
2717 ("python-sphinx" ,python-sphinx)
2718 ("python-setuptools" ,python-setuptools)))
2719 (arguments
2720 `(#:tests? #f ; FIXME: requires pytest
89b5c60e 2721 #:phases
57c3f716
FB
2722 (alist-cons-after
2723 'install 'install-doc
2724 (lambda* (#:key outputs #:allow-other-keys)
2725 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2726 (doc (string-append data "/doc/" ,name "-" ,version))
2727 (html (string-append doc "/html")))
2728 (with-directory-excursion "doc"
2729 (system* "make" "html")
2730 (mkdir-p html)
2731 (copy-recursively "build/html" html))
2732 (copy-file "LICENSE" (string-append doc "/LICENSE"))))
2733 %standard-phases)))
2734 (home-page "http://cffi.readthedocs.org")
2735 (synopsis "Foreign function interface for Python")
2736 (description
2737 "Foreign Function Interface for Python calling C code.")
bd3fa666 2738 (license license:expat)))
57c3f716
FB
2739
2740(define-public python2-cffi
2741 (package-with-python2 python-cffi))
6fa14469
FB
2742
2743(define-public python-xcffib
2744 (package
2745 (name "python-xcffib")
2746 (version "0.1.9")
2747 (source
2748 (origin
2749 (method url-fetch)
2750 (uri (string-append "https://pypi.python.org/packages/source/x/"
2751 "xcffib/xcffib-" version ".tar.gz"))
2752 (sha256
2753 (base32
2754 "0655hzxv57h1a9ja9kwp0ichbkhf3djw32k33d66xp0q37dq2y81"))))
2755 (build-system python-build-system)
2756 (inputs
2757 `(("libxcb" ,libxcb)
2758 ("python-six" ,python-six)))
2759 (native-inputs
2760 `(("python-setuptools" ,python-setuptools)))
2761 (propagated-inputs
2762 `(("python-cffi" ,python-cffi))) ; used at run time
2763 (arguments
89b5c60e 2764 `(#:phases
6fa14469
FB
2765 (alist-cons-after
2766 'install 'install-doc
2767 (lambda* (#:key outputs #:allow-other-keys)
2768 (let ((doc (string-append (assoc-ref outputs "out") "/share"
2769 "/doc/" ,name "-" ,version)))
2770 (mkdir-p doc)
2771 (copy-file "README.md"
2772 (string-append doc "/README.md"))))
2773 %standard-phases)))
2774 (home-page "https://github.com/tych0/xcffib")
2775 (synopsis "XCB Python bindings")
2776 (description
2777 "Xcffib is a replacement for xpyb, an XCB Python bindings. It adds
2778support for Python 3 and PyPy. It is based on cffi.")
bd3fa666 2779 (license license:expat)))
6fa14469
FB
2780
2781(define-public python2-xcffib
2782 (package-with-python2 python-xcffib))
2783
9e099723
FB
2784(define-public python-cairocffi
2785 (package
2786 (name "python-cairocffi")
2787 (version "0.6")
2788 (source
2789 (origin
2790 (method url-fetch)
2791 ;; The archive on pypi is missing the 'utils' directory!
2792 (uri (string-append "https://github.com/SimonSapin/cairocffi/archive/v"
2793 version ".tar.gz"))
f586c877 2794 (file-name (string-append name "-" version ".tar.gz"))
9e099723
FB
2795 (sha256
2796 (base32
2797 "03w5p62sp3nqiccx864sbq0jvh7946277jqx3rcc3dch5xwfvv51"))))
2798 (build-system python-build-system)
2799 (outputs '("out" "doc"))
2800 (inputs
2801 `(("gdk-pixbuf" ,gdk-pixbuf)
2802 ("cairo" ,cairo)))
2803 (native-inputs
2804 `(("pkg-config" ,pkg-config)
2805 ("python-sphinx" ,python-sphinx)
2806 ("python-docutils" ,python-docutils)
2807 ("python-setuptools" ,python-setuptools)))
2808 (propagated-inputs
2809 `(("python-xcffib" ,python-xcffib))) ; used at run time
2810 (arguments
89b5c60e 2811 `(#:phases
9e099723
FB
2812 (alist-cons-after
2813 'install 'install-doc
2814 (lambda* (#:key inputs outputs #:allow-other-keys)
2815 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2816 (doc (string-append data "/doc/" ,name "-" ,version))
2817 (html (string-append doc "/html")))
89b5c60e 2818 (setenv "LD_LIBRARY_PATH"
9e099723
FB
2819 (string-append (assoc-ref inputs "cairo") "/lib" ":"
2820 (assoc-ref inputs "gdk-pixbuf") "/lib"))
2821 (setenv "LANG" "en_US.UTF-8")
2822 (mkdir-p html)
2823 (for-each (lambda (file)
2824 (copy-file (string-append "." file)
2825 (string-append doc file)))
2826 '("/README.rst" "/CHANGES" "/LICENSE"))
2827 (system* "python" "setup.py" "build_sphinx")
2828 (copy-recursively "docs/_build/html" html)))
2829 %standard-phases)))
2830 (home-page "https://github.com/SimonSapin/cairocffi")
2831 (synopsis "Python bindings and object-oriented API for Cairo")
2832 (description
2833 "Cairocffi is a CFFI-based drop-in replacement for Pycairo, a set of
2834Python bindings and object-oriented API for cairo. Cairo is a 2D vector
2835graphics library with support for multiple backends including image buffers,
2836PNG, PostScript, PDF, and SVG file output.")
2837 (license bsd-3)))
2838
2839(define-public python2-cairocffi
2840 (package-with-python2 python-cairocffi))
2841
3cff95cb
RW
2842(define-public python-decorator
2843 (package
2844 (name "python-decorator")
2845 (version "3.4.2")
2846 (source
2847 (origin
2848 (method url-fetch)
2849 (uri (string-append
2850 "https://pypi.python.org/packages/source/d/decorator/decorator-"
2851 version ".tar.gz"))
2852 (sha256
2853 (base32 "0i2bnlkh0p9gs76hb28mafandcrig2fmv56w9ai6mshxwqn0083k"))))
2854 (build-system python-build-system)
2855 (arguments '(#:tests? #f)) ; no test target
2856 (native-inputs
2857 `(("python-setuptools" ,python-setuptools)))
2858 (home-page "http://pypi.python.org/pypi/decorator/")
2859 (synopsis "Python module to simplify usage of decorators")
2860 (description
2861 "The aim of the decorator module is to simplify the usage of decorators
2862for the average programmer, and to popularize decorators usage giving examples
2863of useful decorators, such as memoize, tracing, redirecting_stdout, locked,
2864etc. The core of this module is a decorator factory.")
2865 (license license:expat)))
2866
2867(define-public python2-decorator
2868 (package-with-python2 python-decorator))
2869
2c0499ad
RW
2870(define-public python-drmaa
2871 (package
2872 (name "python-drmaa")
2873 (version "0.7.6")
2874 (source
2875 (origin
2876 (method url-fetch)
2877 (uri (string-append
2878 "https://pypi.python.org/packages/source/d/drmaa/drmaa-"
2879 version ".tar.gz"))
2880 (sha256
2881 (base32 "0bzl9f9g34dlhwf09i3fdv7dqqzf2iq0w7d6c2bafx1nlap8qfbh"))))
2882 (build-system python-build-system)
2883 ;; The test suite requires libdrmaa which is provided by the cluster
2884 ;; environment. At runtime the environment variable DRMAA_LIBRARY_PATH
2885 ;; should be set to the path of the libdrmaa library.
2886 (arguments '(#:tests? #f))
2887 (native-inputs
2888 `(("python-nose" ,python-nose)
2889 ("python-setuptools" ,python-setuptools)))
2890 (home-page "https://pypi.python.org/pypi/drmaa")
2891 (synopsis "Python bindings for the DRMAA library")
2892 (description
2893 "A Python package for Distributed Resource Management (DRM) job
2894submission and control. This package is an implementation of the DRMAA 1.0
2895Python language binding specification.")
2896 (license bsd-3)))
2897
2898(define-public python2-drmaa
2899 (package-with-python2 python-drmaa))
2900
ae1ab9fe
FB
2901(define-public python-ipython
2902 (package
2903 (name "python-ipython")
2904 (version "2.3.1")
2905 (source
2906 (origin
2907 (method url-fetch)
2908 (uri (string-append "https://pypi.python.org/packages/source/i/"
2909 "ipython/ipython-" version ".tar.gz"))
2910 (sha256
2911 (base32 "1764gi5m3ff481rjk336cw6i2h4zlc0nxam9rc5m8m7yl9m4d61y"))))
2912 (build-system python-build-system)
2913 (outputs '("out" "doc"))
2914 ;; FIXME: add optional dependencies when available: pyzmq, tornado, ...
2915 (inputs
2916 `(("readline" ,readline)
2917 ("python-matplotlib" ,python-matplotlib)
2918 ("python-numpy" ,python-numpy-bootstrap)
2919 ("python-numpydoc" ,python-numpydoc)
2920 ("python-nose" ,python-nose)))
2921 (native-inputs
2922 `(("pkg-config" ,pkg-config)
2923 ("python-sphinx" ,python-sphinx)
2924 ("texlive" ,texlive)
2925 ("texinfo" ,texinfo)
2926 ("python-setuptools" ,python-setuptools)))
2927 (arguments
89b5c60e 2928 `(#:phases
ae1ab9fe
FB
2929 (alist-cons-after
2930 'install 'install-doc
2931 (lambda* (#:key inputs outputs #:allow-other-keys)
2932 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2933 (doc (string-append data "/doc/" ,name "-" ,version))
2934 (html (string-append doc "/html"))
2935 (man1 (string-append data "/man/man1"))
2936 (info (string-append data "/info"))
2937 (examples (string-append doc "/examples")))
2938 (setenv "LANG" "en_US.UTF-8")
2939 (with-directory-excursion "docs"
2940 ;; FIXME: html and pdf fail to build without optional pyzmq
2941 ;(system* "make" "html")
2942 ;(system* "make" "pdf" "PAPER=a4")
2943 (system* "make" "info"))
2944 (copy-recursively "docs/man" man1)
2945 (copy-recursively "examples" examples)
2946 ;; (copy-recursively "docs/build/html" html)
2947 ;; (copy-file "docs/build/latex/ipython.pdf"
2948 ;; (string-append doc "/ipython.pdf"))
2949 (mkdir-p info)
2950 (copy-file "docs/build/texinfo/ipython.info"
2951 (string-append info "/ipython.info"))
2952 (copy-file "COPYING.rst" (string-append doc "/COPYING.rst"))))
2953 ;; Tests can only be run after the library has been installed and not
2954 ;; within the source directory.
2955 (alist-cons-after
2956 'install 'check
2957 (lambda* (#:key outputs #:allow-other-keys)
2958 ;; The test procedure appears to miss the fact that some optional
2959 ;; dependencies are missing.
2960 ;; (with-directory-excursion "/tmp"
2961 ;; (zero? (system* (string-append (assoc-ref outputs "out")
2962 ;; "/bin/iptest"))))
2963 #t)
89b5c60e
AE
2964 (alist-delete
2965 'check
ae1ab9fe
FB
2966 %standard-phases)))))
2967 (home-page "http://ipython.org")
2968 (synopsis "IPython is a tool for interactive computing in Python")
2969 (description
2970 "IPython provides a rich architecture for interactive computing with:
2971Powerful interactive shells, a browser-based notebook, support for interactive
2972data visualization, embeddable interpreters and tools for parallel
2973computing.")
2974 (license bsd-3)))
2975
2976(define-public python2-ipython
2977 (let ((ipython (package-with-python2 python-ipython)))
2978 (package (inherit ipython)
2979 ;; Make sure we use custom python2-NAME packages.
89b5c60e 2980 (inputs
88c26834
AE
2981 `(("python2-matplotlib" ,python2-matplotlib)
2982 ,@(alist-delete "python-matplotlib"
2983 (package-inputs ipython)))))))
03411993
AE
2984
2985(define-public python-isodate
2986 (package
2987 (name "python-isodate")
2988 (version "0.5.1")
2989 (source
2990 (origin
2991 (method url-fetch)
2992 (uri (string-append
2993 "https://pypi.python.org/packages/source/i/isodate/isodate-"
2994 version
2995 ".tar.gz"))
2996 (sha256
2997 (base32
2998 "1yqjn0is0p64cmk9xhq4hc6q06jk86d60kg2jws58d78q0qysami"))))
2999 (build-system python-build-system)
3000 (inputs
3001 `(("python-setuptools" ,python-setuptools)))
3002 (home-page
3003 "http://cheeseshop.python.org/pypi/isodate")
3004 (synopsis
3005 "Python date parser and formatter")
3006 (description
3007 "Python-isodate is a python module for parsing and formatting
3008ISO 8601 dates, time and duration.")
3009 (license bsd-3)))
3010
3011(define-public python2-isodate
3012 (package-with-python2 python-isodate))
673ab897
AE
3013
3014(define-public python-html5lib
3015 (package
3016 (name "python-html5lib")
3017 (version "1.0b3")
3018 (source
3019 (origin
3020 (method url-fetch)
3021 (uri (string-append
3022 "https://pypi.python.org/packages/source/h/html5lib/html5lib-"
3023 version
3024 ".tar.gz"))
3025 (sha256
3026 (base32
3027 "1l5i6xzckzx4hnh9qzv9q3kyhkgjx2hsi2k9srgci3qizjmvp6ln"))))
3028 (build-system python-build-system)
3dd75476
AE
3029 (propagated-inputs
3030 `(("python-six" ,python-six))) ; required to "import html5lib"
673ab897
AE
3031 (inputs
3032 `(("python-setuptools" ,python-setuptools)))
3033 (arguments
3034 `(#:test-target "check"))
3035 (home-page
3036 "https://github.com/html5lib/html5lib-python")
3037 (synopsis
3038 "Python HTML parser based on the WHATWG HTML specifcation")
3039 (description
3040 "Html5lib is an HTML parser based on the WHATWG HTML specifcation
3041and written in Python.")
bd3fa666 3042 (license license:expat)))
673ab897
AE
3043
3044(define-public python2-html5lib
3045 (package-with-python2 python-html5lib))
e99f4211
MW
3046
3047(define-public python-urwid
3048 (package
3049 (name "python-urwid")
3050 (version "1.3.0")
3051 (source
3052 (origin
3053 (method url-fetch)
be1f44bb
MW
3054 (uri (string-append
3055 "https://pypi.python.org/packages/source/u/urwid/urwid-"
3056 version ".tar.gz"))
e99f4211
MW
3057 (sha256
3058 (base32
3059 "18mb0yy94sjc434rd61m2sfnw27sa0nyrszpj5a9r9zh7fnlzw19"))))
3060 (build-system python-build-system)
3061 (native-inputs `(("python-setuptools" ,python-setuptools)))
3062 (home-page "http://urwid.org")
3063 (synopsis "Console user interface library for Python")
3064 (description
3065 "Urwid is a curses-based UI/widget library for Python. It includes many
3066features useful for text console applications.")
3067 (license lgpl2.1+)))
3068
3069(define-public python2-urwid
3070 (package-with-python2 python-urwid))
d95a56c6
PAR
3071
3072(define-public python-dbus
3073 (package
3074 (name "python-dbus")
3075 (version "1.2.0")
3076 (source
3077 (origin
3078 (method url-fetch)
3079 (uri (string-append
3080 "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-"
3081 version ".tar.gz"))
3082 (sha256
3083 (base32 "1py62qir966lvdkngg0v8k1khsqxwk5m4s8nflpk1agk5f5nqb71"))))
3084 (build-system gnu-build-system)
3085 (native-inputs
3086 `(("pkg-config" ,pkg-config)))
3087 (inputs
3088 `(("python" ,python)
3089 ("dbus" ,dbus)
3090 ("dbus-glib" ,dbus-glib)
3091 ("glib" ,glib)))
3092 (synopsis "Python bindings for D-bus")
3093 (description "python-dbus provides bindings for libdbus, the reference
3094implementation of D-Bus.")
3095 (home-page "http://www.freedesktop.org/wiki/Software/DBusBindings/")
bd3fa666 3096 (license license:expat)))
b52af02b
MW
3097
3098(define-public python2-dbus
3099 (package (inherit python-dbus)
3100 (name "python2-dbus")
3101 (inputs `(("python" ,python-2)
3102 ,@(alist-delete "python"
3103 (package-inputs python-dbus)
3104 equal?)))
3105 ;; FIXME: on Python 2, the test_utf8 fails with:
3106 ;; "ValueError: unichr() arg not in range(0x10000) (narrow Python build)"
3107 (arguments `(#:tests? #f))))
a6ac8332
AE
3108
3109(define-public python-apsw
3110 (package
3111 (name "python-apsw")
3112 (version "3.8.7.3-r1")
3113 (source
3114 (origin
3115 (method url-fetch)
3116 (uri (string-append
3117 "https://pypi.python.org/packages/source/a/apsw/apsw-"
3118 version
3119 ".tar.gz"))
3120 (sha256
3121 (base32
3122 "1rgxdypg7hym0qny15rx5khrghx9fkppfgsfa2s8lg917924mv7l"))))
3123 (build-system python-build-system)
3124 (inputs
3125 `(("python-setuptools" ,python-setuptools)
3126 ("sqlite" ,sqlite)))
3127 (arguments
3128 `(#:phases
3129 ;; swap check and install phases
3130 (alist-cons-after
3131 'install 'check
3132 (assoc-ref %standard-phases 'check)
3133 (alist-delete
3134 'check
3135 %standard-phases))))
3136 (home-page "https://github.com/rogerbinns/apsw/")
3137 (synopsis "Another Python SQLite Wrapper")
3138 (description "APSW is a Python wrapper for the SQLite
3139embedded relational database engine. In contrast to other wrappers such as
3140pysqlite it focuses on being a minimal layer over SQLite attempting just to
3141translate the complete SQLite API into Python.")
abde5f37 3142 (license license:zlib)))
a6ac8332
AE
3143
3144(define-public python2-apsw
3145 (package-with-python2 python-apsw))
26b307e2
AE
3146
3147(define-public python-lxml
3148 (package
3149 (name "python-lxml")
3150 (version "3.4.2")
3151 (source
3152 (origin
3153 (method url-fetch)
3154 (uri (string-append
3155 "https://pypi.python.org/packages/source/l/lxml/lxml-"
3156 version
3157 ".tar.gz"))
3158 (sha256
3159 (base32
3160 "0pd23qz8vms1mgm41p96h4vac5y91igs4wr9640gnvxgk019kmf7"))))
3161 (build-system python-build-system)
3162 (inputs
3163 `(("libxml2" ,libxml2)
3164 ("libxslt" ,libxslt)
3165 ("python-setuptools" ,python-setuptools)))
3166 (home-page "http://lxml.de/")
3167 (synopsis
3168 "Python XML processing library")
3169 (description
3170 "The lxml XML toolkit is a Pythonic binding for the C libraries
3171libxml2 and libxslt.")
3172 (license bsd-3))) ; and a few more, see LICENSES.txt
3173
3174(define-public python2-lxml
3175 (package-with-python2 python-lxml))
4ed20663
AE
3176
3177(define-public python-pillow
3178 (package
3179 (name "python-pillow")
3180 (version "2.7.0")
3181 (source
3182 (origin
3183 (method url-fetch)
3184 (uri (string-append
3185 "https://pypi.python.org/packages/source/P/Pillow/Pillow-"
3186 version
3187 ".tar.gz"))
3188 (sha256
3189 (base32
3190 "1y0rysgd7vqpl5lh0lsra7j2k30azwxqlh5jnqk1i0pmfc735s96"))))
3191 (build-system python-build-system)
3192 (inputs
3193 `(("freetype" ,freetype)
3194 ("lcms" ,lcms)
3195 ("libjpeg" ,libjpeg)
3196 ("libtiff" ,libtiff)
3197 ("openjpeg" ,openjpeg)
3198 ("python-setuptools" ,python-setuptools)
3199 ("zlib" ,zlib)))
3200 (arguments
3201 `(#:tests? #f)) ; no check target
3202 (home-page "http://python-pillow.github.io/")
3203 (synopsis "Pillow fork of Python Imaging Library")
3204 (description "Pillow is a fork of the Python Imaging Library (PIL).")
3205 ;; PIL license, see
3206 ;; http://www.pythonware.com/products/pil/license.htm
3207 (license (x11-style
3208 "file://PKG-INFO"
3209 "See http://www.pythonware.com/products/pil/license.htm"))))
3210
3211(define-public python2-pillow
3212 (package-with-python2 python-pillow))
bec07a7c
AE
3213
3214(define-public python2-pil
3215 (package
3216 (name "python2-pil")
3217 (version "1.1.7")
3218 (source
3219 (origin
3220 (method url-fetch)
3221 (uri (string-append
3222 "http://effbot.org/downloads/Imaging-"
3223 version ".tar.gz"))
3224 (sha256
3225 (base32
516277cb
AE
3226 "04aj80jhfbmxqzvmq40zfi4z3cw6vi01m3wkk6diz3lc971cfnw9"))
3227 (modules '((guix build utils)))
3228 (snippet
3229 ;; Adapt to newer freetype. As the package is unmaintained upstream,
3230 ;; there is no use in creating a patch and reporting it.
3231 '(substitute* "_imagingft.c"
3232 (("freetype/")
3233 "freetype2/")))))
bec07a7c
AE
3234 (build-system python-build-system)
3235 (inputs
3236 `(("freetype" ,freetype)
3237 ("libjpeg" ,libjpeg)
3238 ("libtiff" ,libtiff)
3239 ("python-setuptools" ,python-setuptools)
3240 ("zlib" ,zlib)))
3241 (arguments
3242 ;; Only the fork python-pillow works with Python 3.
3243 `(#:python ,python-2
3244 #:tests? #f ; no check target
3245 #:phases
3246 (alist-cons-before
3247 'build 'configure
3248 ;; According to README and setup.py, manual configuration is
3249 ;; the preferred way of "searching" for inputs.
3250 ;; lcms is not found, TCL_ROOT refers to the unavailable tkinter.
3251 (lambda* (#:key inputs #:allow-other-keys)
3252 (let ((jpeg (assoc-ref inputs "libjpeg"))
3253 (zlib (assoc-ref inputs "zlib"))
3254 (tiff (assoc-ref inputs "libtiff"))
3255 (freetype (assoc-ref inputs "freetype")))
3256 (substitute* "setup.py"
3257 (("JPEG_ROOT = None")
3258 (string-append "JPEG_ROOT = libinclude(\"" jpeg "\")"))
3259 (("ZLIB_ROOT = None")
3260 (string-append "ZLIB_ROOT = libinclude(\"" zlib "\")"))
3261 (("TIFF_ROOT = None")
3262 (string-append "TIFF_ROOT = libinclude(\"" tiff "\")"))
3263 (("FREETYPE_ROOT = None")
3264 (string-append "FREETYPE_ROOT = libinclude(\""
3265 freetype "\")")))))
3266 %standard-phases)))
3267 (home-page "http://www.pythonware.com/products/pil/")
3268 (synopsis "Python Imaging Library")
3269 (description "The Python Imaging Library (PIL) adds image processing
3270capabilities to the Python interpreter.")
3271 (license (x11-style
3272 "file://README"
3273 "See 'README' in the distribution."))))
092e86f5
AE
3274
3275(define-public python2-cssutils
3276 (package
3277 (name "python2-cssutils")
3278 (version "1.0")
3279 (source
3280 (origin
3281 (method url-fetch)
3282 (uri (string-append
3283 "https://pypi.python.org/packages/source/c/cssutils/cssutils-"
3284 version
3285 ".zip"))
3286 (sha256
3287 (base32
3288 "1bwim1353r4hqiir73sn4sc43y7ymh09qx0kly7vj048blppc125"))))
3289 (build-system python-build-system)
3290 (native-inputs
3291 `(("python2-mock" ,python2-mock) ; for the tests
3292 ("unzip" ,unzip))) ; for unpacking the source
3293 (inputs
3294 `(("python2-setuptools" ,python2-setuptools)))
3295 (arguments
3296 `(#:python ,python-2 ; Otherwise tests fail with a syntax error.
3297 #:tests? #f ; The tests apparently download an external URL.
da6dd842 3298 ))
092e86f5
AE
3299 (home-page "http://cthedot.de/cssutils/")
3300 (synopsis
3301 "CSS Cascading Style Sheets library for Python")
3302 (description
3303 "Cssutils is a Python package for parsing and building CSS
3304Cascading Style Sheets. Currently it provides a DOM only and no rendering
3305options.")
3306 (license lgpl3+)))
880ff77c
AE
3307
3308(define-public python-cssselect
3309 (package
3310 (name "python-cssselect")
3311 (version "0.9.1")
3312 (source
3313 (origin
3314 (method url-fetch)
3315 (uri (string-append
3316 "https://pypi.python.org/packages/source/c/cssselect/cssselect-"
3317 version
3318 ".tar.gz"))
3319 (sha256
3320 (base32
3321 "10h623qnp6dp1191jri7lvgmnd4yfkl36k9smqklp1qlf3iafd85"))))
3322 (build-system python-build-system)
3323 (inputs
3324 `(("python-setuptools" ,python-setuptools)))
3325 (arguments
3326 ;; tests fail with message
3327 ;; AttributeError: 'module' object has no attribute 'tests'
3328 `(#:tests? #f))
3329 (home-page
3330 "https://pythonhosted.org/cssselect/")
3331 (synopsis
3332 "CSS3 selector parser and translator to XPath 1.0")
3333 (description
3334 "Cssselect ia a Python module that parses CSS3 Selectors and translates
3335them to XPath 1.0 expressions. Such expressions can be used in lxml or
3336another XPath engine to find the matching elements in an XML or HTML document.")
3337 (license bsd-3)))
3338
3339(define-public python2-cssselect
3340 (package-with-python2 python-cssselect))
60357f99
AE
3341
3342(define-public python-netifaces
3343 (package
3344 (name "python-netifaces")
3345 (version "0.10.4")
3346 (source
3347 (origin
3348 (method url-fetch)
3349 (uri (string-append
3350 "https://pypi.python.org/packages/source/n/netifaces/netifaces-"
3351 version
3352 ".tar.gz"))
3353 (sha256
3354 (base32
3355 "1plw237a4zib4z8s62g0mrs8gm3kjfrp5sxh6bbk9nl3rdls2mln"))))
3356 (build-system python-build-system)
3357 (inputs
3358 `(("python-setuptools" ,python-setuptools)))
3359 (home-page
3360 "https://bitbucket.org/al45tair/netifaces")
3361 (synopsis
3362 "Python module for portable network interface information")
3363 (description
3364 "Netifaces is a Python module providing information on network
3365interfaces in an easy and portable manner.")
3366 (license license:expat)))
3367
3368(define-public python2-netifaces
3369 (package-with-python2 python-netifaces))
92cb152b 3370
32f77c04
RW
3371(define-public python-networkx
3372 (package
3373 (name "python-networkx")
3374 (version "1.9.1")
3375 (source
3376 (origin
3377 (method url-fetch)
3378 (uri (string-append
3379 "https://pypi.python.org/packages/source/n/networkx/networkx-"
3380 version ".tar.gz"))
3381 (sha256
3382 (base32 "0n8wy0yq1kmdq4wh68mlhwhkndvwzx48lg41a1z0sxxms0wfp033"))))
3383 (build-system python-build-system)
3384 ;; python-decorator is needed at runtime
3385 (propagated-inputs
3386 `(("python-decorator" ,python-decorator)))
3387 (native-inputs
3388 `(("python-setuptools" ,python-setuptools)
3389 ("python-nose" ,python-nose)))
3390 (home-page "http://networkx.github.io/")
3391 (synopsis "Python module for creating and manipulating graphs and networks")
3392 (description
3393 "NetworkX is a Python package for the creation, manipulation, and study
3394of the structure, dynamics, and functions of complex networks.")
3395 (license bsd-3)))
3396
3397(define-public python2-networkx
3398 (package-with-python2 python-networkx))
3399
92cb152b
RW
3400(define-public snakemake
3401 (package
3402 (name "snakemake")
3403 (version "3.2.1")
3404 (source
3405 (origin
3406 (method url-fetch)
3407 (uri (string-append
3408 "https://pypi.python.org/packages/source/s/snakemake/snakemake-"
3409 version ".tar.gz"))
3410 (sha256
3411 (base32 "0fi4b63sj60hvi7rfydvmz2icl4wj74djw5sn2gl8hxd02qw4b91"))))
3412 (build-system python-build-system)
3413 (inputs `(("python-setuptools" ,python-setuptools)))
3414 (home-page "https://bitbucket.org/johanneskoester/snakemake")
3415 (synopsis "Python-based execution environment for make-like workflows")
3416 (description
3417 "Snakemake aims to reduce the complexity of creating workflows by
3418providing a clean and modern domain specific specification language (DSL) in
3419Python style, together with a fast and comfortable execution environment.")
3420 (license license:expat)))
a1920bc9
FB
3421
3422(define-public python-testlib
3423 (package
3424 (name "python-testlib")
3425 (version "0.6.5")
3426 (source
3427 (origin
3428 (method url-fetch)
3429 (uri (string-append
3430 "https://pypi.python.org/packages/source/t/testlib/testlib-"
3431 version ".zip"))
3432 (sha256
3433 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
3434 (build-system python-build-system)
3435 (inputs
3436 `(("python-setuptools" ,python-setuptools)))
3437 (native-inputs
3438 `(("unzip" ,unzip)))
3439 (arguments
3440 `(#:phases
3441 (alist-replace
3442 'unpack
3443 (lambda* (#:key inputs outputs #:allow-other-keys)
3444 (let ((unzip (string-append (assoc-ref inputs "unzip")
3445 "/bin/unzip"))
3446 (source (assoc-ref inputs "source")))
3447 (and (zero? (system* unzip source))
3448 (chdir (string-append "testlib-" ,version)))))
3449 %standard-phases)))
3450 (synopsis "Python micro test suite harness")
3451 (description "A micro unittest suite harness for Python.")
3452 (home-page "https://github.com/trentm/testlib")
1cb9c006 3453 (license license:expat)))
a1920bc9
FB
3454
3455(define-public python2-testlib
3456 (package-with-python2 python-testlib))
db62afa5
LC
3457
3458(define-public python2-xlib
3459 (package
3460 (name "python2-xlib")
3461 (version "0.14")
3462 (source (origin
3463 (method url-fetch)
3464 (uri (string-append "mirror://sourceforge/python-xlib/"
3465 "python-xlib-" version ".tar.gz"))
3466 (sha256
3467 (base32
3468 "1sv0447j0rx8cgs3jhjl695p5pv13ihglcjlrrz1kq05lsvb0wa7"))))
3469 (build-system python-build-system)
3470 (arguments
3471 `(#:python ,python-2 ;Python 2 only
3472 #:tests? #f)) ;no tests
3473 (inputs
3474 `(("python-setuptools" ,python-setuptools)))
3475 (home-page "http://python-xlib.sourceforge.net/")
3476 (synopsis "Python X11 client library")
3477 (description
3478 "The Python X Library is intended to be a fully functional X client
3479library for Python programs. It is useful to implement low-level X clients.
3480It is written entirely in Python.")
3481 (license gpl2+)))
0234ca06
DT
3482
3483(define-public python-singledispatch
3484 (package
3485 (name "python-singledispatch")
3486 (version "3.4.0.3")
3487 (source
3488 (origin
3489 (method url-fetch)
3490 (uri (string-append
3491 "https://pypi.python.org/packages/source/s/singledispatch/"
3492 "singledispatch-" version ".tar.gz"))
3493 (sha256
3494 (base32
3495 "171b7ip0hsq5qm83np40h3phlr36ym18w0lay0a8v08kvy3sy1jv"))))
3496 (build-system python-build-system)
3497 (native-inputs
3498 `(("python-setuptools" ,python-setuptools)))
3499 (propagated-inputs
3500 `(("python-six" ,python-six)))
3501 (home-page
3502 "http://docs.python.org/3/library/functools.html#functools.singledispatch")
3503 (synopsis "Backport of singledispatch feature from Python 3.4")
3504 (description
3505 "This library brings functools.singledispatch from Python 3.4 to Python
35062.6-3.3.")
3507 (license license:expat)))
3508
3509(define-public python2-singledispatch
3510 (package-with-python2 python-singledispatch))
feaae484
SB
3511
3512(define-public python-waf
3513 (package
3514 (name "python-waf")
3515 (version "1.8.8")
3516 (source (origin
3517 (method url-fetch)
3518 (uri (string-append "https://waf.io/"
3519 "waf-" version ".tar.bz2"))
3520 (sha256
3521 (base32
3522 "0b5q307fgn6a5d8yjia2d1l4bk1q3ilvc0w8k4isfrrx2gbcw8wn"))))
3523 (build-system python-build-system)
3524 (arguments
3525 '(#:phases
3526 (modify-phases %standard-phases
3527 (replace 'build
3528 (lambda _
3529 (zero? (begin
3530 (system* "python" "waf-light" "configure")
3531 (system* "python" "waf-light" "build")))))
3532 (replace 'check
3533 (lambda _
3534 (zero? (system* "python" "waf" "--version"))))
3535 (replace 'install
3536 (lambda _
3537 (copy-file "waf" %output))))))
3538 (home-page "https://waf.io/")
3539 (synopsis "Python-based build system")
3540 (description
3541 "Waf is a Python-based framework for configuring, compiling and installing
3542applications.")
3543 (license bsd-3)))
3544
3545(define-public python2-waf
3546 (package-with-python2 python-waf))