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