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