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