gnu: Add python-pillow.
[jackhill/guix/guix.git] / gnu / packages / python.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages python)
25 #:use-module ((guix licenses)
26 #:select (asl2.0 bsd-3 bsd-2 bsd-style cc0 expat x11 x11-style
27 gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1+
28 psfl public-domain))
29 #:use-module ((guix licenses) #:select (zlib) #:prefix license:)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages gdbm)
33 #:use-module (gnu packages icu4c)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages libffi)
36 #:use-module (gnu packages readline)
37 #:use-module (gnu packages openssl)
38 #:use-module (gnu packages elf)
39 #:use-module (gnu packages maths)
40 #:use-module (gnu packages gcc)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages zip)
44 #:use-module (gnu packages ghostscript)
45 #:use-module (gnu packages multiprecision)
46 #:use-module (gnu packages texlive)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages image)
49 #:use-module (gnu packages imagemagick)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages which)
52 #:use-module (gnu packages perl)
53 #:use-module (guix packages)
54 #:use-module (guix download)
55 #:use-module (guix utils)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system python)
58 #:use-module (guix build-system trivial)
59 #:use-module (srfi srfi-1))
60
61 (define-public python-2
62 (package
63 (name "python")
64 (version "2.7.6")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (string-append "https://www.python.org/ftp/python/"
69 version "/Python-" version ".tar.xz"))
70 (patches (list (search-patch "python-libffi-mips-n32-fix.patch")
71 (search-patch "python2-sqlite-3.8.4-test-fix.patch")))
72 (patch-flags '("-p0"))
73 (sha256
74 (base32
75 "18gnpyh071dxa0rv3silrz92jw9qpblswzwv4gzqcwxzz20qxmhz"))))
76 (build-system gnu-build-system)
77 (arguments
78 `(#:tests? #f
79 ;; 258 tests OK.
80 ;; 103 tests failed:
81 ;; test_bz2 test_distutils test_file test_file2k test_popen2
82 ;; test_shutil test_signal test_site test_slice test_smtplib
83 ;; test_smtpnet test_socket test_socketserver test_softspace
84 ;; test_sort test_sqlite test_ssl test_startfile test_str
85 ;; test_strftime test_string test_stringprep test_strop test_strptime
86 ;; test_strtod test_struct test_structmembers test_structseq
87 ;; test_subprocess test_sunaudiodev test_sundry test_symtable
88 ;; test_syntax test_sys test_sys_setprofile test_sys_settrace
89 ;; test_sysconfig test_tarfile test_tcl test_telnetlib test_tempfile
90 ;; test_textwrap test_thread test_threaded_import
91 ;; test_threadedtempfile test_threading test_threading_local
92 ;; test_threadsignals test_time test_timeout test_tk test_tokenize
93 ;; test_tools test_trace test_traceback test_transformer
94 ;; test_ttk_guionly test_ttk_textonly test_tuple test_typechecks
95 ;; test_ucn test_unary test_undocumented_details test_unicode
96 ;; test_unicode_file test_unicodedata test_univnewlines
97 ;; test_univnewlines2k test_unpack test_urllib test_urllib2
98 ;; test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse
99 ;; test_userdict test_userlist test_userstring test_uu test_uuid
100 ;; test_wait3 test_wait4 test_warnings test_wave test_weakref
101 ;; test_weakset test_whichdb test_winreg test_winsound test_with
102 ;; test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c
103 ;; test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile
104 ;; test_zipfile64 test_zipimport test_zipimport_support test_zlib
105 ;; 31 tests skipped:
106 ;; test_aepack test_al test_applesingle test_ascii_formatd test_bsddb
107 ;; test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn
108 ;; test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
109 ;; test_codecmaps_tw test_ctypes test_curses test_dl test_gdb test_gl
110 ;; test_imageop test_imgfile test_ioctl test_kqueue
111 ;; test_linuxaudiodev test_macos test_macostools test_msilib
112 ;; test_multiprocessing test_ossaudiodev test_pep277
113 ;; test_scriptpackages
114 ;; 7 skips unexpected on linux2:
115 ;; test_ascii_formatd test_bsddb test_bsddb3 test_ctypes test_gdb
116 ;; test_ioctl test_multiprocessing
117 ;; One of the typical errors:
118 ;; test_unicode
119 ;; test test_unicode crashed -- <type 'exceptions.OSError'>: [Errno 2] No such file or directory
120 #:test-target "test"
121 #:configure-flags
122 (let ((bz2 (assoc-ref %build-inputs "bzip2"))
123 (gdbm (assoc-ref %build-inputs "gdbm"))
124 (libffi (assoc-ref %build-inputs "libffi"))
125 (sqlite (assoc-ref %build-inputs "sqlite"))
126 (openssl (assoc-ref %build-inputs "openssl"))
127 (readline (assoc-ref %build-inputs "readline"))
128 (zlib (assoc-ref %build-inputs "zlib")))
129 (list "--enable-shared" ; allow embedding
130 "--with-system-ffi" ; build ctypes
131 (string-append "CPPFLAGS="
132 "-I" bz2 "/include "
133 "-I" gdbm "/include "
134 "-I" sqlite "/include "
135 "-I" openssl "/include "
136 "-I" readline "/include "
137 "-I" zlib "/include")
138 (string-append "LDFLAGS="
139 "-L" bz2 "/lib "
140 "-L" gdbm "/lib "
141 "-L" libffi "/lib "
142 "-L" sqlite "/lib "
143 "-L" openssl "/lib "
144 "-L" readline "/lib "
145 "-L" zlib "/lib")))
146
147 #:modules ((guix build gnu-build-system)
148 (guix build utils)
149 (guix build rpath)
150 (srfi srfi-26))
151 #:imported-modules ((guix build gnu-build-system)
152 (guix build utils)
153 (guix build rpath))
154
155 #:phases
156 (alist-cons-after
157 'strip 'add-lib-to-runpath
158 (lambda* (#:key outputs #:allow-other-keys)
159 (let* ((out (assoc-ref outputs "out"))
160 (lib (string-append out "/lib")))
161 ;; Add LIB to the RUNPATH of all the executables.
162 (with-directory-excursion out
163 (for-each (cut augment-rpath <> lib)
164 (find-files "bin" ".*")))))
165 (alist-cons-before
166 'configure 'patch-lib-shells
167 (lambda _
168 ;; Filter for existing files, since some may not exist in all
169 ;; versions of python that are built with this recipe.
170 (substitute* (filter file-exists?
171 '("Lib/subprocess.py"
172 "Lib/popen2.py"
173 "Lib/distutils/tests/test_spawn.py"
174 "Lib/test/test_subprocess.py"))
175 (("/bin/sh") (which "sh"))))
176 (alist-cons-before
177 'check 'pre-check
178 (lambda _
179 ;; 'Lib/test/test_site.py' needs a valid $HOME
180 (setenv "HOME" (getcwd)))
181 %standard-phases)))))
182 (inputs
183 `(("bzip2" ,bzip2)
184 ("gdbm" ,gdbm)
185 ("libffi" ,libffi) ; for ctypes
186 ("sqlite" ,sqlite) ; for sqlite extension
187 ("openssl" ,openssl)
188 ("readline" ,readline)
189 ("zlib" ,zlib)
190 ("patchelf" ,patchelf))) ; for (guix build rpath)
191 (native-inputs
192 `(("pkg-config" ,pkg-config)))
193 (native-search-paths
194 (list (search-path-specification
195 (variable "PYTHONPATH")
196 (directories '("lib/python2.7/site-packages")))))
197 (home-page "http://python.org")
198 (synopsis
199 "High-level, dynamically-typed programming language")
200 (description
201 "Python is a remarkably powerful dynamic programming language that
202 is used in a wide variety of application domains. Some of its key
203 distinguishing features include: clear, readable syntax; strong
204 introspection capabilities; intuitive object orientation; natural
205 expression of procedural code; full modularity, supporting hierarchical
206 packages; exception-based error handling; and very high level dynamic
207 data types.")
208 (license psfl)))
209
210 (define-public python
211 (package (inherit python-2)
212 (version "3.3.5")
213 (source (origin
214 (method url-fetch)
215 (uri (string-append "https://www.python.org/ftp/python/"
216 version "/Python-" version ".tar.xz"))
217 (patches (list (search-patch "python-fix-tests.patch")
218 (search-patch "python-sqlite-3.8.4-test-fix.patch")
219 (search-patch "python-libffi-mips-n32-fix.patch")))
220 (patch-flags '("-p0"))
221 (sha256
222 (base32
223 "1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb"))))
224 (arguments
225 (let ((args `(#:modules ((guix build gnu-build-system)
226 (guix build utils)
227 (srfi srfi-1)
228 (srfi srfi-26))
229 ,@(package-arguments python-2))))
230 (substitute-keyword-arguments args
231 ((#:tests? _) #t))))
232 (native-search-paths
233 (list (search-path-specification
234 (variable "PYTHONPATH")
235 (directories '("lib/python3.3/site-packages")))))))
236
237 (define-public python-wrapper
238 (package (inherit python)
239 (name "python-wrapper")
240 (source #f)
241 (build-system trivial-build-system)
242 (propagated-inputs `(("python" ,python)))
243 (arguments
244 `(#:modules ((guix build utils))
245 #:builder
246 (begin
247 (use-modules (guix build utils))
248 (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
249 (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
250 (mkdir-p bin)
251 (for-each
252 (lambda (old new)
253 (symlink (string-append python old)
254 (string-append bin "/" new)))
255 `("python3", "pydoc3", "idle3")
256 `("python", "pydoc", "idle"))))))
257 (description (string-append (package-description python)
258 "\n\nThis wrapper package provides symbolic links to the python binaries
259 without version suffix."))))
260
261
262 (define-public python-pytz
263 (package
264 (name "python-pytz")
265 (version "2013b")
266 (source
267 (origin
268 (method url-fetch)
269 (uri (string-append "https://launchpad.net/pytz/main/" version
270 "/+download/pytz-" version ".tar.bz2"))
271 (sha256
272 (base32
273 "19giwgfcrg0nr1gdv49qnmf2jb2ilkcfc7qyqvfpz4dp0p64ksv5"))))
274 (build-system python-build-system)
275 (arguments `(#:tests? #f)) ; no test target
276 (home-page "https://launchpad.net/pytz")
277 (synopsis "Python timezone library")
278 (description
279 "This library allows accurate and cross platform timezone calculations
280 using Python 2.4 or higher and provides access to the Olson timezone database.")
281 (license x11)))
282
283 (define-public python2-pytz
284 (package-with-python2 python-pytz))
285
286
287 (define-public python-babel
288 (package
289 (name "python-babel")
290 (version "1.3")
291 (source
292 (origin
293 (method url-fetch)
294 (uri (string-append "https://pypi.python.org/packages/source/B/Babel/Babel-"
295 version ".tar.gz"))
296 (sha256
297 (base32
298 "0bnin777lc53nxd1hp3apq410jj5wx92n08h7h4izpl4f4sx00lz"))))
299 (build-system python-build-system)
300 (inputs
301 `(("python-pytz" ,python-pytz)
302 ("python-setuptools" ,python-setuptools)))
303 (arguments `(#:tests? #f)) ; no test target
304 (home-page "http://babel.pocoo.org/")
305 (synopsis
306 "Tools for internationalizing Python applications")
307 (description
308 "Babel is composed of two major parts:
309 - tools to build and work with gettext message catalogs
310 - a Python interface to the CLDR (Common Locale Data Repository), providing
311 access to various locale display names, localized number and date formatting,
312 etc. ")
313 (license bsd-3)))
314
315 (define-public python2-babel
316 (package-with-python2 python-babel))
317
318 (define-public python-lockfile
319 (package
320 (name "python-lockfile")
321 (version "0.9.1")
322 (source
323 (origin
324 (method url-fetch)
325 (uri (string-append "https://pypi.python.org/packages/source/l/lockfile/"
326 "lockfile-" version ".tar.gz"))
327 (sha256
328 (base32
329 "0iwif7i84gwpvrnpv4brshdk8j6l77smvknm8k3bg77mj6f5ini3"))))
330 (build-system python-build-system)
331 (arguments '(#:test-target "check"))
332 (home-page "http://code.google.com/p/pylockfile/")
333 (synopsis "Platform-independent file locking module")
334 (description
335 "The lockfile package exports a LockFile class which provides a simple
336 API for locking files.")
337 (license expat)))
338
339 (define-public python2-lockfile
340 (package-with-python2 python-lockfile))
341
342 (define-public python-mock
343 (package
344 (name "python-mock")
345 (version "1.0.1")
346 (source
347 (origin
348 (method url-fetch)
349 (uri (string-append "https://pypi.python.org/packages/source/m/mock/"
350 "mock-" version ".tar.gz"))
351 (sha256
352 (base32
353 "0kzlsbki6q0awf89rc287f3aj8x431lrajf160a70z0ikhnxsfdq"))))
354 (build-system python-build-system)
355 (arguments '(#:test-target "check"))
356 (home-page "http://code.google.com/m/mock/")
357 (synopsis "Python mocking and patching library for testing")
358 (description
359 "Mock is a library for testing in Python. It allows you to replace parts
360 of your system under test with mock objects and make assertions about how they
361 have been used.")
362 (license expat)))
363
364 (define-public python2-mock
365 (package-with-python2 python-mock))
366
367
368 (define-public python-setuptools
369 (package
370 (name "python-setuptools")
371 (version "1.1.4")
372 (source
373 (origin
374 (method url-fetch)
375 (uri (string-append "https://pypi.python.org/packages/source/s/setuptools/setuptools-"
376 version ".tar.gz"))
377 (sha256
378 (base32
379 "0hl9sa5xr9bi2ifq51wy1bawsjv5nzvpbac7m9z1ciz778874csf"))))
380 (build-system python-build-system)
381 (arguments
382 `(#:tests? #f))
383 ;;FIXME: test_sdist_with_utf8_encoded_filename fails in
384 ;; /tmp/nix-build-python2-setuptools-1.1.4.drv-0/setuptools-1.1.4/setuptools/tests/test_sdist.py"
385 ;; line 354
386 ;; The tests pass with Python 2.7.5.
387 (home-page "https://pypi.python.org/pypi/setuptools")
388 (synopsis
389 "Library designed to facilitate packaging Python projects")
390 (description
391 "Setuptools is a fully-featured, stable library designed to facilitate
392 packaging Python projects, where packaging includes:
393 Python package and module definitions,
394 distribution package metadata,
395 test hooks,
396 project installation,
397 platform-specific details,
398 Python 3 support.")
399 (license psfl)))
400
401 (define-public python2-setuptools
402 (package-with-python2 python-setuptools))
403
404
405 (define-public python-pycrypto
406 (package
407 (name "python-pycrypto")
408 (version "2.6.1")
409 (source
410 (origin
411 (method url-fetch)
412 (uri (string-append "https://pypi.python.org/packages/source/p/"
413 "pycrypto/pycrypto-" version ".tar.gz"))
414 (sha256
415 (base32
416 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
417 (build-system python-build-system)
418 (native-inputs
419 `(("python-setuptools" ,python-setuptools)))
420 (inputs
421 `(("python" ,python)
422 ("gmp" ,gmp)))
423 (arguments
424 `(#:phases
425 (alist-cons-before
426 'build 'set-build-env
427 ;; pycrypto runs an autoconf configure script behind the scenes
428 (lambda _
429 (setenv "CONFIG_SHELL" (which "bash")))
430 %standard-phases)))
431 (home-page "http://www.pycrypto.org/")
432 (synopsis "Cryptographic modules for Python")
433 (description
434 "Pycrypto is a collection of both secure hash functions (such as SHA256
435 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
436 etc.). The package is structured to make adding new modules easy.")
437 (license public-domain)))
438
439 (define-public python-keyring
440 (package
441 (name "python-keyring")
442 (version "3.8")
443 (source
444 (origin
445 (method url-fetch)
446 (uri (string-append "https://pypi.python.org/packages/source/k/"
447 "keyring/keyring-" version ".zip"))
448 (sha256
449 (base32
450 "1vxazfbcwggyfyramh55shkxs08skhpqrkm6lrrjnygnm8c1l2zg"))))
451 (build-system python-build-system)
452 (native-inputs
453 `(("unzip" ,unzip)
454 ("python-setuptools" ,python-setuptools)
455 ("python-mock" ,python-mock)))
456 (inputs
457 `(("python-pycrypto" ,python-pycrypto)))
458 (arguments
459 `(#:tests? #f ;TODO: tests require pytest
460 #:phases
461 (alist-replace
462 'unpack
463 (lambda _
464 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
465 "/bin/unzip"))
466 (source (assoc-ref %build-inputs "source")))
467 (and (zero? (system* unzip source))
468 (chdir (string-append "keyring-" ,version)))))
469 %standard-phases)))
470 (home-page "http://bitbucket.org/kang/python-keyring-lib")
471 (synopsis "Store and access your passwords safely")
472 (description
473 "The Python keyring lib provides a easy way to access the system keyring
474 service from python. It can be used in any application that needs safe
475 password storage.")
476 ;; "MIT" and PSF dual license
477 (license x11)))
478
479 (define-public python-six
480 (package
481 (name "python-six")
482 (version "1.7.2")
483 (source
484 (origin
485 (method url-fetch)
486 (uri (string-append "https://pypi.python.org/packages/source/s/"
487 "six/six-" version ".tar.gz"))
488 (sha256
489 (base32
490 "164rns26aqfqx2hwi0qq3scl50s69japn0fvgvrjsbyg7r1mxf67"))))
491 (build-system python-build-system)
492 (inputs
493 `(("python-setuptools" ,python-setuptools)))
494 (home-page "http://pypi.python.org/pypi/six/")
495 (synopsis "Python 2 and 3 compatibility utilities")
496 (description
497 "Six is a Python 2 and 3 compatibility library. It provides utility
498 functions for smoothing over the differences between the Python versions with
499 the goal of writing Python code that is compatible on both Python versions.
500 Six supports every Python version since 2.5. It is contained in only one
501 Python file, so it can be easily copied into your project.")
502 (license x11)))
503
504 (define-public python-dateutil-2
505 (package
506 (name "python-dateutil")
507 (version "2.2")
508 (source
509 (origin
510 (method url-fetch)
511 (uri (string-append "https://pypi.python.org/packages/source/p/"
512 name "/" name "-" version ".tar.gz"))
513 (sha256
514 (base32
515 "0s74ad6r789810s10dxgvaf48ni6adac2icrdad34zxygqq6bj7f"))))
516 (build-system python-build-system)
517 (inputs
518 `(("python-setuptools" ,python-setuptools)
519 ("python-six" ,python-six)))
520 (home-page "http://labix.org/python-dateutil")
521 (synopsis "Extensions to the standard datetime module")
522 (description
523 "The dateutil module provides powerful extensions to the standard
524 datetime module, available in Python 2.3+.")
525 (license bsd-3)))
526
527 (define-public python2-dateutil-2
528 (package-with-python2 python-dateutil-2))
529
530 (define-public python-dateutil
531 (package
532 (name "python-dateutil")
533 (version "1.5") ; last version for python < 3
534 (source
535 (origin
536 (method url-fetch)
537 (uri (string-append "http://labix.org/download/python-dateutil/"
538 "python-dateutil-" version ".tar.gz"))
539 (sha256
540 (base32
541 "0fqfglhy5khbvsipr3x7m6bcaqljh8xl5cw33vbfxy7qhmywm2n0"))))
542 (build-system python-build-system)
543 (inputs
544 `(("python-setuptools" ,python-setuptools)))
545 (home-page "http://labix.org/python-dateutil")
546 (synopsis "Extensions to the standard datetime module")
547 (description
548 "The dateutil module provides powerful extensions to the standard
549 datetime module, available in Python 2.3+.")
550 (license psfl)))
551
552 (define-public python2-dateutil
553 (package-with-python2 python-dateutil))
554
555 (define-public python-parsedatetime
556 (package
557 (name "python-parsedatetime")
558 (version "1.2")
559 (source
560 (origin
561 (method url-fetch)
562 (uri (string-append "https://pypi.python.org/packages/source/p/"
563 "parsedatetime/parsedatetime-" version ".tar.gz"))
564 (sha256
565 (base32
566 "1zcj0pzxvpl4j2ma9awmpkfxldybi2kjaahjjpmgfbg5cxwcjsqv"))))
567 (build-system python-build-system)
568 (native-inputs
569 `(("python-setuptools" ,python-setuptools)))
570 (arguments `(#:tests? #f)) ;no test target
571 (home-page "http://github.com/bear/parsedatetime/")
572 (synopsis
573 "Parse human-readable date/time text")
574 (description
575 "Parse human-readable date/time text")
576 (license asl2.0)))
577
578 (define-public python-tzlocal
579 (package
580 (name "python-tzlocal")
581 (version "1.1.1")
582 (source
583 (origin
584 (method url-fetch)
585 (uri (string-append "https://pypi.python.org/packages/source/t/"
586 "tzlocal/tzlocal-" version ".zip"))
587 (sha256
588 (base32
589 "1m3y918c3chf41fwg2bx4w42bqsjzn3dyvvcmwwy13c8gj6zssv9"))))
590 (build-system python-build-system)
591 (native-inputs
592 `(("unzip" ,unzip)
593 ("python-setuptools" ,python-setuptools)))
594 (inputs `(("python-pytz" ,python-pytz)))
595 (arguments
596 `(#:phases
597 (alist-replace
598 'unpack
599 (lambda _
600 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
601 "/bin/unzip"))
602 (source (assoc-ref %build-inputs "source")))
603 (and (zero? (system* unzip source))
604 (chdir (string-append "tzlocal-" ,version)))))
605 %standard-phases)))
606 (home-page "https://github.com/regebro/tzlocal")
607 (synopsis
608 "Local timezone information for Python")
609 (description
610 "Tzlocal returns a tzinfo object with the local timezone information.
611 This module attempts to fix a glaring hole in pytz, that there is no way to
612 get the local timezone information, unless you know the zoneinfo name, and
613 under several distributions that's hard or impossible to figure out.")
614 (license cc0)))
615
616
617 (define-public python2-pysqlite
618 (package
619 (name "python2-pysqlite")
620 (version "2.6.3a") ; see below
621 (source
622 (origin
623 (method url-fetch)
624 ;; During the switch from code.google.com to pypi.python.org, the 2.6.3
625 ;; tarball was modified, but the version number was kept:
626 ;; <https://lists.gnu.org/archive/html/guix-devel/2014-02/msg00077.html>.
627 ;; Here we want to refer to the pypi-hosted 2.6.3 tarball.
628 (uri (string-append
629 "https://pypi.python.org/packages/source/p/pysqlite/pysqlite-"
630 "2.6.3" ".tar.gz"))
631 (sha256
632 (base32
633 "13djzgnbi71znjjyaw4nybg6smilgszcid646j5qav7mdchkb77y"))))
634 (build-system python-build-system)
635 (inputs
636 `(("sqlite" ,sqlite)))
637 (arguments
638 `(#:python ,python-2 ; incompatible with Python 3
639 #:tests? #f)) ; no test target
640 (home-page "https://pypi.python.org/pypi/pysqlite")
641 (synopsis "SQLite bindings for Python")
642 (description
643 "Pysqlite provides SQLite bindings for Python that comply to the
644 Database API 2.0T.")
645 (license license:zlib)))
646
647
648 (define-public python2-mechanize
649 (package
650 (name "python2-mechanize")
651 (version "0.2.5")
652 (source
653 (origin
654 (method url-fetch)
655 (uri (string-append "https://pypi.python.org/packages/source/m/mechanize/mechanize-"
656 version ".tar.gz"))
657 (sha256
658 (base32
659 "0rj7r166i1dyrq0ihm5rijfmvhs8a04im28lv05c0c3v206v4rrf"))))
660 (build-system python-build-system)
661 (inputs
662 `(("python2-setuptools" ,python2-setuptools)))
663 (arguments
664 `(#:python ,python-2 ; apparently incompatible with Python 3
665 #:tests? #f))
666 ;; test fails with message
667 ;; AttributeError: 'module' object has no attribute 'test_pullparser'
668 ;; (python-3.3.2) or
669 ;; AttributeError: 'module' object has no attribute 'test_urllib2_localnet'
670 ;; (python-2.7.5).
671 ;; The source code is from March 2011 and probably not up-to-date
672 ;; with respect to python unit tests.
673 (home-page "http://wwwsearch.sourceforge.net/mechanize/")
674 (synopsis
675 "Stateful programmatic web browsing in Python")
676 (description
677 "Mechanize implements stateful programmatic web browsing in Python,
678 after Andy Lester’s Perl module WWW::Mechanize.")
679 (license (bsd-style "file://COPYING"
680 "See COPYING in the distribution."))))
681
682
683 (define-public python-simplejson
684 (package
685 (name "python-simplejson")
686 (version "3.3.0")
687 (source
688 (origin
689 (method url-fetch)
690 (uri (string-append "https://pypi.python.org/packages/source/s/simplejson/simplejson-"
691 version ".tar.gz"))
692 (sha256
693 (base32
694 "07wsry5j44l5zzm74l4j2bvasiq8n5m32f31n2p7c68i5vc6p2ks"))))
695 (build-system python-build-system)
696 (home-page "http://simplejson.readthedocs.org/en/latest/")
697 (synopsis
698 "Json library for Python")
699 (description
700 "JSON (JavaScript Object Notation) is a subset of JavaScript syntax
701 (ECMA-262 3rd edition) used as a lightweight data interchange format.
702
703 Simplejson exposes an API familiar to users of the standard library marshal
704 and pickle modules. It is the externally maintained version of the json
705 library contained in Python 2.6, but maintains compatibility with Python 2.5
706 and (currently) has significant performance advantages, even without using
707 the optional C extension for speedups. Simplejson is also supported on
708 Python 3.3+.")
709 (license x11)))
710
711 (define-public python2-simplejson
712 (package-with-python2 python-simplejson))
713
714
715 (define-public python2-pyicu
716 (package
717 (name "python2-pyicu")
718 (version "1.8")
719 (source
720 (origin
721 (method url-fetch)
722 (uri (string-append "https://pypi.python.org/packages/source/P/PyICU/PyICU-"
723 version ".tar.gz"))
724 (sha256
725 (base32
726 "1y361x82lnh9k9srmdx3q92z5iag112z7r5fxm0n1sfwb349yjdw"))))
727 (build-system python-build-system)
728 (inputs
729 `(("icu4c" ,icu4c)))
730 (arguments
731 `(#:python ,python-2 ; Python 3 works also, but needs special care for
732 ; linking with libpython3.3m
733 #:tests? #f)) ; no check target
734 (home-page "http://pyicu.osafoundation.org/")
735 (synopsis "Python extension wrapping the ICU C++ API")
736 (description
737 "PyICU is a python extension wrapping the ICU C++ API.")
738 (license x11)))
739
740 (define-public python2-dogtail
741 ;; Python 2 only, as it leads to "TabError: inconsistent use of tabs and
742 ;; spaces in indentation" with Python 3.
743 (package
744 (name "python2-dogtail")
745 (version "0.8.2")
746 (source (origin
747 (method url-fetch)
748 (uri (string-append
749 "https://fedorahosted.org/released/dogtail/dogtail-"
750 version ".tar.gz"))
751 (sha256
752 (base32
753 "1yc4cg7ip87z15gyd4wy2vzbywrjc52a3m8r8gqy2b50d65llcg1"))))
754 (build-system python-build-system)
755 (arguments `(#:python ,python-2
756 #:tests? #f)) ; invalid command "test"
757 (home-page "https://fedorahosted.org/dogtail/")
758 (synopsis "GUI test tool and automation framework written in ​Python")
759 (description
760 "Dogtail is a GUI test tool and automation framework written in Python.
761 It uses Accessibility (a11y) technologies to communicate with desktop
762 applications. dogtail scripts are written in Python and executed like any
763 other Python program.")
764 (license gpl2+)))
765
766 (define-public python2-empy
767 (package
768 (name "python2-empy")
769 (version "3.3")
770 (source (origin
771 (method url-fetch)
772 (uri (string-append "http://www.alcyone.com/software/empy/empy-"
773 version ".tar.gz"))
774 (sha256
775 (base32
776 "01g8mmkfnvjdmlhsihwyx56lrg7r5m5d2fg6mnxsvy6g0dnl69f6"))))
777 (build-system python-build-system)
778 (arguments
779 `(#:python ,python-2
780 #:phases (alist-replace
781 'check
782 (lambda _
783 (zero? (system* "./test.sh")))
784 %standard-phases)))
785 (home-page "http://www.alcyone.com/software/empy/")
786 (synopsis "Templating system for Python")
787 (description
788 "EmPy is a system for embedding Python expressions and statements in
789 template text; it takes an EmPy source file, processes it, and produces
790 output. This is accomplished via expansions, which are special signals to the
791 EmPy system and are set off by a special prefix (by default the at sign, @).
792 EmPy can expand arbitrary Python expressions and statements in this way, as
793 well as a variety of special forms. Textual data not explicitly delimited in
794 this way is sent unaffected to the output, allowing Python to be used in
795 effect as a markup language. Also supported are callbacks via hooks,
796 recording and playback via diversions, and dynamic, chainable filters. The
797 system is highly configurable via command line options and embedded
798 commands.")
799 (license lgpl2.1+)))
800
801 (define-public python2-element-tree
802 (package
803 (name "python2-element-tree")
804 (version "1.2.6")
805 (source (origin
806 (method url-fetch)
807 (uri (string-append
808 "http://effbot.org/media/downloads/elementtree-"
809 version "-20050316.tar.gz"))
810 (sha256
811 (base32
812 "016bphqnlg0l4vslahhw4r0aanw95bpypy65r1i1acyb2wj5z7dj"))))
813 (build-system python-build-system)
814 (arguments
815 `(#:python ,python-2 ; seems to be part of Python 3
816 #:tests? #f)) ; no 'test' sub-command
817 (synopsis "Toolkit for XML processing in Python")
818 (description
819 "ElementTree is a Python library supporting lightweight XML processing.")
820 (home-page "http://effbot.org/zone/element-index.htm")
821 (license (x11-style "http://docs.python.org/2/license.html"
822 "Like \"CWI LICENSE AGREEMENT FOR PYTHON \
823 0.9.0 THROUGH 1.2\"."))))
824
825 (define-public python2-pybugz
826 (package
827 (name "python2-pybugz")
828 (version "0.6.11")
829 (source (origin
830 (method url-fetch)
831 (uri (string-append
832 "http://bits.liquidx.net/projects/pybugz/pybugz-"
833 version ".tar.gz"))
834 (sha256
835 (base32
836 "17ni00p08gp5lkxlrrcnvi3x09fmajnlbz4da03qcgl9q21ym4jd"))
837 (patches (map search-patch
838 (list "pybugz-stty.patch"
839 "pybugz-encode-error.patch")))))
840 (build-system python-build-system)
841 (arguments
842 `(#:python ,python-2 ; SyntaxError with Python 3
843 #:tests? #f)) ; no 'test' sub-command
844 (inputs `(("element-tree" ,python2-element-tree)))
845 (synopsis "Python and command-line interface to Bugzilla")
846 (description
847 "PyBugz is a Python library and command-line tool to query the Bugzilla
848 bug tracking system. It is meant as an aid to speed up interaction with the
849 bug tracker.")
850 (home-page "http://www.liquidx.net/pybugz/")
851 (license gpl2)))
852
853 (define-public python-enum34
854 (package
855 (name "python-enum34")
856 (version "1.0")
857 (source
858 (origin
859 (method url-fetch)
860 (uri (string-append "https://pypi.python.org/packages/source/e/"
861 "enum34/enum34-" version ".tar.gz"))
862 (sha256
863 (base32
864 "0dg6mpg9n4g9diyrbnbb5vd9d1qw9f265zwhknqy0mxh0cvmjjrq"))))
865 (build-system python-build-system)
866 (inputs
867 `(("python-setuptools" ,python-setuptools)))
868 (arguments
869 `(#:phases
870 (alist-replace
871 'check
872 (lambda _ (zero? (system* "python" "enum/test_enum.py")))
873 %standard-phases)))
874 (home-page "https://pypi.python.org/pypi/enum34")
875 (synopsis "Backported Python 3.4 Enum")
876 (description
877 "Enum34 is the new Python stdlib enum module available in Python 3.4
878 backported for previous versions of Python from 2.4 to 3.3.")
879 (license bsd-3)))
880
881 (define-public python-parse-type
882 (package
883 (name "python-parse-type")
884 (version "0.3.4")
885 (source
886 (origin
887 (method url-fetch)
888 (uri (string-append "https://pypi.python.org/packages/source/p/"
889 "parse_type/parse_type-" version ".tar.gz"))
890 (sha256
891 (base32
892 "0iv1c34npr4iynwpgv1vkjx9rjd18a85ir8c01gc5f7wp8iv7l1x"))))
893 (build-system python-build-system)
894 (inputs
895 `(("python-setuptools" ,python-setuptools)
896 ("python-six" ,python-six)
897 ("python-parse" ,python-parse)
898 ("python-enum34" ,python-enum34))) ;required for python<3.4
899 (arguments '(#:tests? #f)) ;TODO: tests require pytest
900 (home-page "https://github.com/jenisys/parse_type")
901 (synopsis "Extended parse module")
902 (description
903 "Parse_type extends the python parse module.")
904 (license bsd-3)))
905
906 (define-public python-parse
907 (package
908 (name "python-parse")
909 (version "1.6.4")
910 (source
911 (origin
912 (method url-fetch)
913 (uri (string-append "https://pypi.python.org/packages/source/p/"
914 "parse/parse-" version ".tar.gz"))
915 (sha256
916 (base32
917 "0m30q64l6szl7s9mhvqy64w2fdhdn8lb91fmacjiwbv3479cmk57"))))
918 (build-system python-build-system)
919 (arguments
920 `(#:phases
921 (alist-replace
922 'check
923 (lambda _ (zero? (system* "python" "test_parse.py")))
924 %standard-phases)))
925 (home-page "https://github.com/r1chardj0n3s/parse")
926 (synopsis "Parse strings")
927 (description
928 "Parse strings using a specification based on the Python format()
929 syntax.")
930 (license x11)))
931
932
933 (define-public scons
934 (package
935 (name "scons")
936 (version "2.1.0")
937 (source (origin
938 (method url-fetch)
939 (uri (string-append "mirror://sourceforge/scons/scons-"
940 version ".tar.gz"))
941 (sha256
942 (base32
943 "07cjn4afb2cljjrd3cr7xf062qq58z8q96f58z6yplhdyqafsfa1"))))
944 (build-system python-build-system)
945 (arguments
946 ;; With Python 3.x, fails to build with a syntax error.
947 `(#:python ,python-2
948 #:tests? #f)) ; no 'python setup.py test' command
949 (home-page "http://scons.org/")
950 (synopsis "Software construction tool written in Python")
951 (description
952 "SCons is a software construction tool. Think of SCons as an improved,
953 cross-platform substitute for the classic Make utility with integrated
954 functionality similar to autoconf/automake and compiler caches such as ccache.
955 In short, SCons is an easier, more reliable and faster way to build
956 software.")
957 (license x11)))
958
959 (define-public python-extras
960 (package
961 (name "python-extras")
962 (version "0.0.3")
963 (source
964 (origin
965 (method url-fetch)
966 (uri (string-append
967 "https://pypi.python.org/packages/source/e/extras/extras-"
968 version ".tar.gz"))
969 (sha256
970 (base32
971 "1h7zx4dfyclalg0fqnfjijpn0f793a9mx8sy3b27gd31nr6dhq3s"))))
972 (build-system python-build-system)
973 (inputs
974 `(("python-setuptools" ,python-setuptools)))
975 (arguments
976 ;; error in setup.cfg: command 'test' has no such option 'buffer'
977 '(#:tests? #f))
978 (home-page "https://github.com/testing-cabal/extras")
979 (synopsis "Useful extensions to the Python standard library")
980 (description
981 "Extras is a set of extensions to the Python standard library.")
982 (license expat)))
983
984 (define-public python2-extras
985 (package-with-python2 python-extras))
986
987 (define-public python-mimeparse
988 (package
989 (name "python-mimeparse")
990 (version "0.1.4")
991 (source
992 (origin
993 (method url-fetch)
994 (uri (string-append
995 "https://pypi.python.org/packages/source/p/python-mimeparse/python-mimeparse-"
996 version ".tar.gz"))
997 (sha256
998 (base32
999 "1hyxg09kaj02ri0rmwjqi86wk4nd1akvv7n0dx77azz76wga4s9w"))))
1000 (build-system python-build-system)
1001 (inputs
1002 `(("python-setuptools" ,python-setuptools)))
1003 (arguments
1004 '(#:tests? #f)) ; no setup.py test command
1005 (home-page
1006 "https://github.com/dbtsai/python-mimeparse")
1007 (synopsis "Python library for parsing MIME types")
1008 (description
1009 "Mimeparse provides basic functions for parsing MIME type names and
1010 matching them against a list of media-ranges.")
1011 (license expat)))
1012
1013 (define-public python2-mimeparse
1014 (package-with-python2 python-mimeparse))
1015
1016 (define-public python-nose
1017 (package
1018 (name "python-nose")
1019 (version "1.3.4")
1020 (source
1021 (origin
1022 (method url-fetch)
1023 (uri (string-append
1024 "https://pypi.python.org/packages/source/n/nose/nose-"
1025 version ".tar.gz"))
1026 (sha256
1027 (base32
1028 "00qymfgwg4iam4xi0w9bnv7lcb3fypq1hzfafzgs1rfmwaj67g3n"))))
1029 (build-system python-build-system)
1030 (inputs
1031 `(("python-setuptools" ,python-setuptools)))
1032 (arguments
1033 '(#:tests? #f)) ; FIXME: test suite fails
1034 (home-page "http://readthedocs.org/docs/nose/")
1035 (synopsis "Python testing library")
1036 (description
1037 "Nose extends the unittest library to make testing easier.")
1038 (license lgpl2.0+)))
1039
1040 (define-public python2-nose
1041 (package-with-python2 python-nose))
1042
1043 (define-public python-unittest2
1044 (package
1045 (name "python-unittest2")
1046 (version "0.5.1")
1047 (source
1048 (origin
1049 (method url-fetch)
1050 (uri (string-append
1051 "https://pypi.python.org/packages/source/u/unittest2py3k/unittest2py3k-"
1052 version ".tar.gz"))
1053 (sha256
1054 (base32
1055 "00yl6lskygcrddx5zspkhr0ibgvpknl4678kkm6s626539grq93q"))))
1056 (build-system python-build-system)
1057 (inputs
1058 `(("python-setuptools" ,python-setuptools)))
1059 (home-page "http://pypi.python.org/pypi/unittest2")
1060 (synopsis "Python unit testing library")
1061 (description
1062 "Unittest2 is a replacement for the unittest module in the Python
1063 standard library.")
1064 (license psfl)))
1065
1066 (define-public python2-unittest2
1067 (package (inherit python-unittest2)
1068 (name "python2-unittest2")
1069 (version "0.5.1")
1070 (source
1071 (origin
1072 (method url-fetch)
1073 (uri (string-append
1074 "https://pypi.python.org/packages/source/u/unittest2/unittest2-"
1075 version ".tar.gz"))
1076 (sha256
1077 (base32
1078 "0wbs4i4x3x7klr3v35ss6p9mcqz883i1xgcpkhvl7n2lyv6yhpda"))))
1079 (inputs
1080 `(("python2-setuptools" ,python-setuptools)))
1081 (arguments
1082 `(#:python ,python-2
1083 #:tests? #f)))) ; no setup.py test command
1084
1085 (define-public python-py
1086 (package
1087 (name "python-py")
1088 (version "1.4.23")
1089 (source
1090 (origin
1091 (method url-fetch)
1092 (uri (string-append
1093 "https://pypi.python.org/packages/source/p/py/py-"
1094 version ".tar.gz"))
1095 (sha256
1096 (base32
1097 "1jkhffpai419v5rickm2vz86p9bkg3b3kcm2k4bi5wfajhw2m3xs"))))
1098 (build-system python-build-system)
1099 (inputs
1100 `(("python-setuptools" ,python-setuptools)))
1101 (home-page "http://pylib.readthedocs.org/")
1102 (synopsis "Python library for parsing, I/O, instrospection, and logging")
1103 (description
1104 "Py is a Python library for file name parsing, .ini file parsing, I/O,
1105 code introspection, and logging.")
1106 (license expat)))
1107
1108 (define-public python2-py
1109 (package-with-python2 python-py))
1110
1111 (define-public python-pytest
1112 (package
1113 (name "python-pytest")
1114 (version "2.6.1")
1115 (source
1116 (origin
1117 (method url-fetch)
1118 (uri (string-append
1119 "https://pypi.python.org/packages/source/p/pytest/pytest-"
1120 version ".tar.gz"))
1121 (sha256
1122 (base32
1123 "0g2w4p0n42wvz8rq4k6gnzpkakgz3g8sfanxk8jrsra9675snkcr"))
1124 (modules '((guix build utils)))
1125 (snippet
1126 ;; One of the tests involves the /usr directory, so it fails.
1127 '(substitute* "testing/test_argcomplete.py"
1128 (("def test_remove_dir_prefix\\(self\\):")
1129 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):")))))
1130 (build-system python-build-system)
1131 (inputs
1132 `(("python-setuptools" ,python-setuptools)
1133 ("python-py" ,python-py)
1134 ("python-nose" ,python-nose)
1135 ("python-mock" ,python-mock)))
1136 (home-page "http://pytest.org")
1137 (synopsis "Python testing library")
1138 (description
1139 "Pytest is a testing tool that provides auto-discovery of test modules
1140 and functions, detailed info on failing assert statements, modular fixtures,
1141 and many external plugins.")
1142 (license expat)))
1143
1144 (define-public python2-pytest
1145 (package-with-python2 python-pytest))
1146
1147 (define-public python-scripttest
1148 (package
1149 (name "python-scripttest")
1150 (version "1.3")
1151 (source
1152 (origin
1153 (method url-fetch)
1154 (uri (string-append
1155 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
1156 version ".tar.gz"))
1157 (sha256
1158 (base32
1159 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1160 (build-system python-build-system)
1161 (inputs
1162 `(("python-setuptools" ,python-setuptools)
1163 ("python-pytest" ,python-pytest)))
1164 (home-page "http://pythonpaste.org/scripttest/")
1165 (synopsis "Python library to test command-line scripts")
1166 (description "Scripttest is a Python helper library for testing
1167 interactive command-line applications. With it you can run a script in a
1168 subprocess and see the output as well as any file modifications.")
1169 (license expat)))
1170
1171 (define-public python2-scripttest
1172 (package-with-python2 python-scripttest))
1173
1174 (define-public python-testtools
1175 (package
1176 (name "python-testtools")
1177 (version "1.0.0")
1178 (source
1179 (origin
1180 (method url-fetch)
1181 (uri (string-append
1182 "https://pypi.python.org/packages/source/t/testtools/testtools-"
1183 version ".tar.gz"))
1184 (sha256
1185 (base32
1186 "1dyml28ykpl5jb9khdmcdvhy1cxqingys6qvj2k04fzlaj6z3bbx"))))
1187 (build-system python-build-system)
1188 (inputs
1189 `(("python-setuptools" ,python-setuptools)
1190 ("python-mimeparse" ,python-mimeparse)
1191 ("python-extras" ,python-extras)))
1192 (home-page "https://github.com/testing-cabal/testtools")
1193 (synopsis
1194 "Extensions to the Python standard library unit testing framework")
1195 (description
1196 "Testtools extends the Python standard library unit testing framework to
1197 provide matchers, more debugging information, and cross-Python
1198 compatibility.")
1199 (license psfl)))
1200
1201 (define-public python2-testtools
1202 (package-with-python2 python-testtools))
1203
1204 (define-public python-testscenarios
1205 (package
1206 (name "python-testscenarios")
1207 (version "0.4")
1208 (source
1209 (origin
1210 (method url-fetch)
1211 (uri (string-append
1212 "https://pypi.python.org/packages/source/t/testscenarios/testscenarios-"
1213 version ".tar.gz"))
1214 (sha256
1215 (base32
1216 "1671jvrvqlmbnc42j7pc5y6vc37q44aiwrq0zic652pxyy2fxvjg"))))
1217 (build-system python-build-system)
1218 (inputs
1219 `(("python-setuptools" ,python-setuptools)
1220 ("python-testtools" ,python-testtools)
1221 ("python-mimeparse" ,python-mimeparse)))
1222 (home-page "https://launchpad.net/testscenarios")
1223 (synopsis "Pyunit extension for dependency injection")
1224 (description
1225 "Testscenarios provides clean dependency injection for Python unittest
1226 style tests.")
1227 (license (list bsd-3 asl2.0)))) ; at the user's option
1228
1229 (define-public python2-testscenarios
1230 (package-with-python2 python-testscenarios))
1231
1232 (define-public python-testresources
1233 (package
1234 (name "python-testresources")
1235 (version "0.2.7")
1236 (source
1237 (origin
1238 (method url-fetch)
1239 (uri (string-append
1240 "https://pypi.python.org/packages/source/t/testresources/testresources-"
1241 version ".tar.gz"))
1242 (sha256
1243 (base32
1244 "0cbj3plbllyz42c4b5xxgwaa7mml54lakslrn4kkhinxhdri22md"))))
1245 (build-system python-build-system)
1246 (inputs
1247 `(("python-setuptools" ,python-setuptools)))
1248 (home-page "https://launchpad.net/testresources")
1249 (synopsis
1250 "Pyunit extension for managing test resources")
1251 (description
1252 "Testresources is an extension to Python's unittest to allow declarative
1253 use of resources by test cases.")
1254 (license (list bsd-3 asl2.0)))) ; at the user's option
1255
1256 (define-public python2-testresources
1257 (package-with-python2 python-testresources))
1258
1259 (define-public python-subunit
1260 (package
1261 (name "python-subunit")
1262 (version "0.0.21")
1263 (source
1264 (origin
1265 (method url-fetch)
1266 (uri (string-append
1267 "https://pypi.python.org/packages/source/p/python-subunit/python-subunit-"
1268 version ".tar.gz"))
1269 (sha256
1270 (base32
1271 "1nkw9wfbvizmpajbj3in8ns07g7lwkiv8hip14jjlwk3cacls6jv"))))
1272 (build-system python-build-system)
1273 (inputs
1274 `(("python-setuptools" ,python-setuptools)
1275 ("python-testtools" ,python-testtools)
1276 ("python-mimeparse" ,python-mimeparse)
1277 ("python-testscenarios" ,python-testscenarios)))
1278 (home-page "http://launchpad.net/subunit")
1279 (synopsis "Python implementation of the subunit protocol")
1280 (description
1281 "Python-subunit is a Python implementation of the subunit test streaming
1282 protocol.")
1283 (license (list bsd-3 asl2.0)))) ; at the user's option
1284
1285 (define-public python2-subunit
1286 (package-with-python2 python-subunit))
1287
1288 (define-public python-fixtures
1289 (package
1290 (name "python-fixtures")
1291 (version "0.3.16")
1292 (source
1293 (origin
1294 (method url-fetch)
1295 (uri (string-append
1296 "https://pypi.python.org/packages/source/f/fixtures/fixtures-"
1297 version ".tar.gz"))
1298 (sha256
1299 (base32
1300 "0x9r2gwilcig5g54k60bxzg96zabizq1855lrprlb4zckalp9asc"))))
1301 (build-system python-build-system)
1302 (inputs
1303 `(("python-setuptools" ,python-setuptools)))
1304 (arguments
1305 '(#:tests? #f)) ; no setup.py test command
1306 (home-page "https://launchpad.net/python-fixtures")
1307 (synopsis "Python test fixture library")
1308 (description
1309 "Fixtures provides a way to create reusable state, useful when writing
1310 Python tests.")
1311 (license (list bsd-3 asl2.0)))) ; at user's option
1312
1313 (define-public python2-fixtures
1314 (package-with-python2 python-fixtures))
1315
1316 (define-public python-testrepository
1317 (package
1318 (name "python-testrepository")
1319 (version "0.0.20")
1320 (source
1321 (origin
1322 (method url-fetch)
1323 (uri (string-append
1324 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1325 version ".tar.gz"))
1326 (sha256
1327 (base32
1328 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1329 (build-system python-build-system)
1330 (inputs
1331 `(("python-setuptools" ,python-setuptools)
1332 ("python-testtools" ,python-testtools)
1333 ("python-subunit" ,python-subunit)
1334 ("python-fixtures" ,python-fixtures)
1335 ("python-mimeparse" ,python-mimeparse)))
1336 (home-page "https://launchpad.net/testrepository")
1337 (synopsis "Database for Python test results")
1338 (description "Testrepository provides a database of test results which can
1339 be used as part of a developer's workflow to check things such as what tests
1340 have failed since the last commit or what tests are currently failing.")
1341 (license (list bsd-3 asl2.0)))) ; at user's option
1342
1343 (define-public python2-testrepository
1344 (package-with-python2 python-testrepository))
1345
1346 (define-public python-coverage
1347 (package
1348 (name "python-coverage")
1349 (version "3.7.1")
1350 (source
1351 (origin
1352 (method url-fetch)
1353 (uri (string-append
1354 "https://pypi.python.org/packages/source/c/coverage/coverage-"
1355 version ".tar.gz"))
1356 (sha256
1357 (base32
1358 "0knlbq79g2ww6xzsyknj9rirrgrgc983dpa2d9nkdf31mb2a3bni"))))
1359 (build-system python-build-system)
1360 (inputs
1361 `(("python-setuptools" ,python-setuptools)))
1362 (home-page "http://nedbatchelder.com/code/coverage")
1363 (synopsis "Code coverage measurement for Python")
1364 (description
1365 "Coverage measures code coverage, typically during test execution. It
1366 uses the code analysis tools and tracing hooks provided in the Python standard
1367 library to determine which lines are executable, and which have been
1368 executed.")
1369 (license bsd-3)))
1370
1371 (define-public python2-coverage
1372 (package-with-python2 python-coverage))
1373
1374 (define-public python-discover
1375 (package
1376 (name "python-discover")
1377 (version "0.4.0")
1378 (source
1379 (origin
1380 (method url-fetch)
1381 (uri (string-append
1382 "https://pypi.python.org/packages/source/d/discover/discover-"
1383 version ".tar.gz"))
1384 (sha256
1385 (base32
1386 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1387 (build-system python-build-system)
1388 (inputs
1389 `(("python-setuptools" ,python-setuptools)))
1390 (home-page "http://pypi.python.org/pypi/discover/")
1391 (synopsis
1392 "Python test discovery for unittest")
1393 (description
1394 "Discover provides test discovery for unittest, a feature that has been
1395 backported from Python 2.7 for Python 2.4+")
1396 (license bsd-3)))
1397
1398 (define-public python2-discover
1399 (package-with-python2 python-discover))
1400
1401 (define-public behave
1402 (package
1403 (name "behave")
1404 (version "1.2.4")
1405 (source (origin
1406 (method url-fetch)
1407 (uri (string-append "https://pypi.python.org/packages/source/b/"
1408 name "/" name "-" version ".tar.gz"))
1409 (sha256
1410 (base32
1411 "1v2rfy8xnf0rk7cj4cgr7lam4015d458i7bg0xqs9czfv6njlm14"))))
1412 (build-system python-build-system)
1413 (inputs
1414 `(("python-setuptools" ,python-setuptools)
1415 ("python-six" ,python-six)
1416 ("python-enum43" ,python-enum34)
1417 ("python-parse" ,python-parse)
1418 ("python-parse-type" ,python-parse-type)))
1419 (arguments `(#:tests? #f)) ;TODO: tests require nose>=1.3 and
1420 ;PyHamcrest>=1.8
1421 (home-page "http://github.com/behave/behave")
1422 (synopsis "Python behavior-driven development")
1423 (description
1424 "Behave is a tool for behavior-driven development in python.
1425 Behavior-driven development (or BDD) is an agile software development
1426 technique that encourages collaboration between developers, QA and
1427 non-technical or business participants in a software project. Behave uses
1428 tests written in a natural language style, backed up by Python code.")
1429 (license x11)))
1430
1431 (define-public python-exif-read
1432 (package
1433 (name "python-exif-read")
1434 (version "1.4.2")
1435 (source (origin
1436 (method url-fetch)
1437 (uri
1438 (string-append
1439 "https://pypi.python.org/packages/source/E/ExifRead/ExifRead-"
1440 version ".tar.gz"))
1441 (sha256
1442 (base32
1443 "17c627gcdmyc05hz4zk8qs4pjgw6rc68qzjzgz8gh1cmpsd7acf1"))))
1444 (build-system python-build-system)
1445 (inputs
1446 `(("python-setuptools" ,python-setuptools)))
1447 (arguments `(#:tests? #f)) ; no tests
1448 (home-page "https://github.com/ianare/exif-py")
1449 (synopsis "Python library to extract EXIF data from image files")
1450 (description
1451 "ExifRead is a Python library to extract EXIF data from tiff and jpeg
1452 files.")
1453 (license bsd-3)))
1454
1455 (define-public python2-exif-read
1456 (package-with-python2 python-exif-read))
1457
1458 (define-public python-pyld
1459 (package
1460 (name "python-pyld")
1461 (version "0.6.0")
1462 (source (origin
1463 (method url-fetch)
1464 (uri
1465 (string-append
1466 "https://pypi.python.org/packages/source/P/PyLD/PyLD-"
1467 version ".tar.gz"))
1468 (sha256
1469 (base32
1470 "1l9ymj85fsvayqplinzpk0kyiq6m74ps9xd3a9fhlxfn1rldf8x8"))))
1471 (build-system python-build-system)
1472 (inputs
1473 `(("python-setuptools" ,python-setuptools)))
1474 (arguments `(#:tests? #f)) ; no tests
1475 (home-page "http://github.com/digitalbazaar/pyld")
1476 (synopsis "Python implementation of the JSON-LD specification")
1477 (description
1478 "PyLD is an implementation of the JSON-LD specification.")
1479 (license bsd-3)))
1480
1481 (define-public python2-pyld
1482 (package-with-python2 python-pyld))
1483
1484 (define-public python-certifi
1485 (package
1486 (name "python-certifi")
1487 (version "14.05.14")
1488 (source (origin
1489 (method url-fetch)
1490 (uri
1491 (string-append
1492 "https://pypi.python.org/packages/source/c/certifi/certifi-"
1493 version ".tar.gz"))
1494 (sha256
1495 (base32
1496 "0s8vxzfz6s4m6fvxc7z25k9j35w0rh6jkw3wwcd1az1mssncn6qy"))))
1497 (build-system python-build-system)
1498 (inputs
1499 `(("python-setuptools" ,python-setuptools)))
1500 (arguments `(#:tests? #f)) ; no tests
1501 (home-page "http://python-requests.org/")
1502 (synopsis "Python CA certificate bundle")
1503 (description
1504 "Certifi is a Python library that contains a CA certificate bundle, which
1505 is used by the Requests library to verify HTTPS requests.")
1506 (license asl2.0)))
1507
1508 (define-public python2-certifi
1509 (package-with-python2 python-certifi))
1510
1511 (define-public python2-requests
1512 (package
1513 (name "python2-requests")
1514 (version "2.4.0")
1515 (source (origin
1516 (method url-fetch)
1517 (uri
1518 (string-append
1519 "https://pypi.python.org/packages/source/r/requests/requests-"
1520 version ".tar.gz"))
1521 (sha256
1522 (base32
1523 "0gknlfx1wakrrm1zi8gi03x2lzj4dsns0vjw0nsmgqvkphyf01vh"))))
1524 (build-system python-build-system)
1525 (inputs
1526 `(("python-setuptools" ,python-setuptools)
1527 ("python-certifi" ,python-certifi)))
1528 (arguments `(#:tests? #f ; no tests
1529 #:python ,python-2))
1530 (home-page "http://python-requests.org/")
1531 (synopsis "Python HTTP library")
1532 (description
1533 "Requests is a Python HTTP client library. It aims to be easier to use
1534 than Python’s urllib2 library.")
1535 (license asl2.0)))
1536
1537 (define-public python-jsonschema
1538 (package
1539 (name "python-jsonschema")
1540 (version "2.4.0")
1541 (source (origin
1542 (method url-fetch)
1543 (uri
1544 (string-append
1545 "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-"
1546 version ".tar.gz"))
1547 (sha256
1548 (base32
1549 "1yik3031ziygvq66rj3mzfqdgxj29sg1bkfc46wsgi7lnbqs560j"))))
1550 (build-system python-build-system)
1551 (inputs
1552 `(("python-setuptools" ,python-setuptools)))
1553 (home-page "http://github.com/Julian/jsonschema")
1554 (synopsis "Implementation of JSON Schema for Python")
1555 (description
1556 "Jsonschema is an implementation of JSON Schema for Python.")
1557 (license expat)))
1558
1559 (define-public python2-jsonschema
1560 (package-with-python2 python-jsonschema))
1561
1562 (define-public python-unidecode
1563 (package
1564 (name "python-unidecode")
1565 (version "0.04.16")
1566 (source (origin
1567 (method url-fetch)
1568 (uri
1569 (string-append
1570 "https://pypi.python.org/packages/source/U/Unidecode/Unidecode-"
1571 version ".tar.gz"))
1572 (sha256
1573 (base32
1574 "0yv56vc49rvippyxgxvcyz7jklc07ky38rcspax7p00sgmriiljc"))))
1575 (build-system python-build-system)
1576 (inputs
1577 `(("python-setuptools" ,python-setuptools)))
1578 (home-page "https://pypi.python.org/pypi/Unidecode")
1579 (synopsis "ASCII transliterations of Unicode text")
1580 (description
1581 "Unidecode provides ASCII transliterations of Unicode text. Unidecode is
1582 useful when integrating with legacy code that doesn't support Unicode, or for
1583 ease of entry of non-Roman names on a US keyboard, or when constructing ASCII
1584 machine identifiers from human-readable Unicode strings that should still be
1585 somewhat intelligeble.")
1586 (license gpl2+)))
1587
1588 (define-public python2-unidecode
1589 (package-with-python2 python-unidecode))
1590
1591 (define-public python-pyjwt
1592 (package
1593 (name "python-pyjwt")
1594 (version "0.2.1")
1595 (source
1596 (origin
1597 (method url-fetch)
1598 (uri (string-append
1599 "https://pypi.python.org/packages/source/P/PyJWT/PyJWT-"
1600 version ".tar.gz"))
1601 (sha256
1602 (base32
1603 "1ahqblfy2sj3xz34wsa48cn9rp0dspzq56p54i5znmws3b8gml6g"))))
1604 (build-system python-build-system)
1605 (inputs
1606 `(("python-setuptools" ,python-setuptools)))
1607 (arguments
1608 '(#:tests? #f)) ; test suite doesn't work
1609 (home-page "http://github.com/progrium/pyjwt")
1610 (synopsis "JSON Web Token implementation in Python")
1611 (description
1612 "PyJWT is a JSON Web Token implementation written in Python.")
1613 (license expat)))
1614
1615 (define-public python2-pyjwt
1616 (package-with-python2 python-pyjwt))
1617
1618 (define-public python-oauthlib
1619 (package
1620 (name "python-oauthlib")
1621 (version "0.6.3")
1622 (source (origin
1623 (method url-fetch)
1624 (uri
1625 (string-append
1626 "https://pypi.python.org/packages/source/o/oauthlib/oauthlib-"
1627 version ".tar.gz"))
1628 (sha256
1629 (base32
1630 "1yaj3j64la4arwsbhbfmpnickzh3jpg9nlpyg409v8pp24isn48a"))))
1631 (build-system python-build-system)
1632 (inputs
1633 `(("python-setuptools" ,python-setuptools)
1634 ("python-pyjwt" ,python-pyjwt)
1635 ("python-pycrypto" ,python-pycrypto)
1636 ("python-nose" ,python-nose)
1637 ("python-mock" ,python-mock)))
1638 (home-page "https://github.com/idan/oauthlib")
1639 (synopsis "OAuth implementation for Python")
1640 (description
1641 "Oauthlib is a generic, spec-compliant, thorough implementation of the
1642 OAuth request-signing logic.")
1643 (license bsd-3)))
1644
1645 (define-public python2-oauthlib
1646 (let ((base (package-with-python2 python-oauthlib)))
1647 (package
1648 (inherit base)
1649 (name "python2-oauthlib")
1650 (version "0.6.3")
1651 (source (origin
1652 (method url-fetch)
1653 (uri
1654 (string-append
1655 "https://pypi.python.org/packages/source/o/oauthlib/oauthlib-"
1656 version ".tar.gz"))
1657 (sha256
1658 (base32
1659 "1yaj3j64la4arwsbhbfmpnickzh3jpg9nlpyg409v8pp24isn48a"))))
1660 (inputs
1661 (append (package-inputs base)
1662 `(("python2-unittest2" ,python2-unittest2)))))))
1663
1664 (define-public python-itsdangerous
1665 (package
1666 (name "python-itsdangerous")
1667 (version "0.24")
1668 (source
1669 (origin
1670 (method url-fetch)
1671 (uri (string-append
1672 "https://pypi.python.org/packages/source/i/itsdangerous/itsdangerous-"
1673 version ".tar.gz"))
1674 (sha256
1675 (base32
1676 "06856q6x675ly542ig0plbqcyab6ksfzijlyf1hzhgg3sgwgrcyb"))))
1677 (build-system python-build-system)
1678 (inputs
1679 `(("python-setuptools" ,python-setuptools)))
1680 (home-page "http://github.com/mitsuhiko/itsdangerous")
1681 (synopsis "Python library for passing data to/from untrusted environments")
1682 (description
1683 "Itsdangerous provides various helpers to pass trusted data to untrusted
1684 environments and back.")
1685 (license bsd-3)))
1686
1687 (define-public python2-itsdangerous
1688 (package-with-python2 python-itsdangerous))
1689
1690 (define-public python-virtualenv
1691 (package
1692 (name "python-virtualenv")
1693 (version "1.11.6")
1694 (source
1695 (origin
1696 (method url-fetch)
1697 (uri (string-append
1698 "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-"
1699 version ".tar.gz"))
1700 (sha256
1701 (base32
1702 "1xq4prmg25n9cz5zcvbqx68lmc3kl39by582vd8pzs9f3qalqyiy"))))
1703 (build-system python-build-system)
1704 (inputs
1705 `(("python-setuptools" ,python-setuptools)
1706 ("python-mock" ,python-mock)
1707 ("python-nose" ,python-nose)))
1708 (home-page "https://virtualenv.pypa.io/")
1709 (synopsis "Virtual Python environment builder")
1710 (description
1711 "Virtualenv is a tool to create isolated Python environments.")
1712 (license expat)))
1713
1714 (define-public python2-virtualenv
1715 (package-with-python2 python-virtualenv))
1716
1717 (define-public python-markupsafe
1718 (package
1719 (name "python-markupsafe")
1720 (version "0.23")
1721 (source
1722 (origin
1723 (method url-fetch)
1724 (uri (string-append
1725 "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-"
1726 version ".tar.gz"))
1727 (sha256
1728 (base32
1729 "1hvip33wva3fnmvfp9x5klqri7hpl1hkgqmjbss18nmrb7zimv54"))))
1730 (build-system python-build-system)
1731 (inputs
1732 `(("python-setuptools" ,python-setuptools)))
1733 (home-page "http://github.com/mitsuhiko/markupsafe")
1734 (synopsis "XML/HTML/XHTML markup safe string implementation for Python")
1735 (description
1736 "Markupsafe provides an XML/HTML/XHTML markup safe string implementation
1737 for Python.")
1738 (license bsd-3)))
1739
1740 (define-public python2-markupsafe
1741 (package-with-python2 python-markupsafe))
1742
1743 (define-public python-jinja2
1744 (package
1745 (name "python-jinja2")
1746 (version "2.7.3")
1747 (source
1748 (origin
1749 (method url-fetch)
1750 (uri (string-append
1751 "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-"
1752 version ".tar.gz"))
1753 (sha256
1754 (base32
1755 "1nwg9yfqgy421lncnm63k1zf9xkd1klc0jm0fr4p3dad01fsq91f"))))
1756 (build-system python-build-system)
1757 (inputs
1758 `(("python-setuptools" ,python-setuptools)
1759 ("python-markupsafe" ,python-markupsafe)))
1760 (home-page "http://jinja.pocoo.org/")
1761 (synopsis "Python template engine")
1762 (description
1763 "Jinja2 is a small but fast and easy to use stand-alone template engine
1764 written in pure Python.")
1765 (license bsd-3)))
1766
1767 (define-public python2-jinja2
1768 (package-with-python2 python-jinja2))
1769
1770 (define-public python-docutils
1771 (package
1772 (name "python-docutils")
1773 (version "0.12")
1774 (source
1775 (origin
1776 (method url-fetch)
1777 (uri (string-append
1778 "https://pypi.python.org/packages/source/d/docutils/docutils-"
1779 version ".tar.gz"))
1780 (sha256
1781 (base32
1782 "1ylnjnw1x4b2y7blr6x35ncdzn69k253kw4cdkv6asdb21w73ny7"))))
1783 (build-system python-build-system)
1784 (inputs
1785 `(("python-setuptools" ,python-setuptools)))
1786 (arguments
1787 '(#:tests? #f)) ; no setup.py test command
1788 (home-page "http://docutils.sourceforge.net/")
1789 (synopsis "Python Documentation Utilities")
1790 (description
1791 "Docutils is a modular system for processing documentation into useful
1792 formats, such as HTML, XML, and LaTeX. For input Docutils supports
1793 reStructuredText.")
1794 ;; Most of the source code is public domain, but some source files are
1795 ;; licensed under the PFSL, BSD 2-clause, and GPLv3+ licenses.
1796 (license (list public-domain psfl bsd-2 gpl3+))))
1797
1798 (define-public python2-docutils
1799 (package-with-python2 python-docutils))
1800
1801 (define-public python-pygments
1802 (package
1803 (name "python-pygments")
1804 (version "1.6")
1805 (source
1806 (origin
1807 (method url-fetch)
1808 (uri (string-append
1809 "https://pypi.python.org/packages/source/P/Pygments/Pygments-"
1810 version ".tar.gz"))
1811 (sha256
1812 (base32
1813 "1h11r6ss8waih51vcksfvzghfxiav2f8svc0812fa5kmyz5d97kr"))))
1814 (build-system python-build-system)
1815 (inputs
1816 `(("python-setuptools" ,python-setuptools)))
1817 (home-page "http://pygments.org/")
1818 (synopsis "Syntax highlighting")
1819 (description
1820 "Pygments is a syntax highlighting package written in Python.")
1821 (license bsd-2)))
1822
1823 (define-public python2-pygments
1824 (package-with-python2 python-pygments))
1825
1826 (define-public python-sphinx
1827 (package
1828 (name "python-sphinx")
1829 (version "1.2.3")
1830 (source
1831 (origin
1832 (method url-fetch)
1833 (uri (string-append
1834 "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-"
1835 version ".tar.gz"))
1836 (sha256
1837 (base32
1838 "011xizm3jnmf4cvs5i6kgf6c5nn046h79i8j0vd0f27yw9j3p4wl"))))
1839 (build-system python-build-system)
1840 (inputs
1841 `(("python-setuptools" ,python-setuptools)
1842 ("python-jinja2" ,python-jinja2)
1843 ("python-docutils" ,python-docutils)
1844 ("python-pygments" ,python-pygments)))
1845 (home-page "http://sphinx-doc.org/")
1846 (synopsis "Python documentation generator")
1847 (description "Sphinx is a tool that makes it easy to create documentation
1848 for Python projects or other documents consisting of multiple reStructuredText
1849 sources.")
1850 (license bsd-3)))
1851
1852 (define-public python2-sphinx
1853 (package-with-python2 python-sphinx))
1854
1855 (define-public python-cython
1856 (package
1857 (name "python-cython")
1858 (version "0.21.1")
1859 (source
1860 (origin
1861 (method url-fetch)
1862 (uri (string-append "http://cython.org/release/Cython-"
1863 version ".tar.gz"))
1864 (sha256
1865 (base32
1866 "0ddz2l2dvcy5hdkxx4xlfiwpccvwia7ixgcy4h0pdv46a4i4vxj3"))))
1867 (build-system python-build-system)
1868 ;; we need the full python package and not just the python-wrapper
1869 ;; because we need libpython3.3m.so
1870 (inputs
1871 `(("python" ,python)))
1872 (arguments
1873 `(#:phases
1874 (alist-cons-before
1875 'check 'set-HOME
1876 ;; some tests require access to "$HOME/.cython"
1877 (lambda* _ (setenv "HOME" "/tmp"))
1878 (alist-replace
1879 'check
1880 (lambda _ (zero? (system* "python" "runtests.py" "-vv")))
1881 %standard-phases))))
1882 (home-page "http://cython.org/")
1883 (synopsis "C extensions for Python")
1884 (description "Cython is an optimising static compiler for both the Python
1885 programming language and the extended Cython programming language. It makes
1886 writing C extensions for Python as easy as Python itself.")
1887 (license asl2.0)))
1888
1889 (define-public python2-cython
1890 (package (inherit (package-with-python2 python-cython))
1891 (name "python2-cython")
1892 (inputs
1893 `(("python-2" ,python-2))))) ; this is not automatically changed
1894
1895 ;; This version of numpy is missing the documentation and is only used to
1896 ;; build matplotlib which is required to build numpy's documentation.
1897 (define python-numpy-bootstrap
1898 (package
1899 (name "python-numpy-bootstrap")
1900 (version "1.9.1")
1901 (source
1902 (origin
1903 (method url-fetch)
1904 (uri (string-append "mirror://sourceforge/numpy"
1905 "/numpy-" version ".tar.gz"))
1906 (sha256
1907 (base32
1908 "070ybfvpgfmiz2hs94x445hvkh9dh52nyi0m8jp5kdihgvhbnx80"))))
1909 (build-system python-build-system)
1910 (inputs
1911 `(("python-nose" ,python-nose)
1912 ("atlas" ,atlas)))
1913 (native-inputs
1914 `(("gfortran" ,gfortran-4.8)))
1915 (arguments
1916 `(#:phases
1917 (alist-cons-before
1918 'build 'set-environment-variables
1919 (lambda* (#:key inputs #:allow-other-keys)
1920 (let* ((atlas-threaded
1921 (string-append (assoc-ref inputs "atlas")
1922 "/lib/libtatlas.so"))
1923 ;; On single core CPUs only the serial library is created.
1924 (atlas-lib
1925 (if (file-exists? atlas-threaded)
1926 atlas-threaded
1927 (string-append (assoc-ref inputs "atlas")
1928 "/lib/libsatlas.so"))))
1929 (setenv "ATLAS" atlas-lib)))
1930 ;; Tests can only be run after the library has been installed and not
1931 ;; within the source directory.
1932 (alist-cons-after
1933 'install 'check
1934 (lambda _
1935 (with-directory-excursion "/tmp"
1936 (zero? (system* "python" "-c" "import numpy; numpy.test()"))))
1937 (alist-delete
1938 'check
1939 %standard-phases)))))
1940 (home-page "http://www.numpy.org/")
1941 (synopsis "Fundamental package for scientific computing with Python")
1942 (description "NumPy is the fundamental package for scientific computing
1943 with Python. It contains among other things: a powerful N-dimensional array
1944 object, sophisticated (broadcasting) functions, tools for integrating C/C++
1945 and Fortran code, useful linear algebra, Fourier transform, and random number
1946 capabilities.")
1947 (license bsd-3)))
1948
1949 (define python2-numpy-bootstrap
1950 (package-with-python2 python-numpy-bootstrap))
1951
1952 (define-public python-numpy
1953 (package (inherit python-numpy-bootstrap)
1954 (name "python-numpy")
1955 (outputs '("out" "doc"))
1956 (inputs
1957 `(("which" ,which)
1958 ("python-setuptools" ,python-setuptools)
1959 ("python-matplotlib" ,python-matplotlib)
1960 ("python-sphinx" ,python-sphinx)
1961 ("python-pyparsing" ,python-pyparsing)
1962 ("python-numpydoc" ,python-numpydoc)
1963 ,@(package-inputs python-numpy-bootstrap)))
1964 (native-inputs
1965 `(("pkg-config" ,pkg-config)
1966 ("texlive" ,texlive)
1967 ("texinfo" ,texinfo)
1968 ("perl" ,perl)
1969 ,@(package-native-inputs python-numpy-bootstrap)))
1970 (arguments
1971 `(,@(substitute-keyword-arguments
1972 (package-arguments python-numpy-bootstrap)
1973 ((#:phases phases)
1974 `(alist-cons-after
1975 'install 'install-doc
1976 (lambda* (#:key outputs #:allow-other-keys)
1977 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
1978 (doc (string-append
1979 data "/doc/" ,name "-"
1980 ,(package-version python-numpy-bootstrap)))
1981 (info (string-append data "/info"))
1982 (html (string-append doc "/html"))
1983 (pyver ,(string-append "PYVER=")))
1984 (with-directory-excursion "doc"
1985 (mkdir-p html)
1986 (system* "make" "html" pyver)
1987 (system* "make" "latex" "PAPER=a4" pyver)
1988 (system* "make" "-C" "build/latex"
1989 "all-pdf" "PAPER=a4" pyver)
1990 ;; FIXME: Generation of the info file fails.
1991 ;; (system* "make" "info" pyver)
1992 ;; (mkdir-p info)
1993 ;; (copy-file "build/texinfo/numpy.info"
1994 ;; (string-append info "/numpy.info"))
1995 (for-each (lambda (file)
1996 (copy-file (string-append "build/latex" file)
1997 (string-append doc file)))
1998 '("/numpy-ref.pdf" "/numpy-user.pdf"))
1999 (with-directory-excursion "build/html"
2000 (for-each (lambda (file)
2001 (let* ((dir (dirname file))
2002 (tgt-dir (string-append html "/" dir)))
2003 (unless (equal? "." dir)
2004 (mkdir-p tgt-dir))
2005 (copy-file file (string-append html "/" file))))
2006 (find-files "." ".*"))))))
2007 ,phases)))))))
2008
2009 (define-public python2-numpy
2010 (let ((numpy (package-with-python2 python-numpy)))
2011 (package (inherit numpy)
2012 ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is customized for
2013 ;; Python 2. Since it is also an input to PYTHON2-MATPLOTLIB, we need to
2014 ;; import the right version of 'matplotlib' as well.
2015 (inputs `(("python2-numpydoc" ,python2-numpydoc)
2016 ("python2-matplotlib" ,python2-matplotlib)
2017 ,@(alist-delete "python-numpydoc"
2018 (alist-delete "python-matplotlib"
2019 (package-inputs numpy))))))))
2020
2021 (define-public python-pyparsing
2022 (package
2023 (name "python-pyparsing")
2024 (version "2.0.2")
2025 (source
2026 (origin
2027 (method url-fetch)
2028 (uri (string-append "mirror://sourceforge/pyparsing"
2029 "/pyparsing-" version ".tar.gz"))
2030 (sha256
2031 (base32
2032 "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p"))))
2033 (build-system python-build-system)
2034 (outputs '("out" "doc"))
2035 (arguments
2036 `(#:tests? #f ; no test target
2037 #:modules ((guix build python-build-system)
2038 (guix build utils))
2039 #:phases
2040 (alist-cons-after
2041 'install 'install-doc
2042 (lambda* (#:key outputs #:allow-other-keys)
2043 (let* ((doc (string-append (assoc-ref outputs "doc")
2044 "/share/doc/" ,name "-" ,version))
2045 (html-doc (string-append doc "/html"))
2046 (examples (string-append doc "/examples")))
2047 (mkdir-p html-doc)
2048 (mkdir-p examples)
2049 (for-each
2050 (lambda (dir tgt)
2051 (map (lambda (file)
2052 (copy-file file (string-append tgt "/" (basename file))))
2053 (find-files dir ".*")))
2054 (list "docs" "htmldoc" "examples")
2055 (list doc html-doc examples))))
2056 %standard-phases)))
2057 (home-page "http://pyparsing.wikispaces.com")
2058 (synopsis "Python parsing class library")
2059 (description
2060 "The pyparsing module is an alternative approach to creating and
2061 executing simple grammars, vs. the traditional lex/yacc approach, or the use
2062 of regular expressions. The pyparsing module provides a library of classes
2063 that client code uses to construct the grammar directly in Python code.")
2064 (license expat)))
2065
2066 (define-public python2-pyparsing
2067 (package-with-python2 python-pyparsing))
2068
2069 (define-public python-numpydoc
2070 (package
2071 (name "python-numpydoc")
2072 (version "0.5")
2073 (source
2074 (origin
2075 (method url-fetch)
2076 (uri (string-append
2077 "https://pypi.python.org/packages/source/n/numpydoc/numpydoc-"
2078 version ".tar.gz"))
2079 (sha256
2080 (base32
2081 "0d4dnifaxkll50jx6czj05y8cb4ny60njd2wz299sj2jxfy51w4k"))))
2082 (build-system python-build-system)
2083 (inputs
2084 `(("python-setuptools" ,python-setuptools)
2085 ("python-docutils" ,python-docutils)
2086 ("python-sphinx" ,python-sphinx)
2087 ("python-nose" ,python-nose)))
2088 (home-page "https://pypi.python.org/pypi/numpydoc")
2089 (synopsis
2090 "Numpy's Sphinx extensions")
2091 (description
2092 "Sphinx extension to support docstrings in Numpy format.")
2093 (license bsd-2)))
2094
2095 (define-public python2-numpydoc
2096 (package
2097 (inherit (package-with-python2 python-numpydoc))
2098 ;; With python-2 1 test (out of 30) fails because it doesn't find
2099 ;; matplotlib. With python-3 it seems to detect at run-time the absence
2100 ;; of matplotlib.
2101 (arguments `(#:tests? #f
2102 #:python ,python-2))))
2103
2104 (define-public python-matplotlib
2105 (package
2106 (name "python-matplotlib")
2107 (version "1.4.2")
2108 (source
2109 (origin
2110 (method url-fetch)
2111 (uri (string-append "mirror://sourceforge/matplotlib"
2112 "/matplotlib-" version ".tar.gz"))
2113 (sha256
2114 (base32
2115 "0m6v9nwdldlwk22gcd339zg6mny5m301fxgks7z8sb8m9wawg8qp"))))
2116 (build-system python-build-system)
2117 (outputs '("out" "doc"))
2118 (inputs
2119 `(("python-setuptools" ,python-setuptools)
2120 ("python-dateutil" ,python-dateutil-2)
2121 ("python-pyparsing" ,python-pyparsing)
2122 ("python-six" ,python-six)
2123 ("python-pytz" ,python-pytz)
2124 ("python-numpy" ,python-numpy-bootstrap)
2125 ("python-sphinx" ,python-sphinx)
2126 ("python-numpydoc" ,python-numpydoc)
2127 ("python-nose" ,python-nose)
2128 ("python-mock" ,python-mock)
2129 ("libpng" ,libpng)
2130 ("imagemagick" ,imagemagick)
2131 ("freetype" ,freetype)
2132 ;; FIXME: Add backends when available.
2133 ;("python-pygtk" ,python-pygtk)
2134 ;("python-pycairo" ,python-pycairo)
2135 ;("python-pygobject" ,python-pygobject)
2136 ;("python-wxpython" ,python-wxpython)
2137 ;("python-pyqt" ,python-pyqt)
2138 ))
2139 (native-inputs
2140 `(("pkg-config" ,pkg-config)
2141 ("texlive" ,texlive)
2142 ("texinfo" ,texinfo)))
2143 (arguments
2144 `(#:phases
2145 (alist-cons-after
2146 'install 'install-doc
2147 (lambda* (#:key outputs #:allow-other-keys)
2148 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2149 (doc (string-append data "/doc/" ,name "-" ,version))
2150 (info (string-append data "/info"))
2151 (html (string-append doc "/html")))
2152 (with-directory-excursion "doc"
2153 ;; Without setting this variable we get an encoding error.
2154 (setenv "LANG" "en_US.UTF-8")
2155 ;; Produce pdf in 'A4' format.
2156 (substitute* (find-files "." "conf\\.py")
2157 (("latex_paper_size = 'letter'")
2158 "latex_paper_size = 'a4'"))
2159 (mkdir-p html)
2160 (mkdir-p info)
2161 ;; The doc recommends to run the 'html' target twice.
2162 (system* "python" "make.py" "html")
2163 (system* "python" "make.py" "html")
2164 (system* "python" "make.py" "latex")
2165 (system* "python" "make.py" "texinfo")
2166 (copy-file "build/texinfo/matplotlib.info"
2167 (string-append info "/matplotlib.info"))
2168 (copy-file "build/latex/Matplotlib.pdf"
2169 (string-append doc "/Matplotlib.pdf"))
2170 (with-directory-excursion "build/html"
2171 (map (lambda (file)
2172 (let* ((dir (dirname file))
2173 (tgt-dir (string-append html "/" dir)))
2174 (unless (equal? "." dir)
2175 (mkdir-p tgt-dir))
2176 (copy-file file (string-append html "/" file))))
2177 (find-files "." ".*"))))))
2178 %standard-phases)))
2179 (home-page "http://matplotlib.org")
2180 (synopsis "2D plotting library for Python")
2181 (description
2182 "Matplotlib is a Python 2D plotting library which produces publication
2183 quality figures in a variety of hardcopy formats and interactive environments
2184 across platforms. Matplotlib can be used in Python scripts, the python and
2185 ipython shell, web application servers, and six graphical user interface
2186 toolkits.")
2187 (license psfl)))
2188
2189 (define-public python2-matplotlib
2190 (let ((matplotlib (package-with-python2 python-matplotlib)))
2191 (package (inherit matplotlib)
2192 ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is
2193 ;; customized for Python 2.
2194 (inputs `(("python2-numpydoc" ,python2-numpydoc)
2195 ,@(alist-delete "python-numpydoc"
2196 (package-inputs matplotlib)))))))
2197
2198 (define-public python-sqlalchemy
2199 (package
2200 (name "python-sqlalchemy")
2201 (version "0.9.7")
2202 (source
2203 (origin
2204 (method url-fetch)
2205 (uri (string-append "https://pypi.python.org/packages/source/S/"
2206 "SQLAlchemy/SQLAlchemy-" version ".tar.gz"))
2207 (sha256
2208 (base32
2209 "059ayifj5l08v6vv56anhyibyllscn10dlzr2fcw68gz1hfjdzsz"))))
2210 (build-system python-build-system)
2211 (native-inputs
2212 `(("python-cython" ,python-cython) ;for c extensions
2213 ("python-pytest" ,python-pytest)
2214 ("python-mock" ,python-mock))) ;for tests
2215 (arguments
2216 `(#:phases (alist-replace
2217 'check
2218 (lambda _ (zero? (system* "py.test")))
2219 %standard-phases)))
2220 (home-page "http://www.sqlalchemy.org")
2221 (synopsis "Database abstraction library")
2222 (description
2223 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2224 gives application developers the full power and flexibility of SQL. It
2225 provides a full suite of well known enterprise-level persistence patterns,
2226 designed for efficient and high-performing database access, adapted into a
2227 simple and Pythonic domain language.")
2228 (license x11)))
2229
2230 (define-public python2-sqlalchemy
2231 (package-with-python2 python-sqlalchemy))
2232
2233 (define-public python-pillow
2234 (package
2235 (name "python-pillow")
2236 (version "2.6.1")
2237 (source
2238 (origin
2239 (method url-fetch)
2240 (uri (string-append "https://pypi.python.org/packages/source/P/"
2241 "Pillow/Pillow-" version ".tar.gz"))
2242 (sha256
2243 (base32
2244 "0iw36c73wkhz88wa78v6l43llsb080ihw8yq7adhfqxdib7l4hzr"))))
2245 (build-system python-build-system)
2246 (native-inputs
2247 `(("python-setuptools" ,python-setuptools)
2248 ("python-nose" ,python-nose)))
2249 (inputs
2250 `(("lcms" ,lcms)
2251 ("zlib" ,zlib)
2252 ("libjpeg" ,libjpeg)
2253 ("openjpeg" ,openjpeg)
2254 ("libtiff" ,libtiff)))
2255 (propagated-inputs
2256 `(;; Used at runtime for pkg_resources
2257 ("python-setuptools" ,python-setuptools)))
2258 (arguments
2259 `(#:phases (alist-cons-after
2260 'install 'check-installed
2261 (lambda _
2262 (begin
2263 (setenv "HOME" (getcwd))
2264 (and (zero? (system* "python" "selftest.py" "--installed"))
2265 (zero? (system* "python" "test-installed.py")))))
2266 (alist-delete 'check %standard-phases))))
2267 (home-page "https://pypi.python.org/pypi/Pillow")
2268 (synopsis "Fork of the Python Imaging Library")
2269 (description
2270 "The Python Imaging Library adds image processing capabilities to your
2271 Python interpreter. This library provides extensive file format support, an
2272 efficient internal representation, and fairly powerful image processing
2273 capabilities. The core image library is designed for fast access to data
2274 stored in a few basic pixel formats. It should provide a solid foundation for
2275 a general image processing tool.")
2276 (license (x11-style
2277 "http://www.pythonware.com/products/pil/license.htm"
2278 "The PIL Software License"))))
2279
2280 (define-public python2-pillow
2281 (package-with-python2 python-pillow))