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