gnu: Add python-jsonschema.
[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>
af807dea 4;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
32d5c729 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
a480bc41 6;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
a01b6da7
NK
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
1ffa7090 23(define-module (gnu packages python)
011b18c3 24 #:use-module ((guix licenses)
cafc3f5a
EB
25 #:select (asl2.0 bsd-3 bsd-style cc0 expat x11 x11-style
26 gpl2 gpl2+ lgpl2.1+
27 psfl public-domain))
1d08c01f 28 #:use-module ((guix licenses) #:select (zlib)
ed0cdf83 29 #:renamer (symbol-prefix-proc 'license:))
3fdc99da 30 #:use-module (gnu packages)
1ffa7090 31 #:use-module (gnu packages compression)
3fdc99da 32 #:use-module (gnu packages gdbm)
421a80a2 33 #:use-module (gnu packages icu4c)
b10ab723 34 #:use-module (gnu packages libffi)
3fdc99da 35 #:use-module (gnu packages readline)
1ffa7090 36 #:use-module (gnu packages openssl)
3e778ad3 37 #:use-module (gnu packages elf)
b10ab723 38 #:use-module (gnu packages pkg-config)
1d08c01f 39 #:use-module (gnu packages sqlite)
3a100e79 40 #:use-module (gnu packages zip)
cafc3f5a 41 #:use-module (gnu packages multiprecision)
a01b6da7
NK
42 #:use-module (guix packages)
43 #:use-module (guix download)
11bb85a1 44 #:use-module (guix utils)
acc26ff1 45 #:use-module (guix build-system gnu)
898238b9
AE
46 #:use-module (guix build-system python)
47 #:use-module (guix build-system trivial))
a01b6da7 48
b24d1cfc 49(define-public python-2
a01b6da7
NK
50 (package
51 (name "python")
ee2b5109 52 (version "2.7.6")
a01b6da7
NK
53 (source
54 (origin
55 (method url-fetch)
9b43a0ff 56 (uri (string-append "https://www.python.org/ftp/python/"
a01b6da7 57 version "/Python-" version ".tar.xz"))
32d5c729
MW
58 (patches (list (search-patch "python-libffi-mips-n32-fix.patch")))
59 (patch-flags '("-p0"))
a01b6da7
NK
60 (sha256
61 (base32
ee2b5109 62 "18gnpyh071dxa0rv3silrz92jw9qpblswzwv4gzqcwxzz20qxmhz"))))
a01b6da7 63 (build-system gnu-build-system)
3fdc99da 64 (arguments
af807dea
AE
65 `(#:tests? #f
66;; 258 tests OK.
67;; 103 tests failed:
68;; test_bz2 test_distutils test_file test_file2k test_popen2
69;; test_shutil test_signal test_site test_slice test_smtplib
70;; test_smtpnet test_socket test_socketserver test_softspace
71;; test_sort test_sqlite test_ssl test_startfile test_str
72;; test_strftime test_string test_stringprep test_strop test_strptime
73;; test_strtod test_struct test_structmembers test_structseq
74;; test_subprocess test_sunaudiodev test_sundry test_symtable
75;; test_syntax test_sys test_sys_setprofile test_sys_settrace
76;; test_sysconfig test_tarfile test_tcl test_telnetlib test_tempfile
77;; test_textwrap test_thread test_threaded_import
78;; test_threadedtempfile test_threading test_threading_local
79;; test_threadsignals test_time test_timeout test_tk test_tokenize
80;; test_tools test_trace test_traceback test_transformer
81;; test_ttk_guionly test_ttk_textonly test_tuple test_typechecks
82;; test_ucn test_unary test_undocumented_details test_unicode
83;; test_unicode_file test_unicodedata test_univnewlines
84;; test_univnewlines2k test_unpack test_urllib test_urllib2
85;; test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse
86;; test_userdict test_userlist test_userstring test_uu test_uuid
87;; test_wait3 test_wait4 test_warnings test_wave test_weakref
88;; test_weakset test_whichdb test_winreg test_winsound test_with
89;; test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c
90;; test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile
91;; test_zipfile64 test_zipimport test_zipimport_support test_zlib
92;; 31 tests skipped:
93;; test_aepack test_al test_applesingle test_ascii_formatd test_bsddb
94;; test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn
95;; test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
96;; test_codecmaps_tw test_ctypes test_curses test_dl test_gdb test_gl
97;; test_imageop test_imgfile test_ioctl test_kqueue
98;; test_linuxaudiodev test_macos test_macostools test_msilib
99;; test_multiprocessing test_ossaudiodev test_pep277
100;; test_scriptpackages
101;; 7 skips unexpected on linux2:
102;; test_ascii_formatd test_bsddb test_bsddb3 test_ctypes test_gdb
103;; test_ioctl test_multiprocessing
104;; One of the typical errors:
105;; test_unicode
106;; test test_unicode crashed -- <type 'exceptions.OSError'>: [Errno 2] No such file or directory
107 #:test-target "test"
3fdc99da
CR
108 #:configure-flags
109 (let ((bz2 (assoc-ref %build-inputs "bzip2"))
110 (gdbm (assoc-ref %build-inputs "gdbm"))
b10ab723 111 (libffi (assoc-ref %build-inputs "libffi"))
3fdc99da
CR
112 (openssl (assoc-ref %build-inputs "openssl"))
113 (readline (assoc-ref %build-inputs "readline"))
114 (zlib (assoc-ref %build-inputs "zlib")))
fd982732 115 (list "--enable-shared" ; allow embedding
b10ab723 116 "--with-system-ffi" ; build ctypes
fd982732 117 (string-append "CPPFLAGS="
3fdc99da
CR
118 "-I" bz2 "/include "
119 "-I" gdbm "/include "
120 "-I" openssl "/include "
121 "-I" readline "/include "
122 "-I" zlib "/include")
123 (string-append "LDFLAGS="
124 "-L" bz2 "/lib "
125 "-L" gdbm "/lib "
b10ab723 126 "-L" libffi "/lib "
3fdc99da
CR
127 "-L" openssl "/lib "
128 "-L" readline "/lib "
fd982732
LC
129 "-L" zlib "/lib")))
130
131 #:modules ((guix build gnu-build-system)
132 (guix build utils)
3309e3a1 133 (guix build rpath)
fd982732 134 (srfi srfi-26))
3309e3a1
LC
135 #:imported-modules ((guix build gnu-build-system)
136 (guix build utils)
137 (guix build rpath))
fd982732
LC
138
139 #:phases
140 (alist-cons-after
141 'strip 'add-lib-to-runpath
142 (lambda* (#:key outputs #:allow-other-keys)
fd982732
LC
143 (let* ((out (assoc-ref outputs "out"))
144 (lib (string-append out "/lib")))
145 ;; Add LIB to the RUNPATH of all the executables.
146 (with-directory-excursion out
147 (for-each (cut augment-rpath <> lib)
148 (find-files "bin" ".*")))))
d4bf49b1
EB
149 (alist-cons-before
150 'configure 'patch-lib-shells
151 (lambda _
bb184d98
EB
152 ;; Filter for existing files, since some may not exist in all
153 ;; versions of python that are built with this recipe.
154 (substitute* (filter file-exists?
155 '("Lib/subprocess.py"
156 "Lib/popen2.py"
157 "Lib/distutils/tests/test_spawn.py"
158 "Lib/test/test_subprocess.py"))
d4bf49b1 159 (("/bin/sh") (which "sh"))))
9a9a3adf
CR
160 (alist-cons-before
161 'check 'pre-check
162 (lambda _
163 ;; 'Lib/test/test_site.py' needs a valid $HOME
164 (setenv "HOME" (getcwd)))
165 %standard-phases)))))
a01b6da7 166 (inputs
3fdc99da
CR
167 `(("bzip2" ,bzip2)
168 ("gdbm" ,gdbm)
b10ab723 169 ("libffi" ,libffi) ; for ctypes
a01b6da7 170 ("openssl" ,openssl)
3fdc99da 171 ("readline" ,readline)
fd982732 172 ("zlib" ,zlib)
3309e3a1 173 ("patchelf" ,patchelf))) ; for (guix build rpath)
b10ab723
CR
174 (native-inputs
175 `(("pkg-config" ,pkg-config)))
9be8d7c8
LC
176 (native-search-paths
177 (list (search-path-specification
178 (variable "PYTHONPATH")
179 (directories '("lib/python2.7/site-packages")))))
a01b6da7
NK
180 (home-page "http://python.org")
181 (synopsis
182 "Python, a high-level dynamically-typed programming language")
183 (description
184 "Python is a remarkably powerful dynamic programming language that
185is used in a wide variety of application domains. Some of its key
186distinguishing features include: clear, readable syntax; strong
187introspection capabilities; intuitive object orientation; natural
188expression of procedural code; full modularity, supporting hierarchical
189packages; exception-based error handling; and very high level dynamic
190data types.")
191 (license psfl)))
acc26ff1 192
b24d1cfc
AE
193(define-public python
194 (package (inherit python-2)
717003e3
LC
195 (version "3.3.5")
196 (source (origin
197 (method url-fetch)
198 (uri (string-append "https://www.python.org/ftp/python/"
199 version "/Python-" version ".tar.xz"))
32d5c729
MW
200 (patches (list (search-patch "python-fix-tests.patch")
201 (search-patch "python-libffi-mips-n32-fix.patch")))
717003e3
LC
202 (patch-flags '("-p0"))
203 (sha256
204 (base32
205 "1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb"))))
9a9a3adf
CR
206 (arguments
207 (let ((args `(#:modules ((guix build gnu-build-system)
208 (guix build utils)
209 (srfi srfi-1)
210 (srfi srfi-26))
211 ,@(package-arguments python-2))))
212 (substitute-keyword-arguments args
213 ((#:tests? _) #t))))
1aebc0cb
AE
214 (native-search-paths
215 (list (search-path-specification
216 (variable "PYTHONPATH")
217 (directories '("lib/python3.3/site-packages")))))))
f26a77ff 218
898238b9
AE
219(define-public python-wrapper
220 (package (inherit python)
221 (name "python-wrapper")
222 (source #f)
223 (build-system trivial-build-system)
224 (inputs `(("python" ,python)))
225 (arguments
226 `(#:modules ((guix build utils))
227 #:builder
228 (begin
229 (use-modules (guix build utils))
230 (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
231 (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
232 (mkdir-p bin)
233 (for-each
234 (lambda (old new)
235 (symlink (string-append python old)
236 (string-append bin "/" new)))
237 `("python3", "pydoc3", "idle3")
238 `("python", "pydoc", "idle"))))))
239 (description (string-append (package-description python)
240 "\n\nThis wrapper package provides symbolic links to the python binaries
241 without version suffix."))))
242
243
89114f39 244(define-public python-pytz
acc26ff1 245 (package
89114f39 246 (name "python-pytz")
acc26ff1
CR
247 (version "2013b")
248 (source
249 (origin
250 (method url-fetch)
251 (uri (string-append "https://launchpad.net/pytz/main/" version
252 "/+download/pytz-" version ".tar.bz2"))
253 (sha256
254 (base32
255 "19giwgfcrg0nr1gdv49qnmf2jb2ilkcfc7qyqvfpz4dp0p64ksv5"))))
256 (build-system python-build-system)
8498b8cf 257 (arguments `(#:tests? #f)) ; no test target
acc26ff1
CR
258 (home-page "https://launchpad.net/pytz")
259 (synopsis "The Python timezone library.")
260 (description
261 "This library allows accurate and cross platform timezone calculations
262using Python 2.4 or higher and provides access to the Olson timezone database.")
263 (license x11)))
5ace6e2f 264
89114f39 265(define-public python2-pytz
11bb85a1 266 (package-with-python2 python-pytz))
89114f39 267
fc50e9c6 268
89114f39 269(define-public python-babel
5ace6e2f 270 (package
89114f39 271 (name "python-babel")
e1804763 272 (version "1.3")
5ace6e2f
CR
273 (source
274 (origin
275 (method url-fetch)
e1804763 276 (uri (string-append "https://pypi.python.org/packages/source/B/Babel/Babel-"
5ace6e2f
CR
277 version ".tar.gz"))
278 (sha256
279 (base32
e1804763 280 "0bnin777lc53nxd1hp3apq410jj5wx92n08h7h4izpl4f4sx00lz"))))
5ace6e2f
CR
281 (build-system python-build-system)
282 (inputs
e1804763
AE
283 `(("python-pytz" ,python-pytz)
284 ("python-setuptools" ,python-setuptools)))
8498b8cf 285 (arguments `(#:tests? #f)) ; no test target
e1804763 286 (home-page "http://babel.pocoo.org/")
5ace6e2f
CR
287 (synopsis
288 "Tools for internationalizing Python applications")
289 (description
290 "Babel is composed of two major parts:
291- tools to build and work with gettext message catalogs
292- a Python interface to the CLDR (Common Locale Data Repository), providing
293access to various locale display names, localized number and date formatting,
294etc. ")
295 (license bsd-3)))
89114f39
AE
296
297(define-public python2-babel
11bb85a1 298 (package-with-python2 python-babel))
73adf220 299
c1448c69
EB
300(define-public python-lockfile
301 (package
302 (name "python-lockfile")
303 (version "0.9.1")
304 (source
305 (origin
306 (method url-fetch)
307 (uri (string-append "https://pypi.python.org/packages/source/l/lockfile/"
308 "lockfile-" version ".tar.gz"))
309 (sha256
310 (base32
311 "0iwif7i84gwpvrnpv4brshdk8j6l77smvknm8k3bg77mj6f5ini3"))))
312 (build-system python-build-system)
313 (arguments '(#:test-target "check"))
314 (home-page "http://code.google.com/p/pylockfile/")
315 (synopsis "Platform-independent file locking module")
316 (description
317 "The lockfile package exports a LockFile class which provides a simple
318API for locking files.")
319 (license expat)))
320
321(define-public python2-lockfile
322 (package-with-python2 python-lockfile))
323
5a1a4bf6
EB
324(define-public python-mock
325 (package
326 (name "python-mock")
327 (version "1.0.1")
328 (source
329 (origin
330 (method url-fetch)
331 (uri (string-append "https://pypi.python.org/packages/source/m/mock/"
332 "mock-" version ".tar.gz"))
333 (sha256
334 (base32
335 "0kzlsbki6q0awf89rc287f3aj8x431lrajf160a70z0ikhnxsfdq"))))
336 (build-system python-build-system)
337 (arguments '(#:test-target "check"))
338 (home-page "http://code.google.com/m/mock/")
339 (synopsis "A Python Mocking and Patching Library for Testing")
340 (description
341 "Mock is a library for testing in Python. It allows you to replace parts
342of your system under test with mock objects and make assertions about how they
343have been used.")
344 (license expat)))
345
346(define-public python2-mock
347 (package-with-python2 python-mock))
348
fc50e9c6 349
73adf220
AE
350(define-public python-setuptools
351 (package
352 (name "python-setuptools")
353 (version "1.1.4")
354 (source
355 (origin
356 (method url-fetch)
357 (uri (string-append "https://pypi.python.org/packages/source/s/setuptools/setuptools-"
358 version ".tar.gz"))
359 (sha256
360 (base32
361 "0hl9sa5xr9bi2ifq51wy1bawsjv5nzvpbac7m9z1ciz778874csf"))))
362 (build-system python-build-system)
363 (arguments
824af8ca 364 `(#:tests? #f))
73adf220
AE
365 ;;FIXME: test_sdist_with_utf8_encoded_filename fails in
366 ;; /tmp/nix-build-python2-setuptools-1.1.4.drv-0/setuptools-1.1.4/setuptools/tests/test_sdist.py"
367 ;; line 354
368 ;; The tests pass with Python 2.7.5.
73adf220
AE
369 (home-page "https://pypi.python.org/pypi/setuptools")
370 (synopsis
371 "Library designed to facilitate packaging Python projects")
372 (description
373 "Setuptools is a fully-featured, stable library designed to facilitate
374packaging Python projects, where packaging includes:
375Python package and module definitions,
376distribution package metadata,
377test hooks,
378project installation,
379platform-specific details,
380Python 3 support.")
381 (license psfl)))
382
383(define-public python2-setuptools
384 (package-with-python2 python-setuptools))
fc50e9c6
AE
385
386
cafc3f5a
EB
387(define-public python-pycrypto
388 (package
389 (name "python-pycrypto")
390 (version "2.6.1")
391 (source
392 (origin
393 (method url-fetch)
394 (uri (string-append "https://pypi.python.org/packages/source/p/"
395 "pycrypto/pycrypto-" version ".tar.gz"))
396 (sha256
397 (base32
398 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
399 (build-system python-build-system)
400 (native-inputs
401 `(("python-setuptools" ,python-setuptools)))
402 (inputs
403 `(("python" ,python)
404 ("gmp" ,gmp)))
405 (arguments
406 `(#:phases
407 (alist-cons-before
408 'build 'set-build-env
409 ;; pycrypto runs an autoconf configure script behind the scenes
410 (lambda _
411 (setenv "CONFIG_SHELL" (which "bash")))
412 %standard-phases)))
413 (home-page "http://www.pycrypto.org/")
414 (synopsis "Cryptographic modules for Python")
415 (description
416 "Pycrypto is a collection of both secure hash functions (such as SHA256
417and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
418etc.). The package is structured to make adding new modules easy.")
419 (license public-domain)))
420
421(define-public python-keyring
422 (package
423 (name "python-keyring")
424 (version "3.8")
425 (source
426 (origin
427 (method url-fetch)
428 (uri (string-append "https://pypi.python.org/packages/source/k/"
429 "keyring/keyring-" version ".zip"))
430 (sha256
431 (base32
432 "1vxazfbcwggyfyramh55shkxs08skhpqrkm6lrrjnygnm8c1l2zg"))))
433 (build-system python-build-system)
434 (native-inputs
435 `(("unzip" ,unzip)
436 ("python-setuptools" ,python-setuptools)
437 ("python-mock" ,python-mock)))
438 (inputs
439 `(("python-pycrypto" ,python-pycrypto)))
440 (arguments
441 `(#:tests? #f ;TODO: tests require pytest
442 #:phases
443 (alist-replace
444 'unpack
445 (lambda _
446 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
447 "/bin/unzip"))
448 (source (assoc-ref %build-inputs "source")))
449 (and (zero? (system* unzip source))
450 (chdir (string-append "keyring-" ,version)))))
451 %standard-phases)))
452 (home-page "http://bitbucket.org/kang/python-keyring-lib")
453 (synopsis "Store and access your passwords safely")
454 (description
455 "The Python keyring lib provides a easy way to access the system keyring
456service from python. It can be used in any application that needs safe
457password storage.")
458 ;; "MIT" and PSF dual license
459 (license x11)))
460
a480bc41
EB
461(define-public python-six
462 (package
463 (name "python-six")
464 (version "1.7.2")
465 (source
466 (origin
467 (method url-fetch)
468 (uri (string-append "https://pypi.python.org/packages/source/s/"
469 "six/six-" version ".tar.gz"))
470 (sha256
471 (base32
472 "164rns26aqfqx2hwi0qq3scl50s69japn0fvgvrjsbyg7r1mxf67"))))
473 (build-system python-build-system)
474 (inputs
475 `(("python-setuptools" ,python-setuptools)))
476 (home-page "http://pypi.python.org/pypi/six/")
477 (synopsis "Python 2 and 3 compatibility utilities")
478 (description
479 "Six is a Python 2 and 3 compatibility library. It provides utility
480functions for smoothing over the differences between the Python versions with
481the goal of writing Python code that is compatible on both Python versions.
482Six supports every Python version since 2.5. It is contained in only one
483Python file, so it can be easily copied into your project.")
484 (license x11)))
485
cafc3f5a
EB
486(define-public python-dateutil-2
487 (package
488 (name "python-dateutil")
489 (version "2.2")
490 (source
491 (origin
492 (method url-fetch)
493 (uri (string-append "https://pypi.python.org/packages/source/p/"
494 name "/" name "-" version ".tar.gz"))
495 (sha256
496 (base32
497 "0s74ad6r789810s10dxgvaf48ni6adac2icrdad34zxygqq6bj7f"))))
498 (build-system python-build-system)
499 (inputs
500 `(("python-setuptools" ,python-setuptools)
501 ("python-six" ,python-six)))
502 (home-page "http://labix.org/python-dateutil")
503 (synopsis "Extensions to the standard datetime module")
504 (description
505 "The dateutil module provides powerful extensions to the standard
506datetime module, available in Python 2.3+.")
507 (license bsd-3)))
508
509(define-public python2-dateutil-2
510 (package-with-python2 python-dateutil-2))
511
fc50e9c6
AE
512(define-public python-dateutil
513 (package
514 (name "python-dateutil")
515 (version "1.5") ; last version for python < 3
516 (source
517 (origin
518 (method url-fetch)
cafc3f5a
EB
519 (uri (string-append "http://labix.org/download/python-dateutil/"
520 "python-dateutil-" version ".tar.gz"))
fc50e9c6
AE
521 (sha256
522 (base32
523 "0fqfglhy5khbvsipr3x7m6bcaqljh8xl5cw33vbfxy7qhmywm2n0"))))
524 (build-system python-build-system)
525 (inputs
526 `(("python-setuptools" ,python-setuptools)))
527 (home-page "http://labix.org/python-dateutil")
cafc3f5a 528 (synopsis "Extensions to the standard datetime module")
fc50e9c6
AE
529 (description
530 "The dateutil module provides powerful extensions to the standard
531datetime module, available in Python 2.3+.")
532 (license psfl)))
533
534(define-public python2-dateutil
535 (package-with-python2 python-dateutil))
1d08c01f 536
cafc3f5a
EB
537(define-public python-parsedatetime
538 (package
539 (name "python-parsedatetime")
540 (version "1.2")
541 (source
542 (origin
543 (method url-fetch)
544 (uri (string-append "https://pypi.python.org/packages/source/p/"
545 "parsedatetime/parsedatetime-" version ".tar.gz"))
546 (sha256
547 (base32
548 "1zcj0pzxvpl4j2ma9awmpkfxldybi2kjaahjjpmgfbg5cxwcjsqv"))))
549 (build-system python-build-system)
550 (native-inputs
551 `(("python-setuptools" ,python-setuptools)))
552 (arguments `(#:tests? #f)) ;no test target
553 (home-page "http://github.com/bear/parsedatetime/")
554 (synopsis
555 "Parse human-readable date/time text")
556 (description
557 "Parse human-readable date/time text")
558 (license asl2.0)))
559
560(define-public python-tzlocal
561 (package
562 (name "python-tzlocal")
563 (version "1.1.1")
564 (source
565 (origin
566 (method url-fetch)
567 (uri (string-append "https://pypi.python.org/packages/source/t/"
568 "tzlocal/tzlocal-" version ".zip"))
569 (sha256
570 (base32
571 "1m3y918c3chf41fwg2bx4w42bqsjzn3dyvvcmwwy13c8gj6zssv9"))))
572 (build-system python-build-system)
573 (native-inputs
574 `(("unzip" ,unzip)
575 ("python-setuptools" ,python-setuptools)))
576 (inputs `(("python-pytz" ,python-pytz)))
577 (arguments
578 `(#:phases
579 (alist-replace
580 'unpack
581 (lambda _
582 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
583 "/bin/unzip"))
584 (source (assoc-ref %build-inputs "source")))
585 (and (zero? (system* unzip source))
586 (chdir (string-append "tzlocal-" ,version)))))
587 %standard-phases)))
588 (home-page "https://github.com/regebro/tzlocal")
589 (synopsis
590 "tzinfo object for the local timezone")
591 (description
592 "Tzlocal returns a tzinfo object with the local timezone information.
593This module attempts to fix a glaring hole in pytz, that there is no way to
594get the local timezone information, unless you know the zoneinfo name, and
595under several distributions that's hard or impossible to figure out.")
596 (license cc0)))
597
1d08c01f
AE
598
599(define-public python2-pysqlite
600 (package
601 (name "python2-pysqlite")
7a03af70 602 (version "2.6.3a") ; see below
1d08c01f
AE
603 (source
604 (origin
605 (method url-fetch)
7a03af70
LC
606 ;; During the switch from code.google.com to pypi.python.org, the 2.6.3
607 ;; tarball was modified, but the version number was kept:
608 ;; <https://lists.gnu.org/archive/html/guix-devel/2014-02/msg00077.html>.
609 ;; Here we want to refer to the pypi-hosted 2.6.3 tarball.
610 (uri (string-append
611 "https://pypi.python.org/packages/source/p/pysqlite/pysqlite-"
612 "2.6.3" ".tar.gz"))
1d08c01f
AE
613 (sha256
614 (base32
7a03af70 615 "13djzgnbi71znjjyaw4nybg6smilgszcid646j5qav7mdchkb77y"))))
1d08c01f
AE
616 (build-system python-build-system)
617 (inputs
618 `(("sqlite" ,sqlite)))
619 (arguments
620 `(#:python ,python-2 ; incompatible with Python 3
621 #:tests? #f)) ; no test target
7a03af70
LC
622 (home-page "https://pypi.python.org/pypi/pysqlite")
623 (synopsis "SQLite bindings for Python")
1d08c01f
AE
624 (description
625 "Pysqlite provides SQLite bindings for Python that comply to the
626Database API 2.0T.")
ed0cdf83 627 (license license:zlib)))
1d08c01f 628
2875caf5
AE
629
630(define-public python2-mechanize
631 (package
632 (name "python2-mechanize")
633 (version "0.2.5")
634 (source
635 (origin
636 (method url-fetch)
637 (uri (string-append "https://pypi.python.org/packages/source/m/mechanize/mechanize-"
638 version ".tar.gz"))
639 (sha256
640 (base32
641 "0rj7r166i1dyrq0ihm5rijfmvhs8a04im28lv05c0c3v206v4rrf"))))
642 (build-system python-build-system)
643 (inputs
644 `(("python2-setuptools" ,python2-setuptools)))
645 (arguments
646 `(#:python ,python-2 ; apparently incompatible with Python 3
647 #:tests? #f))
648 ;; test fails with message
649 ;; AttributeError: 'module' object has no attribute 'test_pullparser'
650 ;; (python-3.3.2) or
651 ;; AttributeError: 'module' object has no attribute 'test_urllib2_localnet'
652 ;; (python-2.7.5).
653 ;; The source code is from March 2011 and probably not up-to-date
654 ;; with respect to python unit tests.
655 (home-page "http://wwwsearch.sourceforge.net/mechanize/")
656 (synopsis
657 "Stateful programmatic web browsing in Python")
658 (description
659 "Mechanize implements stateful programmatic web browsing in Python,
660after Andy Lester’s Perl module WWW::Mechanize.")
661 (license (bsd-style "file://COPYING"
662 "See COPYING in the distribution."))))
663
0352532e
AE
664
665(define-public python-simplejson
666 (package
667 (name "python-simplejson")
668 (version "3.3.0")
669 (source
670 (origin
671 (method url-fetch)
672 (uri (string-append "https://pypi.python.org/packages/source/s/simplejson/simplejson-"
673 version ".tar.gz"))
674 (sha256
675 (base32
676 "07wsry5j44l5zzm74l4j2bvasiq8n5m32f31n2p7c68i5vc6p2ks"))))
677 (build-system python-build-system)
678 (home-page "http://simplejson.readthedocs.org/en/latest/")
679 (synopsis
680 "Json library for Python")
681 (description
682 "JSON (JavaScript Object Notation) is a subset of JavaScript syntax
cc20a22a 683 (ECMA-262 3rd edition) used as a lightweight data interchange format.
0352532e
AE
684
685Simplejson exposes an API familiar to users of the standard library marshal
686and pickle modules. It is the externally maintained version of the json
687library contained in Python 2.6, but maintains compatibility with Python 2.5
688and (currently) has significant performance advantages, even without using
689the optional C extension for speedups. Simplejson is also supported on
690Python 3.3+.")
691 (license x11)))
692
693(define-public python2-simplejson
694 (package-with-python2 python-simplejson))
421a80a2
AE
695
696
697(define-public python2-pyicu
698 (package
699 (name "python2-pyicu")
700 (version "1.5")
701 (source
702 (origin
703 (method url-fetch)
704 (uri (string-append "https://pypi.python.org/packages/source/P/PyICU/PyICU-"
705 version ".tar.gz"))
706 (sha256
707 (base32
708 "011vwflpir8wvh48mvi6d9a7vw0f43bkwv0w6bzxbzmvz20ax5vm"))))
709 (build-system python-build-system)
710 (inputs
711 `(("icu4c" ,icu4c)))
712 (arguments
713 `(#:python ,python-2 ; Python 3 works also, but needs special care for
714 ; linking with libpython3.3m
715 #:tests? #f)) ; no check target
716 (home-page "http://pyicu.osafoundation.org/")
717 (synopsis
718 "Python extension wrapping the ICU C++ API.")
719 (description
720 "PyICU is a python extension wrapping the ICU C++ API.")
721 (license x11)))
cc20a22a
LC
722
723(define-public python2-dogtail
724 ;; Python 2 only, as it leads to "TabError: inconsistent use of tabs and
725 ;; spaces in indentation" with Python 3.
726 (package
727 (name "python2-dogtail")
728 (version "0.8.2")
729 (source (origin
730 (method url-fetch)
731 (uri (string-append
732 "https://fedorahosted.org/released/dogtail/dogtail-"
733 version ".tar.gz"))
734 (sha256
735 (base32
736 "1yc4cg7ip87z15gyd4wy2vzbywrjc52a3m8r8gqy2b50d65llcg1"))))
737 (build-system python-build-system)
738 (arguments `(#:python ,python-2
739 #:tests? #f)) ; invalid command "test"
740 (home-page "https://fedorahosted.org/dogtail/")
741 (synopsis "GUI test tool and automation framework written in ​Python")
742 (description
743 "dogtail is a GUI test tool and automation framework written in Python.
744It uses Accessibility (a11y) technologies to communicate with desktop
745applications. dogtail scripts are written in Python and executed like any
746other Python program.")
747 (license gpl2+)))
515e6878 748
011b18c3
LC
749(define-public python2-empy
750 (package
751 (name "python2-empy")
752 (version "3.3")
753 (source (origin
754 (method url-fetch)
755 (uri (string-append "http://www.alcyone.com/software/empy/empy-"
756 version ".tar.gz"))
757 (sha256
758 (base32
759 "01g8mmkfnvjdmlhsihwyx56lrg7r5m5d2fg6mnxsvy6g0dnl69f6"))))
760 (build-system python-build-system)
761 (arguments
762 `(#:python ,python-2
763 #:phases (alist-replace
764 'check
765 (lambda _
766 (zero? (system* "./test.sh")))
767 %standard-phases)))
768 (home-page "http://www.alcyone.com/software/empy/")
769 (synopsis "Templating system for Python")
770 (description
771 "EmPy is a system for embedding Python expressions and statements in
772template text; it takes an EmPy source file, processes it, and produces
773output. This is accomplished via expansions, which are special signals to the
774EmPy system and are set off by a special prefix (by default the at sign, @).
775EmPy can expand arbitrary Python expressions and statements in this way, as
776well as a variety of special forms. Textual data not explicitly delimited in
777this way is sent unaffected to the output, allowing Python to be used in
778effect as a markup language. Also supported are callbacks via hooks,
779recording and playback via diversions, and dynamic, chainable filters. The
780system is highly configurable via command line options and embedded
781commands.")
782 (license lgpl2.1+)))
783
8deeda0c
LC
784(define-public python2-element-tree
785 (package
786 (name "python2-element-tree")
787 (version "1.2.6")
788 (source (origin
789 (method url-fetch)
790 (uri (string-append
791 "http://effbot.org/media/downloads/elementtree-"
792 version "-20050316.tar.gz"))
793 (sha256
794 (base32
795 "016bphqnlg0l4vslahhw4r0aanw95bpypy65r1i1acyb2wj5z7dj"))))
796 (build-system python-build-system)
797 (arguments
798 `(#:python ,python-2 ; seems to be part of Python 3
799 #:tests? #f)) ; no 'test' sub-command
800 (synopsis "Toolkit for XML processing in Python")
801 (description
802 "ElementTree is a Python library supporting lightweight XML processing.")
803 (home-page "http://effbot.org/zone/element-index.htm")
804 (license (x11-style "http://docs.python.org/2/license.html"
805 "Like \"CWI LICENSE AGREEMENT FOR PYTHON \
8060.9.0 THROUGH 1.2\"."))))
807
808(define-public python2-pybugz
809 (package
810 (name "python2-pybugz")
811 (version "0.6.11")
812 (source (origin
813 (method url-fetch)
814 (uri (string-append
815 "http://bits.liquidx.net/projects/pybugz/pybugz-"
816 version ".tar.gz"))
817 (sha256
818 (base32
6f194a1e
LC
819 "17ni00p08gp5lkxlrrcnvi3x09fmajnlbz4da03qcgl9q21ym4jd"))
820 (patches (map search-patch
821 (list "pybugz-stty.patch"
822 "pybugz-encode-error.patch")))))
8deeda0c
LC
823 (build-system python-build-system)
824 (arguments
825 `(#:python ,python-2 ; SyntaxError with Python 3
826 #:tests? #f)) ; no 'test' sub-command
827 (inputs `(("element-tree" ,python2-element-tree)))
828 (synopsis "Python and command-line interface to Bugzilla")
829 (description
830 "PyBugz is a Python library and command-line tool to query the Bugzilla
831bug tracking system. It is meant as an aid to speed up interaction with the
832bug tracker.")
833 (home-page "http://www.liquidx.net/pybugz/")
834 (license gpl2)))
835
a480bc41
EB
836(define-public python-enum34
837 (package
838 (name "python-enum34")
839 (version "1.0")
840 (source
841 (origin
842 (method url-fetch)
843 (uri (string-append "https://pypi.python.org/packages/source/e/"
844 "enum34/enum34-" version ".tar.gz"))
845 (sha256
846 (base32
847 "0dg6mpg9n4g9diyrbnbb5vd9d1qw9f265zwhknqy0mxh0cvmjjrq"))))
848 (build-system python-build-system)
849 (inputs
850 `(("python-setuptools" ,python-setuptools)))
851 (arguments
852 `(#:phases
853 (alist-replace
854 'check
855 (lambda _ (zero? (system* "python" "enum/test_enum.py")))
856 %standard-phases)))
857 (home-page "https://pypi.python.org/pypi/enum34")
858 (synopsis "Backported Python 3.4 Enum")
859 (description
860 "Enum34 is the new Python stdlib enum module available in Python 3.4
861backported for previous versions of Python from 2.4 to 3.3.")
862 (license bsd-3)))
863
864(define-public python-parse-type
865 (package
866 (name "python-parse-type")
867 (version "0.3.4")
868 (source
869 (origin
870 (method url-fetch)
871 (uri (string-append "https://pypi.python.org/packages/source/p/"
872 "parse_type/parse_type-" version ".tar.gz"))
873 (sha256
874 (base32
875 "0iv1c34npr4iynwpgv1vkjx9rjd18a85ir8c01gc5f7wp8iv7l1x"))))
876 (build-system python-build-system)
877 (inputs
878 `(("python-setuptools" ,python-setuptools)
879 ("python-six" ,python-six)
880 ("python-parse" ,python-parse)
881 ("python-enum34" ,python-enum34))) ;required for python<3.4
882 (arguments '(#:tests? #f)) ;TODO: tests require pytest
883 (home-page "https://github.com/jenisys/parse_type")
884 (synopsis "Extended parse module")
885 (description
886 "Parse_type extends the python parse module.")
887 (license bsd-3)))
888
889(define-public python-parse
890 (package
891 (name "python-parse")
892 (version "1.6.4")
893 (source
894 (origin
895 (method url-fetch)
896 (uri (string-append "https://pypi.python.org/packages/source/p/"
897 "parse/parse-" version ".tar.gz"))
898 (sha256
899 (base32
900 "0m30q64l6szl7s9mhvqy64w2fdhdn8lb91fmacjiwbv3479cmk57"))))
901 (build-system python-build-system)
902 (arguments
903 `(#:phases
904 (alist-replace
905 'check
906 (lambda _ (zero? (system* "python" "test_parse.py")))
907 %standard-phases)))
908 (home-page "https://github.com/r1chardj0n3s/parse")
909 (synopsis "Parse strings")
910 (description
911 "Parse strings using a specification based on the Python format()
912syntax.")
913 (license x11)))
914
915
515e6878
LC
916(define-public scons
917 (package
918 (name "scons")
919 (version "2.1.0")
920 (source (origin
921 (method url-fetch)
922 (uri (string-append "mirror://sourceforge/scons/scons-"
923 version ".tar.gz"))
924 (sha256
925 (base32
926 "07cjn4afb2cljjrd3cr7xf062qq58z8q96f58z6yplhdyqafsfa1"))))
927 (build-system python-build-system)
928 (arguments
929 ;; With Python 3.x, fails to build with a syntax error.
930 `(#:python ,python-2
931 #:tests? #f)) ; no 'python setup.py test' command
932 (home-page "http://scons.org/")
933 (synopsis "Software construction tool written in Python")
934 (description
935 "SCons is a software construction tool. Think of SCons as an improved,
936cross-platform substitute for the classic Make utility with integrated
937functionality similar to autoconf/automake and compiler caches such as ccache.
938In short, SCons is an easier, more reliable and faster way to build
939software.")
940 (license x11)))
011b18c3 941
a480bc41
EB
942(define-public behave
943 (package
944 (name "behave")
945 (version "1.2.4")
946 (source (origin
947 (method url-fetch)
948 (uri (string-append "https://pypi.python.org/packages/source/b/"
949 name "/" name "-" version ".tar.gz"))
950 (sha256
951 (base32
952 "1v2rfy8xnf0rk7cj4cgr7lam4015d458i7bg0xqs9czfv6njlm14"))))
953 (build-system python-build-system)
954 (inputs
955 `(("python-setuptools" ,python-setuptools)
956 ("python-six" ,python-six)
957 ("python-enum43" ,python-enum34)
958 ("python-parse" ,python-parse)
959 ("python-parse-type" ,python-parse-type)))
960 (arguments `(#:tests? #f)) ;TODO: tests require nose>=1.3 and
961 ;PyHamcrest>=1.8
962 (home-page "http://github.com/behave/behave")
963 (synopsis "Python behavior-driven development")
964 (description
965 "Behave is a tool for behavior-driven development in python.
966Behavior-driven development (or BDD) is an agile software development
967technique that encourages collaboration between developers, QA and
968non-technical or business participants in a software project. Behave uses
969tests written in a natural language style, backed up by Python code.")
970 (license x11)))
c7303d3c
DT
971
972(define-public python-exif-read
973 (package
974 (name "python-exif-read")
975 (version "1.4.2")
976 (source (origin
977 (method url-fetch)
978 (uri
979 (string-append
980 "https://pypi.python.org/packages/source/E/ExifRead/ExifRead-"
981 version ".tar.gz"))
982 (sha256
983 (base32
984 "17c627gcdmyc05hz4zk8qs4pjgw6rc68qzjzgz8gh1cmpsd7acf1"))))
985 (build-system python-build-system)
986 (inputs
987 `(("python-setuptools" ,python-setuptools)))
988 (arguments `(#:tests? #f)) ; no tests
989 (home-page "https://github.com/ianare/exif-py")
990 (synopsis "Python library to extract EXIF data from image files")
991 (description
992 "ExifRead is a Python library to extract EXIF data from tiff and jpeg
993files.")
994 (license bsd-3)))
995
996(define-public python2-exif-read
997 (package-with-python2 python-exif-read))
d5f89b22
DT
998
999(define-public python-pyld
1000 (package
1001 (name "python-pyld")
1002 (version "0.6.0")
1003 (source (origin
1004 (method url-fetch)
1005 (uri
1006 (string-append
1007 "https://pypi.python.org/packages/source/P/PyLD/PyLD-"
1008 version ".tar.gz"))
1009 (sha256
1010 (base32
1011 "1l9ymj85fsvayqplinzpk0kyiq6m74ps9xd3a9fhlxfn1rldf8x8"))))
1012 (build-system python-build-system)
1013 (inputs
1014 `(("python-setuptools" ,python-setuptools)))
1015 (arguments `(#:tests? #f)) ; no tests
1016 (home-page "http://github.com/digitalbazaar/pyld")
1017 (synopsis "Python implementation of the JSON-LD specification")
1018 (description
1019 "PyLD is an implementation of the JSON-LD specification.")
1020 (license bsd-3)))
1021
1022(define-public python2-pyld
1023 (package-with-python2 python-pyld))
3a1f9a68
DT
1024
1025(define-public python-certifi
1026 (package
1027 (name "python-certifi")
1028 (version "14.05.14")
1029 (source (origin
1030 (method url-fetch)
1031 (uri
1032 (string-append
1033 "https://pypi.python.org/packages/source/c/certifi/certifi-"
1034 version ".tar.gz"))
1035 (sha256
1036 (base32
1037 "0s8vxzfz6s4m6fvxc7z25k9j35w0rh6jkw3wwcd1az1mssncn6qy"))))
1038 (build-system python-build-system)
1039 (inputs
1040 `(("python-setuptools" ,python-setuptools)))
1041 (arguments `(#:tests? #f)) ; no tests
1042 (home-page "http://python-requests.org/")
1043 (synopsis "Python CA certificate bundle")
1044 (description
1045 "Certifi is a Python library that contains a CA certificate bundle, which
1046is used by the Requests library to verify HTTPS requests.")
1047 (license asl2.0)))
1048
1049(define-public python2-certifi
1050 (package-with-python2 python-certifi))
e6cfbd36
DT
1051
1052(define-public python2-requests
1053 (package
1054 (name "python2-requests")
1055 (version "2.4.0")
1056 (source (origin
1057 (method url-fetch)
1058 (uri
1059 (string-append
1060 "https://pypi.python.org/packages/source/r/requests/requests-"
1061 version ".tar.gz"))
1062 (sha256
1063 (base32
1064 "0gknlfx1wakrrm1zi8gi03x2lzj4dsns0vjw0nsmgqvkphyf01vh"))))
1065 (build-system python-build-system)
1066 (inputs
1067 `(("python-setuptools" ,python-setuptools)
1068 ("python-certifi" ,python-certifi)))
1069 (arguments `(#:tests? #f ; no tests
1070 #:python ,python-2))
1071 (home-page "http://python-requests.org/")
1072 (synopsis "Python HTTP library")
1073 (description
1074 "Requests is a Python HTTP client library. It aims to be easier to use
1075than Python’s urllib2 library.")
1076 (license asl2.0)))
864b5211
DT
1077
1078(define-public python-jsonschema
1079 (package
1080 (name "python-jsonschema")
1081 (version "2.4.0")
1082 (source (origin
1083 (method url-fetch)
1084 (uri
1085 (string-append
1086 "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-"
1087 version ".tar.gz"))
1088 (sha256
1089 (base32
1090 "1yik3031ziygvq66rj3mzfqdgxj29sg1bkfc46wsgi7lnbqs560j"))))
1091 (build-system python-build-system)
1092 (inputs
1093 `(("python-setuptools" ,python-setuptools)))
1094 (home-page "http://github.com/Julian/jsonschema")
1095 (synopsis "Implementation of JSON Schema for Python")
1096 (description
1097 "Jsonschema is an implementation of JSON Schema for Python.")
1098 (license expat)))
1099
1100(define-public python2-jsonschema
1101 (package-with-python2 python-jsonschema))