1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages python)
25 #:use-module ((guix licenses)
26 #:select (asl2.0 bsd-3 bsd-2 bsd-style cc0 expat x11 x11-style
27 gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1+
29 #:use-module ((guix licenses) #:select (zlib) #:prefix license:)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages gdbm)
33 #:use-module (gnu packages icu4c)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages libffi)
36 #:use-module (gnu packages readline)
37 #:use-module (gnu packages openssl)
38 #:use-module (gnu packages elf)
39 #:use-module (gnu packages maths)
40 #:use-module (gnu packages gcc)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages zip)
44 #:use-module (gnu packages ghostscript)
45 #:use-module (gnu packages multiprecision)
46 #:use-module (gnu packages texlive)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages image)
49 #:use-module (gnu packages imagemagick)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages which)
52 #:use-module (gnu packages perl)
53 #:use-module (guix packages)
54 #:use-module (guix download)
55 #:use-module (guix utils)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system python)
58 #:use-module (guix build-system trivial)
59 #:use-module (srfi srfi-1))
61 (define-public python-2
68 (uri (string-append "https://www.python.org/ftp/python/"
69 version "/Python-" version ".tar.xz"))
70 (patches (list (search-patch "python-libffi-mips-n32-fix.patch")
71 (search-patch "python2-sqlite-3.8.4-test-fix.patch")))
72 (patch-flags '("-p0"))
75 "18gnpyh071dxa0rv3silrz92jw9qpblswzwv4gzqcwxzz20qxmhz"))))
76 (build-system gnu-build-system)
81 ;; test_bz2 test_distutils test_file test_file2k test_popen2
82 ;; test_shutil test_signal test_site test_slice test_smtplib
83 ;; test_smtpnet test_socket test_socketserver test_softspace
84 ;; test_sort test_sqlite test_ssl test_startfile test_str
85 ;; test_strftime test_string test_stringprep test_strop test_strptime
86 ;; test_strtod test_struct test_structmembers test_structseq
87 ;; test_subprocess test_sunaudiodev test_sundry test_symtable
88 ;; test_syntax test_sys test_sys_setprofile test_sys_settrace
89 ;; test_sysconfig test_tarfile test_tcl test_telnetlib test_tempfile
90 ;; test_textwrap test_thread test_threaded_import
91 ;; test_threadedtempfile test_threading test_threading_local
92 ;; test_threadsignals test_time test_timeout test_tk test_tokenize
93 ;; test_tools test_trace test_traceback test_transformer
94 ;; test_ttk_guionly test_ttk_textonly test_tuple test_typechecks
95 ;; test_ucn test_unary test_undocumented_details test_unicode
96 ;; test_unicode_file test_unicodedata test_univnewlines
97 ;; test_univnewlines2k test_unpack test_urllib test_urllib2
98 ;; test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse
99 ;; test_userdict test_userlist test_userstring test_uu test_uuid
100 ;; test_wait3 test_wait4 test_warnings test_wave test_weakref
101 ;; test_weakset test_whichdb test_winreg test_winsound test_with
102 ;; test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c
103 ;; test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile
104 ;; test_zipfile64 test_zipimport test_zipimport_support test_zlib
106 ;; test_aepack test_al test_applesingle test_ascii_formatd test_bsddb
107 ;; test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn
108 ;; test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
109 ;; test_codecmaps_tw test_ctypes test_curses test_dl test_gdb test_gl
110 ;; test_imageop test_imgfile test_ioctl test_kqueue
111 ;; test_linuxaudiodev test_macos test_macostools test_msilib
112 ;; test_multiprocessing test_ossaudiodev test_pep277
113 ;; test_scriptpackages
114 ;; 7 skips unexpected on linux2:
115 ;; test_ascii_formatd test_bsddb test_bsddb3 test_ctypes test_gdb
116 ;; test_ioctl test_multiprocessing
117 ;; One of the typical errors:
119 ;; test test_unicode crashed -- <type 'exceptions.OSError'>: [Errno 2] No such file or directory
122 (let ((bz2 (assoc-ref %build-inputs "bzip2"))
123 (gdbm (assoc-ref %build-inputs "gdbm"))
124 (libffi (assoc-ref %build-inputs "libffi"))
125 (sqlite (assoc-ref %build-inputs "sqlite"))
126 (openssl (assoc-ref %build-inputs "openssl"))
127 (readline (assoc-ref %build-inputs "readline"))
128 (zlib (assoc-ref %build-inputs "zlib")))
129 (list "--enable-shared" ; allow embedding
130 "--with-system-ffi" ; build ctypes
131 (string-append "CPPFLAGS="
133 "-I" gdbm "/include "
134 "-I" sqlite "/include "
135 "-I" openssl "/include "
136 "-I" readline "/include "
137 "-I" zlib "/include")
138 (string-append "LDFLAGS="
144 "-L" readline "/lib "
147 #:modules ((guix build gnu-build-system)
151 #:imported-modules ((guix build gnu-build-system)
157 'strip 'add-lib-to-runpath
158 (lambda* (#:key outputs #:allow-other-keys)
159 (let* ((out (assoc-ref outputs "out"))
160 (lib (string-append out "/lib")))
161 ;; Add LIB to the RUNPATH of all the executables.
162 (with-directory-excursion out
163 (for-each (cut augment-rpath <> lib)
164 (find-files "bin" ".*")))))
166 'configure 'patch-lib-shells
168 ;; Filter for existing files, since some may not exist in all
169 ;; versions of python that are built with this recipe.
170 (substitute* (filter file-exists?
171 '("Lib/subprocess.py"
173 "Lib/distutils/tests/test_spawn.py"
174 "Lib/test/test_subprocess.py"))
175 (("/bin/sh") (which "sh"))))
179 ;; 'Lib/test/test_site.py' needs a valid $HOME
180 (setenv "HOME" (getcwd)))
181 %standard-phases)))))
185 ("libffi" ,libffi) ; for ctypes
186 ("sqlite" ,sqlite) ; for sqlite extension
188 ("readline" ,readline)
190 ("patchelf" ,patchelf))) ; for (guix build rpath)
192 `(("pkg-config" ,pkg-config)))
194 (list (search-path-specification
195 (variable "PYTHONPATH")
196 (directories '("lib/python2.7/site-packages")))))
197 (home-page "http://python.org")
199 "High-level, dynamically-typed programming language")
201 "Python is a remarkably powerful dynamic programming language that
202 is used in a wide variety of application domains. Some of its key
203 distinguishing features include: clear, readable syntax; strong
204 introspection capabilities; intuitive object orientation; natural
205 expression of procedural code; full modularity, supporting hierarchical
206 packages; exception-based error handling; and very high level dynamic
210 (define-public python
211 (package (inherit python-2)
215 (uri (string-append "https://www.python.org/ftp/python/"
216 version "/Python-" version ".tar.xz"))
217 (patches (list (search-patch "python-fix-tests.patch")
218 (search-patch "python-sqlite-3.8.4-test-fix.patch")
219 (search-patch "python-libffi-mips-n32-fix.patch")))
220 (patch-flags '("-p0"))
223 "1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb"))))
225 (let ((args `(#:modules ((guix build gnu-build-system)
229 ,@(package-arguments python-2))))
230 (substitute-keyword-arguments args
233 (list (search-path-specification
234 (variable "PYTHONPATH")
235 (directories '("lib/python3.3/site-packages")))))))
237 (define-public python-wrapper
238 (package (inherit python)
239 (name "python-wrapper")
241 (build-system trivial-build-system)
242 (propagated-inputs `(("python" ,python)))
244 `(#:modules ((guix build utils))
247 (use-modules (guix build utils))
248 (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
249 (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
253 (symlink (string-append python old)
254 (string-append bin "/" new)))
255 `("python3", "pydoc3", "idle3")
256 `("python", "pydoc", "idle"))))))
257 (description (string-append (package-description python)
258 "\n\nThis wrapper package provides symbolic links to the python binaries
259 without version suffix."))))
262 (define-public python-pytz
269 (uri (string-append "https://launchpad.net/pytz/main/" version
270 "/+download/pytz-" version ".tar.bz2"))
273 "19giwgfcrg0nr1gdv49qnmf2jb2ilkcfc7qyqvfpz4dp0p64ksv5"))))
274 (build-system python-build-system)
275 (arguments `(#:tests? #f)) ; no test target
276 (home-page "https://launchpad.net/pytz")
277 (synopsis "Python timezone library")
279 "This library allows accurate and cross platform timezone calculations
280 using Python 2.4 or higher and provides access to the Olson timezone database.")
283 (define-public python2-pytz
284 (package-with-python2 python-pytz))
287 (define-public python-babel
289 (name "python-babel")
294 (uri (string-append "https://pypi.python.org/packages/source/B/Babel/Babel-"
298 "0bnin777lc53nxd1hp3apq410jj5wx92n08h7h4izpl4f4sx00lz"))))
299 (build-system python-build-system)
301 `(("python-pytz" ,python-pytz)
302 ("python-setuptools" ,python-setuptools)))
303 (arguments `(#:tests? #f)) ; no test target
304 (home-page "http://babel.pocoo.org/")
306 "Tools for internationalizing Python applications")
308 "Babel is composed of two major parts:
309 - tools to build and work with gettext message catalogs
310 - a Python interface to the CLDR (Common Locale Data Repository), providing
311 access to various locale display names, localized number and date formatting,
315 (define-public python2-babel
316 (package-with-python2 python-babel))
318 (define-public python-lockfile
320 (name "python-lockfile")
325 (uri (string-append "https://pypi.python.org/packages/source/l/lockfile/"
326 "lockfile-" version ".tar.gz"))
329 "0iwif7i84gwpvrnpv4brshdk8j6l77smvknm8k3bg77mj6f5ini3"))))
330 (build-system python-build-system)
331 (arguments '(#:test-target "check"))
332 (home-page "http://code.google.com/p/pylockfile/")
333 (synopsis "Platform-independent file locking module")
335 "The lockfile package exports a LockFile class which provides a simple
336 API for locking files.")
339 (define-public python2-lockfile
340 (package-with-python2 python-lockfile))
342 (define-public python-mock
349 (uri (string-append "https://pypi.python.org/packages/source/m/mock/"
350 "mock-" version ".tar.gz"))
353 "0kzlsbki6q0awf89rc287f3aj8x431lrajf160a70z0ikhnxsfdq"))))
354 (build-system python-build-system)
355 (arguments '(#:test-target "check"))
356 (home-page "http://code.google.com/m/mock/")
357 (synopsis "Python mocking and patching library for testing")
359 "Mock is a library for testing in Python. It allows you to replace parts
360 of your system under test with mock objects and make assertions about how they
364 (define-public python2-mock
365 (package-with-python2 python-mock))
368 (define-public python-setuptools
370 (name "python-setuptools")
375 (uri (string-append "https://pypi.python.org/packages/source/s/setuptools/setuptools-"
379 "0hl9sa5xr9bi2ifq51wy1bawsjv5nzvpbac7m9z1ciz778874csf"))))
380 (build-system python-build-system)
383 ;;FIXME: test_sdist_with_utf8_encoded_filename fails in
384 ;; /tmp/nix-build-python2-setuptools-1.1.4.drv-0/setuptools-1.1.4/setuptools/tests/test_sdist.py"
386 ;; The tests pass with Python 2.7.5.
387 (home-page "https://pypi.python.org/pypi/setuptools")
389 "Library designed to facilitate packaging Python projects")
391 "Setuptools is a fully-featured, stable library designed to facilitate
392 packaging Python projects, where packaging includes:
393 Python package and module definitions,
394 distribution package metadata,
396 project installation,
397 platform-specific details,
401 (define-public python2-setuptools
402 (package-with-python2 python-setuptools))
405 (define-public python-pycrypto
407 (name "python-pycrypto")
412 (uri (string-append "https://pypi.python.org/packages/source/p/"
413 "pycrypto/pycrypto-" version ".tar.gz"))
416 "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
417 (build-system python-build-system)
419 `(("python-setuptools" ,python-setuptools)))
426 'build 'set-build-env
427 ;; pycrypto runs an autoconf configure script behind the scenes
429 (setenv "CONFIG_SHELL" (which "bash")))
431 (home-page "http://www.pycrypto.org/")
432 (synopsis "Cryptographic modules for Python")
434 "Pycrypto is a collection of both secure hash functions (such as SHA256
435 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
436 etc.). The package is structured to make adding new modules easy.")
437 (license public-domain)))
439 (define-public python-keyring
441 (name "python-keyring")
446 (uri (string-append "https://pypi.python.org/packages/source/k/"
447 "keyring/keyring-" version ".zip"))
450 "1vxazfbcwggyfyramh55shkxs08skhpqrkm6lrrjnygnm8c1l2zg"))))
451 (build-system python-build-system)
454 ("python-setuptools" ,python-setuptools)
455 ("python-mock" ,python-mock)))
457 `(("python-pycrypto" ,python-pycrypto)))
459 `(#:tests? #f ;TODO: tests require pytest
464 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
466 (source (assoc-ref %build-inputs "source")))
467 (and (zero? (system* unzip source))
468 (chdir (string-append "keyring-" ,version)))))
470 (home-page "http://bitbucket.org/kang/python-keyring-lib")
471 (synopsis "Store and access your passwords safely")
473 "The Python keyring lib provides a easy way to access the system keyring
474 service from python. It can be used in any application that needs safe
476 ;; "MIT" and PSF dual license
479 (define-public python-six
486 (uri (string-append "https://pypi.python.org/packages/source/s/"
487 "six/six-" version ".tar.gz"))
490 "164rns26aqfqx2hwi0qq3scl50s69japn0fvgvrjsbyg7r1mxf67"))))
491 (build-system python-build-system)
493 `(("python-setuptools" ,python-setuptools)))
494 (home-page "http://pypi.python.org/pypi/six/")
495 (synopsis "Python 2 and 3 compatibility utilities")
497 "Six is a Python 2 and 3 compatibility library. It provides utility
498 functions for smoothing over the differences between the Python versions with
499 the goal of writing Python code that is compatible on both Python versions.
500 Six supports every Python version since 2.5. It is contained in only one
501 Python file, so it can be easily copied into your project.")
504 (define-public python-dateutil-2
506 (name "python-dateutil")
511 (uri (string-append "https://pypi.python.org/packages/source/p/"
512 name "/" name "-" version ".tar.gz"))
515 "0s74ad6r789810s10dxgvaf48ni6adac2icrdad34zxygqq6bj7f"))))
516 (build-system python-build-system)
518 `(("python-setuptools" ,python-setuptools)
519 ("python-six" ,python-six)))
520 (home-page "http://labix.org/python-dateutil")
521 (synopsis "Extensions to the standard datetime module")
523 "The dateutil module provides powerful extensions to the standard
524 datetime module, available in Python 2.3+.")
527 (define-public python2-dateutil-2
528 (package-with-python2 python-dateutil-2))
530 (define-public python-dateutil
532 (name "python-dateutil")
533 (version "1.5") ; last version for python < 3
537 (uri (string-append "http://labix.org/download/python-dateutil/"
538 "python-dateutil-" version ".tar.gz"))
541 "0fqfglhy5khbvsipr3x7m6bcaqljh8xl5cw33vbfxy7qhmywm2n0"))))
542 (build-system python-build-system)
544 `(("python-setuptools" ,python-setuptools)))
545 (home-page "http://labix.org/python-dateutil")
546 (synopsis "Extensions to the standard datetime module")
548 "The dateutil module provides powerful extensions to the standard
549 datetime module, available in Python 2.3+.")
552 (define-public python2-dateutil
553 (package-with-python2 python-dateutil))
555 (define-public python-parsedatetime
557 (name "python-parsedatetime")
562 (uri (string-append "https://pypi.python.org/packages/source/p/"
563 "parsedatetime/parsedatetime-" version ".tar.gz"))
566 "1zcj0pzxvpl4j2ma9awmpkfxldybi2kjaahjjpmgfbg5cxwcjsqv"))))
567 (build-system python-build-system)
569 `(("python-setuptools" ,python-setuptools)))
570 (arguments `(#:tests? #f)) ;no test target
571 (home-page "http://github.com/bear/parsedatetime/")
573 "Parse human-readable date/time text")
575 "Parse human-readable date/time text")
578 (define-public python-tzlocal
580 (name "python-tzlocal")
585 (uri (string-append "https://pypi.python.org/packages/source/t/"
586 "tzlocal/tzlocal-" version ".zip"))
589 "1m3y918c3chf41fwg2bx4w42bqsjzn3dyvvcmwwy13c8gj6zssv9"))))
590 (build-system python-build-system)
593 ("python-setuptools" ,python-setuptools)))
594 (inputs `(("python-pytz" ,python-pytz)))
600 (let ((unzip (string-append (assoc-ref %build-inputs "unzip")
602 (source (assoc-ref %build-inputs "source")))
603 (and (zero? (system* unzip source))
604 (chdir (string-append "tzlocal-" ,version)))))
606 (home-page "https://github.com/regebro/tzlocal")
608 "Local timezone information for Python")
610 "Tzlocal returns a tzinfo object with the local timezone information.
611 This module attempts to fix a glaring hole in pytz, that there is no way to
612 get the local timezone information, unless you know the zoneinfo name, and
613 under several distributions that's hard or impossible to figure out.")
617 (define-public python2-pysqlite
619 (name "python2-pysqlite")
620 (version "2.6.3a") ; see below
624 ;; During the switch from code.google.com to pypi.python.org, the 2.6.3
625 ;; tarball was modified, but the version number was kept:
626 ;; <https://lists.gnu.org/archive/html/guix-devel/2014-02/msg00077.html>.
627 ;; Here we want to refer to the pypi-hosted 2.6.3 tarball.
629 "https://pypi.python.org/packages/source/p/pysqlite/pysqlite-"
633 "13djzgnbi71znjjyaw4nybg6smilgszcid646j5qav7mdchkb77y"))))
634 (build-system python-build-system)
636 `(("sqlite" ,sqlite)))
638 `(#:python ,python-2 ; incompatible with Python 3
639 #:tests? #f)) ; no test target
640 (home-page "https://pypi.python.org/pypi/pysqlite")
641 (synopsis "SQLite bindings for Python")
643 "Pysqlite provides SQLite bindings for Python that comply to the
645 (license license:zlib)))
648 (define-public python2-mechanize
650 (name "python2-mechanize")
655 (uri (string-append "https://pypi.python.org/packages/source/m/mechanize/mechanize-"
659 "0rj7r166i1dyrq0ihm5rijfmvhs8a04im28lv05c0c3v206v4rrf"))))
660 (build-system python-build-system)
662 `(("python2-setuptools" ,python2-setuptools)))
664 `(#:python ,python-2 ; apparently incompatible with Python 3
666 ;; test fails with message
667 ;; AttributeError: 'module' object has no attribute 'test_pullparser'
669 ;; AttributeError: 'module' object has no attribute 'test_urllib2_localnet'
671 ;; The source code is from March 2011 and probably not up-to-date
672 ;; with respect to python unit tests.
673 (home-page "http://wwwsearch.sourceforge.net/mechanize/")
675 "Stateful programmatic web browsing in Python")
677 "Mechanize implements stateful programmatic web browsing in Python,
678 after Andy Lester’s Perl module WWW::Mechanize.")
679 (license (bsd-style "file://COPYING"
680 "See COPYING in the distribution."))))
683 (define-public python-simplejson
685 (name "python-simplejson")
690 (uri (string-append "https://pypi.python.org/packages/source/s/simplejson/simplejson-"
694 "07wsry5j44l5zzm74l4j2bvasiq8n5m32f31n2p7c68i5vc6p2ks"))))
695 (build-system python-build-system)
696 (home-page "http://simplejson.readthedocs.org/en/latest/")
698 "Json library for Python")
700 "JSON (JavaScript Object Notation) is a subset of JavaScript syntax
701 (ECMA-262 3rd edition) used as a lightweight data interchange format.
703 Simplejson exposes an API familiar to users of the standard library marshal
704 and pickle modules. It is the externally maintained version of the json
705 library contained in Python 2.6, but maintains compatibility with Python 2.5
706 and (currently) has significant performance advantages, even without using
707 the optional C extension for speedups. Simplejson is also supported on
711 (define-public python2-simplejson
712 (package-with-python2 python-simplejson))
715 (define-public python2-pyicu
717 (name "python2-pyicu")
722 (uri (string-append "https://pypi.python.org/packages/source/P/PyICU/PyICU-"
726 "1y361x82lnh9k9srmdx3q92z5iag112z7r5fxm0n1sfwb349yjdw"))))
727 (build-system python-build-system)
731 `(#:python ,python-2 ; Python 3 works also, but needs special care for
732 ; linking with libpython3.3m
733 #:tests? #f)) ; no check target
734 (home-page "http://pyicu.osafoundation.org/")
735 (synopsis "Python extension wrapping the ICU C++ API")
737 "PyICU is a python extension wrapping the ICU C++ API.")
740 (define-public python2-dogtail
741 ;; Python 2 only, as it leads to "TabError: inconsistent use of tabs and
742 ;; spaces in indentation" with Python 3.
744 (name "python2-dogtail")
749 "https://fedorahosted.org/released/dogtail/dogtail-"
753 "1yc4cg7ip87z15gyd4wy2vzbywrjc52a3m8r8gqy2b50d65llcg1"))))
754 (build-system python-build-system)
755 (arguments `(#:python ,python-2
756 #:tests? #f)) ; invalid command "test"
757 (home-page "https://fedorahosted.org/dogtail/")
758 (synopsis "GUI test tool and automation framework written in Python")
760 "Dogtail is a GUI test tool and automation framework written in Python.
761 It uses Accessibility (a11y) technologies to communicate with desktop
762 applications. dogtail scripts are written in Python and executed like any
763 other Python program.")
766 (define-public python2-empy
768 (name "python2-empy")
772 (uri (string-append "http://www.alcyone.com/software/empy/empy-"
776 "01g8mmkfnvjdmlhsihwyx56lrg7r5m5d2fg6mnxsvy6g0dnl69f6"))))
777 (build-system python-build-system)
780 #:phases (alist-replace
783 (zero? (system* "./test.sh")))
785 (home-page "http://www.alcyone.com/software/empy/")
786 (synopsis "Templating system for Python")
788 "EmPy is a system for embedding Python expressions and statements in
789 template text; it takes an EmPy source file, processes it, and produces
790 output. This is accomplished via expansions, which are special signals to the
791 EmPy system and are set off by a special prefix (by default the at sign, @).
792 EmPy can expand arbitrary Python expressions and statements in this way, as
793 well as a variety of special forms. Textual data not explicitly delimited in
794 this way is sent unaffected to the output, allowing Python to be used in
795 effect as a markup language. Also supported are callbacks via hooks,
796 recording and playback via diversions, and dynamic, chainable filters. The
797 system is highly configurable via command line options and embedded
801 (define-public python2-element-tree
803 (name "python2-element-tree")
808 "http://effbot.org/media/downloads/elementtree-"
809 version "-20050316.tar.gz"))
812 "016bphqnlg0l4vslahhw4r0aanw95bpypy65r1i1acyb2wj5z7dj"))))
813 (build-system python-build-system)
815 `(#:python ,python-2 ; seems to be part of Python 3
816 #:tests? #f)) ; no 'test' sub-command
817 (synopsis "Toolkit for XML processing in Python")
819 "ElementTree is a Python library supporting lightweight XML processing.")
820 (home-page "http://effbot.org/zone/element-index.htm")
821 (license (x11-style "http://docs.python.org/2/license.html"
822 "Like \"CWI LICENSE AGREEMENT FOR PYTHON \
823 0.9.0 THROUGH 1.2\"."))))
825 (define-public python2-pybugz
827 (name "python2-pybugz")
832 "http://bits.liquidx.net/projects/pybugz/pybugz-"
836 "17ni00p08gp5lkxlrrcnvi3x09fmajnlbz4da03qcgl9q21ym4jd"))
837 (patches (map search-patch
838 (list "pybugz-stty.patch"
839 "pybugz-encode-error.patch")))))
840 (build-system python-build-system)
842 `(#:python ,python-2 ; SyntaxError with Python 3
843 #:tests? #f)) ; no 'test' sub-command
844 (inputs `(("element-tree" ,python2-element-tree)))
845 (synopsis "Python and command-line interface to Bugzilla")
847 "PyBugz is a Python library and command-line tool to query the Bugzilla
848 bug tracking system. It is meant as an aid to speed up interaction with the
850 (home-page "http://www.liquidx.net/pybugz/")
853 (define-public python-enum34
855 (name "python-enum34")
860 (uri (string-append "https://pypi.python.org/packages/source/e/"
861 "enum34/enum34-" version ".tar.gz"))
864 "0dg6mpg9n4g9diyrbnbb5vd9d1qw9f265zwhknqy0mxh0cvmjjrq"))))
865 (build-system python-build-system)
867 `(("python-setuptools" ,python-setuptools)))
872 (lambda _ (zero? (system* "python" "enum/test_enum.py")))
874 (home-page "https://pypi.python.org/pypi/enum34")
875 (synopsis "Backported Python 3.4 Enum")
877 "Enum34 is the new Python stdlib enum module available in Python 3.4
878 backported for previous versions of Python from 2.4 to 3.3.")
881 (define-public python-parse-type
883 (name "python-parse-type")
888 (uri (string-append "https://pypi.python.org/packages/source/p/"
889 "parse_type/parse_type-" version ".tar.gz"))
892 "0iv1c34npr4iynwpgv1vkjx9rjd18a85ir8c01gc5f7wp8iv7l1x"))))
893 (build-system python-build-system)
895 `(("python-setuptools" ,python-setuptools)
896 ("python-six" ,python-six)
897 ("python-parse" ,python-parse)
898 ("python-enum34" ,python-enum34))) ;required for python<3.4
899 (arguments '(#:tests? #f)) ;TODO: tests require pytest
900 (home-page "https://github.com/jenisys/parse_type")
901 (synopsis "Extended parse module")
903 "Parse_type extends the python parse module.")
906 (define-public python-parse
908 (name "python-parse")
913 (uri (string-append "https://pypi.python.org/packages/source/p/"
914 "parse/parse-" version ".tar.gz"))
917 "0m30q64l6szl7s9mhvqy64w2fdhdn8lb91fmacjiwbv3479cmk57"))))
918 (build-system python-build-system)
923 (lambda _ (zero? (system* "python" "test_parse.py")))
925 (home-page "https://github.com/r1chardj0n3s/parse")
926 (synopsis "Parse strings")
928 "Parse strings using a specification based on the Python format()
939 (uri (string-append "mirror://sourceforge/scons/scons-"
943 "07cjn4afb2cljjrd3cr7xf062qq58z8q96f58z6yplhdyqafsfa1"))))
944 (build-system python-build-system)
946 ;; With Python 3.x, fails to build with a syntax error.
948 #:tests? #f)) ; no 'python setup.py test' command
949 (home-page "http://scons.org/")
950 (synopsis "Software construction tool written in Python")
952 "SCons is a software construction tool. Think of SCons as an improved,
953 cross-platform substitute for the classic Make utility with integrated
954 functionality similar to autoconf/automake and compiler caches such as ccache.
955 In short, SCons is an easier, more reliable and faster way to build
959 (define-public python-extras
961 (name "python-extras")
967 "https://pypi.python.org/packages/source/e/extras/extras-"
971 "1h7zx4dfyclalg0fqnfjijpn0f793a9mx8sy3b27gd31nr6dhq3s"))))
972 (build-system python-build-system)
974 `(("python-setuptools" ,python-setuptools)))
976 ;; error in setup.cfg: command 'test' has no such option 'buffer'
978 (home-page "https://github.com/testing-cabal/extras")
979 (synopsis "Useful extensions to the Python standard library")
981 "Extras is a set of extensions to the Python standard library.")
984 (define-public python2-extras
985 (package-with-python2 python-extras))
987 (define-public python-mimeparse
989 (name "python-mimeparse")
995 "https://pypi.python.org/packages/source/p/python-mimeparse/python-mimeparse-"
999 "1hyxg09kaj02ri0rmwjqi86wk4nd1akvv7n0dx77azz76wga4s9w"))))
1000 (build-system python-build-system)
1002 `(("python-setuptools" ,python-setuptools)))
1004 '(#:tests? #f)) ; no setup.py test command
1006 "https://github.com/dbtsai/python-mimeparse")
1007 (synopsis "Python library for parsing MIME types")
1009 "Mimeparse provides basic functions for parsing MIME type names and
1010 matching them against a list of media-ranges.")
1013 (define-public python2-mimeparse
1014 (package-with-python2 python-mimeparse))
1016 (define-public python-nose
1018 (name "python-nose")
1024 "https://pypi.python.org/packages/source/n/nose/nose-"
1028 "00qymfgwg4iam4xi0w9bnv7lcb3fypq1hzfafzgs1rfmwaj67g3n"))))
1029 (build-system python-build-system)
1031 `(("python-setuptools" ,python-setuptools)))
1033 '(#:tests? #f)) ; FIXME: test suite fails
1034 (home-page "http://readthedocs.org/docs/nose/")
1035 (synopsis "Python testing library")
1037 "Nose extends the unittest library to make testing easier.")
1038 (license lgpl2.0+)))
1040 (define-public python2-nose
1041 (package-with-python2 python-nose))
1043 (define-public python-unittest2
1045 (name "python-unittest2")
1051 "https://pypi.python.org/packages/source/u/unittest2py3k/unittest2py3k-"
1055 "00yl6lskygcrddx5zspkhr0ibgvpknl4678kkm6s626539grq93q"))))
1056 (build-system python-build-system)
1058 `(("python-setuptools" ,python-setuptools)))
1059 (home-page "http://pypi.python.org/pypi/unittest2")
1060 (synopsis "Python unit testing library")
1062 "Unittest2 is a replacement for the unittest module in the Python
1066 (define-public python2-unittest2
1067 (package (inherit python-unittest2)
1068 (name "python2-unittest2")
1074 "https://pypi.python.org/packages/source/u/unittest2/unittest2-"
1078 "0wbs4i4x3x7klr3v35ss6p9mcqz883i1xgcpkhvl7n2lyv6yhpda"))))
1080 `(("python2-setuptools" ,python-setuptools)))
1082 `(#:python ,python-2
1083 #:tests? #f)))) ; no setup.py test command
1085 (define-public python-py
1093 "https://pypi.python.org/packages/source/p/py/py-"
1097 "1jkhffpai419v5rickm2vz86p9bkg3b3kcm2k4bi5wfajhw2m3xs"))))
1098 (build-system python-build-system)
1100 `(("python-setuptools" ,python-setuptools)))
1101 (home-page "http://pylib.readthedocs.org/")
1102 (synopsis "Python library for parsing, I/O, instrospection, and logging")
1104 "Py is a Python library for file name parsing, .ini file parsing, I/O,
1105 code introspection, and logging.")
1108 (define-public python2-py
1109 (package-with-python2 python-py))
1111 (define-public python-pytest
1113 (name "python-pytest")
1119 "https://pypi.python.org/packages/source/p/pytest/pytest-"
1123 "0g2w4p0n42wvz8rq4k6gnzpkakgz3g8sfanxk8jrsra9675snkcr"))
1124 (modules '((guix build utils)))
1126 ;; One of the tests involves the /usr directory, so it fails.
1127 '(substitute* "testing/test_argcomplete.py"
1128 (("def test_remove_dir_prefix\\(self\\):")
1129 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):")))))
1130 (build-system python-build-system)
1132 `(("python-setuptools" ,python-setuptools)
1133 ("python-py" ,python-py)
1134 ("python-nose" ,python-nose)
1135 ("python-mock" ,python-mock)))
1136 (home-page "http://pytest.org")
1137 (synopsis "Python testing library")
1139 "Pytest is a testing tool that provides auto-discovery of test modules
1140 and functions, detailed info on failing assert statements, modular fixtures,
1141 and many external plugins.")
1144 (define-public python2-pytest
1145 (package-with-python2 python-pytest))
1147 (define-public python-scripttest
1149 (name "python-scripttest")
1155 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
1159 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1160 (build-system python-build-system)
1162 `(("python-setuptools" ,python-setuptools)
1163 ("python-pytest" ,python-pytest)))
1164 (home-page "http://pythonpaste.org/scripttest/")
1165 (synopsis "Python library to test command-line scripts")
1166 (description "Scripttest is a Python helper library for testing
1167 interactive command-line applications. With it you can run a script in a
1168 subprocess and see the output as well as any file modifications.")
1171 (define-public python2-scripttest
1172 (package-with-python2 python-scripttest))
1174 (define-public python-testtools
1176 (name "python-testtools")
1182 "https://pypi.python.org/packages/source/t/testtools/testtools-"
1186 "1dyml28ykpl5jb9khdmcdvhy1cxqingys6qvj2k04fzlaj6z3bbx"))))
1187 (build-system python-build-system)
1189 `(("python-setuptools" ,python-setuptools)
1190 ("python-mimeparse" ,python-mimeparse)
1191 ("python-extras" ,python-extras)))
1192 (home-page "https://github.com/testing-cabal/testtools")
1194 "Extensions to the Python standard library unit testing framework")
1196 "Testtools extends the Python standard library unit testing framework to
1197 provide matchers, more debugging information, and cross-Python
1201 (define-public python2-testtools
1202 (package-with-python2 python-testtools))
1204 (define-public python-testscenarios
1206 (name "python-testscenarios")
1212 "https://pypi.python.org/packages/source/t/testscenarios/testscenarios-"
1216 "1671jvrvqlmbnc42j7pc5y6vc37q44aiwrq0zic652pxyy2fxvjg"))))
1217 (build-system python-build-system)
1219 `(("python-setuptools" ,python-setuptools)
1220 ("python-testtools" ,python-testtools)
1221 ("python-mimeparse" ,python-mimeparse)))
1222 (home-page "https://launchpad.net/testscenarios")
1223 (synopsis "Pyunit extension for dependency injection")
1225 "Testscenarios provides clean dependency injection for Python unittest
1227 (license (list bsd-3 asl2.0)))) ; at the user's option
1229 (define-public python2-testscenarios
1230 (package-with-python2 python-testscenarios))
1232 (define-public python-testresources
1234 (name "python-testresources")
1240 "https://pypi.python.org/packages/source/t/testresources/testresources-"
1244 "0cbj3plbllyz42c4b5xxgwaa7mml54lakslrn4kkhinxhdri22md"))))
1245 (build-system python-build-system)
1247 `(("python-setuptools" ,python-setuptools)))
1248 (home-page "https://launchpad.net/testresources")
1250 "Pyunit extension for managing test resources")
1252 "Testresources is an extension to Python's unittest to allow declarative
1253 use of resources by test cases.")
1254 (license (list bsd-3 asl2.0)))) ; at the user's option
1256 (define-public python2-testresources
1257 (package-with-python2 python-testresources))
1259 (define-public python-subunit
1261 (name "python-subunit")
1267 "https://pypi.python.org/packages/source/p/python-subunit/python-subunit-"
1271 "1nkw9wfbvizmpajbj3in8ns07g7lwkiv8hip14jjlwk3cacls6jv"))))
1272 (build-system python-build-system)
1274 `(("python-setuptools" ,python-setuptools)
1275 ("python-testtools" ,python-testtools)
1276 ("python-mimeparse" ,python-mimeparse)
1277 ("python-testscenarios" ,python-testscenarios)))
1278 (home-page "http://launchpad.net/subunit")
1279 (synopsis "Python implementation of the subunit protocol")
1281 "Python-subunit is a Python implementation of the subunit test streaming
1283 (license (list bsd-3 asl2.0)))) ; at the user's option
1285 (define-public python2-subunit
1286 (package-with-python2 python-subunit))
1288 (define-public python-fixtures
1290 (name "python-fixtures")
1296 "https://pypi.python.org/packages/source/f/fixtures/fixtures-"
1300 "0x9r2gwilcig5g54k60bxzg96zabizq1855lrprlb4zckalp9asc"))))
1301 (build-system python-build-system)
1303 `(("python-setuptools" ,python-setuptools)))
1305 '(#:tests? #f)) ; no setup.py test command
1306 (home-page "https://launchpad.net/python-fixtures")
1307 (synopsis "Python test fixture library")
1309 "Fixtures provides a way to create reusable state, useful when writing
1311 (license (list bsd-3 asl2.0)))) ; at user's option
1313 (define-public python2-fixtures
1314 (package-with-python2 python-fixtures))
1316 (define-public python-testrepository
1318 (name "python-testrepository")
1324 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1328 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1329 (build-system python-build-system)
1331 `(("python-setuptools" ,python-setuptools)
1332 ("python-testtools" ,python-testtools)
1333 ("python-subunit" ,python-subunit)
1334 ("python-fixtures" ,python-fixtures)
1335 ("python-mimeparse" ,python-mimeparse)))
1336 (home-page "https://launchpad.net/testrepository")
1337 (synopsis "Database for Python test results")
1338 (description "Testrepository provides a database of test results which can
1339 be used as part of a developer's workflow to check things such as what tests
1340 have failed since the last commit or what tests are currently failing.")
1341 (license (list bsd-3 asl2.0)))) ; at user's option
1343 (define-public python2-testrepository
1344 (package-with-python2 python-testrepository))
1346 (define-public python-coverage
1348 (name "python-coverage")
1354 "https://pypi.python.org/packages/source/c/coverage/coverage-"
1358 "0knlbq79g2ww6xzsyknj9rirrgrgc983dpa2d9nkdf31mb2a3bni"))))
1359 (build-system python-build-system)
1361 `(("python-setuptools" ,python-setuptools)))
1362 (home-page "http://nedbatchelder.com/code/coverage")
1363 (synopsis "Code coverage measurement for Python")
1365 "Coverage measures code coverage, typically during test execution. It
1366 uses the code analysis tools and tracing hooks provided in the Python standard
1367 library to determine which lines are executable, and which have been
1371 (define-public python2-coverage
1372 (package-with-python2 python-coverage))
1374 (define-public python-discover
1376 (name "python-discover")
1382 "https://pypi.python.org/packages/source/d/discover/discover-"
1386 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1387 (build-system python-build-system)
1389 `(("python-setuptools" ,python-setuptools)))
1390 (home-page "http://pypi.python.org/pypi/discover/")
1392 "Python test discovery for unittest")
1394 "Discover provides test discovery for unittest, a feature that has been
1395 backported from Python 2.7 for Python 2.4+")
1398 (define-public python2-discover
1399 (package-with-python2 python-discover))
1401 (define-public behave
1407 (uri (string-append "https://pypi.python.org/packages/source/b/"
1408 name "/" name "-" version ".tar.gz"))
1411 "1v2rfy8xnf0rk7cj4cgr7lam4015d458i7bg0xqs9czfv6njlm14"))))
1412 (build-system python-build-system)
1414 `(("python-setuptools" ,python-setuptools)
1415 ("python-six" ,python-six)
1416 ("python-enum43" ,python-enum34)
1417 ("python-parse" ,python-parse)
1418 ("python-parse-type" ,python-parse-type)))
1419 (arguments `(#:tests? #f)) ;TODO: tests require nose>=1.3 and
1421 (home-page "http://github.com/behave/behave")
1422 (synopsis "Python behavior-driven development")
1424 "Behave is a tool for behavior-driven development in python.
1425 Behavior-driven development (or BDD) is an agile software development
1426 technique that encourages collaboration between developers, QA and
1427 non-technical or business participants in a software project. Behave uses
1428 tests written in a natural language style, backed up by Python code.")
1431 (define-public python-exif-read
1433 (name "python-exif-read")
1439 "https://pypi.python.org/packages/source/E/ExifRead/ExifRead-"
1443 "17c627gcdmyc05hz4zk8qs4pjgw6rc68qzjzgz8gh1cmpsd7acf1"))))
1444 (build-system python-build-system)
1446 `(("python-setuptools" ,python-setuptools)))
1447 (arguments `(#:tests? #f)) ; no tests
1448 (home-page "https://github.com/ianare/exif-py")
1449 (synopsis "Python library to extract EXIF data from image files")
1451 "ExifRead is a Python library to extract EXIF data from tiff and jpeg
1455 (define-public python2-exif-read
1456 (package-with-python2 python-exif-read))
1458 (define-public python-pyld
1460 (name "python-pyld")
1466 "https://pypi.python.org/packages/source/P/PyLD/PyLD-"
1470 "1l9ymj85fsvayqplinzpk0kyiq6m74ps9xd3a9fhlxfn1rldf8x8"))))
1471 (build-system python-build-system)
1473 `(("python-setuptools" ,python-setuptools)))
1474 (arguments `(#:tests? #f)) ; no tests
1475 (home-page "http://github.com/digitalbazaar/pyld")
1476 (synopsis "Python implementation of the JSON-LD specification")
1478 "PyLD is an implementation of the JSON-LD specification.")
1481 (define-public python2-pyld
1482 (package-with-python2 python-pyld))
1484 (define-public python-certifi
1486 (name "python-certifi")
1487 (version "14.05.14")
1492 "https://pypi.python.org/packages/source/c/certifi/certifi-"
1496 "0s8vxzfz6s4m6fvxc7z25k9j35w0rh6jkw3wwcd1az1mssncn6qy"))))
1497 (build-system python-build-system)
1499 `(("python-setuptools" ,python-setuptools)))
1500 (arguments `(#:tests? #f)) ; no tests
1501 (home-page "http://python-requests.org/")
1502 (synopsis "Python CA certificate bundle")
1504 "Certifi is a Python library that contains a CA certificate bundle, which
1505 is used by the Requests library to verify HTTPS requests.")
1508 (define-public python2-certifi
1509 (package-with-python2 python-certifi))
1511 (define-public python2-requests
1513 (name "python2-requests")
1519 "https://pypi.python.org/packages/source/r/requests/requests-"
1523 "0gknlfx1wakrrm1zi8gi03x2lzj4dsns0vjw0nsmgqvkphyf01vh"))))
1524 (build-system python-build-system)
1526 `(("python-setuptools" ,python-setuptools)
1527 ("python-certifi" ,python-certifi)))
1528 (arguments `(#:tests? #f ; no tests
1529 #:python ,python-2))
1530 (home-page "http://python-requests.org/")
1531 (synopsis "Python HTTP library")
1533 "Requests is a Python HTTP client library. It aims to be easier to use
1534 than Python’s urllib2 library.")
1537 (define-public python-jsonschema
1539 (name "python-jsonschema")
1545 "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-"
1549 "1yik3031ziygvq66rj3mzfqdgxj29sg1bkfc46wsgi7lnbqs560j"))))
1550 (build-system python-build-system)
1552 `(("python-setuptools" ,python-setuptools)))
1553 (home-page "http://github.com/Julian/jsonschema")
1554 (synopsis "Implementation of JSON Schema for Python")
1556 "Jsonschema is an implementation of JSON Schema for Python.")
1559 (define-public python2-jsonschema
1560 (package-with-python2 python-jsonschema))
1562 (define-public python-unidecode
1564 (name "python-unidecode")
1570 "https://pypi.python.org/packages/source/U/Unidecode/Unidecode-"
1574 "0yv56vc49rvippyxgxvcyz7jklc07ky38rcspax7p00sgmriiljc"))))
1575 (build-system python-build-system)
1577 `(("python-setuptools" ,python-setuptools)))
1578 (home-page "https://pypi.python.org/pypi/Unidecode")
1579 (synopsis "ASCII transliterations of Unicode text")
1581 "Unidecode provides ASCII transliterations of Unicode text. Unidecode is
1582 useful when integrating with legacy code that doesn't support Unicode, or for
1583 ease of entry of non-Roman names on a US keyboard, or when constructing ASCII
1584 machine identifiers from human-readable Unicode strings that should still be
1585 somewhat intelligeble.")
1588 (define-public python2-unidecode
1589 (package-with-python2 python-unidecode))
1591 (define-public python-pyjwt
1593 (name "python-pyjwt")
1599 "https://pypi.python.org/packages/source/P/PyJWT/PyJWT-"
1603 "1ahqblfy2sj3xz34wsa48cn9rp0dspzq56p54i5znmws3b8gml6g"))))
1604 (build-system python-build-system)
1606 `(("python-setuptools" ,python-setuptools)))
1608 '(#:tests? #f)) ; test suite doesn't work
1609 (home-page "http://github.com/progrium/pyjwt")
1610 (synopsis "JSON Web Token implementation in Python")
1612 "PyJWT is a JSON Web Token implementation written in Python.")
1615 (define-public python2-pyjwt
1616 (package-with-python2 python-pyjwt))
1618 (define-public python-oauthlib
1620 (name "python-oauthlib")
1626 "https://pypi.python.org/packages/source/o/oauthlib/oauthlib-"
1630 "1yaj3j64la4arwsbhbfmpnickzh3jpg9nlpyg409v8pp24isn48a"))))
1631 (build-system python-build-system)
1633 `(("python-setuptools" ,python-setuptools)
1634 ("python-pyjwt" ,python-pyjwt)
1635 ("python-pycrypto" ,python-pycrypto)
1636 ("python-nose" ,python-nose)
1637 ("python-mock" ,python-mock)))
1638 (home-page "https://github.com/idan/oauthlib")
1639 (synopsis "OAuth implementation for Python")
1641 "Oauthlib is a generic, spec-compliant, thorough implementation of the
1642 OAuth request-signing logic.")
1645 (define-public python2-oauthlib
1646 (let ((base (package-with-python2 python-oauthlib)))
1649 (name "python2-oauthlib")
1655 "https://pypi.python.org/packages/source/o/oauthlib/oauthlib-"
1659 "1yaj3j64la4arwsbhbfmpnickzh3jpg9nlpyg409v8pp24isn48a"))))
1661 (append (package-inputs base)
1662 `(("python2-unittest2" ,python2-unittest2)))))))
1664 (define-public python-itsdangerous
1666 (name "python-itsdangerous")
1672 "https://pypi.python.org/packages/source/i/itsdangerous/itsdangerous-"
1676 "06856q6x675ly542ig0plbqcyab6ksfzijlyf1hzhgg3sgwgrcyb"))))
1677 (build-system python-build-system)
1679 `(("python-setuptools" ,python-setuptools)))
1680 (home-page "http://github.com/mitsuhiko/itsdangerous")
1681 (synopsis "Python library for passing data to/from untrusted environments")
1683 "Itsdangerous provides various helpers to pass trusted data to untrusted
1684 environments and back.")
1687 (define-public python2-itsdangerous
1688 (package-with-python2 python-itsdangerous))
1690 (define-public python-virtualenv
1692 (name "python-virtualenv")
1698 "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-"
1702 "1xq4prmg25n9cz5zcvbqx68lmc3kl39by582vd8pzs9f3qalqyiy"))))
1703 (build-system python-build-system)
1705 `(("python-setuptools" ,python-setuptools)
1706 ("python-mock" ,python-mock)
1707 ("python-nose" ,python-nose)))
1708 (home-page "https://virtualenv.pypa.io/")
1709 (synopsis "Virtual Python environment builder")
1711 "Virtualenv is a tool to create isolated Python environments.")
1714 (define-public python2-virtualenv
1715 (package-with-python2 python-virtualenv))
1717 (define-public python-markupsafe
1719 (name "python-markupsafe")
1725 "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-"
1729 "1hvip33wva3fnmvfp9x5klqri7hpl1hkgqmjbss18nmrb7zimv54"))))
1730 (build-system python-build-system)
1732 `(("python-setuptools" ,python-setuptools)))
1733 (home-page "http://github.com/mitsuhiko/markupsafe")
1734 (synopsis "XML/HTML/XHTML markup safe string implementation for Python")
1736 "Markupsafe provides an XML/HTML/XHTML markup safe string implementation
1740 (define-public python2-markupsafe
1741 (package-with-python2 python-markupsafe))
1743 (define-public python-jinja2
1745 (name "python-jinja2")
1751 "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-"
1755 "1nwg9yfqgy421lncnm63k1zf9xkd1klc0jm0fr4p3dad01fsq91f"))))
1756 (build-system python-build-system)
1758 `(("python-setuptools" ,python-setuptools)
1759 ("python-markupsafe" ,python-markupsafe)))
1760 (home-page "http://jinja.pocoo.org/")
1761 (synopsis "Python template engine")
1763 "Jinja2 is a small but fast and easy to use stand-alone template engine
1764 written in pure Python.")
1767 (define-public python2-jinja2
1768 (package-with-python2 python-jinja2))
1770 (define-public python-docutils
1772 (name "python-docutils")
1778 "https://pypi.python.org/packages/source/d/docutils/docutils-"
1782 "1ylnjnw1x4b2y7blr6x35ncdzn69k253kw4cdkv6asdb21w73ny7"))))
1783 (build-system python-build-system)
1785 `(("python-setuptools" ,python-setuptools)))
1787 '(#:tests? #f)) ; no setup.py test command
1788 (home-page "http://docutils.sourceforge.net/")
1789 (synopsis "Python Documentation Utilities")
1791 "Docutils is a modular system for processing documentation into useful
1792 formats, such as HTML, XML, and LaTeX. For input Docutils supports
1794 ;; Most of the source code is public domain, but some source files are
1795 ;; licensed under the PFSL, BSD 2-clause, and GPLv3+ licenses.
1796 (license (list public-domain psfl bsd-2 gpl3+))))
1798 (define-public python2-docutils
1799 (package-with-python2 python-docutils))
1801 (define-public python-pygments
1803 (name "python-pygments")
1809 "https://pypi.python.org/packages/source/P/Pygments/Pygments-"
1813 "1h11r6ss8waih51vcksfvzghfxiav2f8svc0812fa5kmyz5d97kr"))))
1814 (build-system python-build-system)
1816 `(("python-setuptools" ,python-setuptools)))
1817 (home-page "http://pygments.org/")
1818 (synopsis "Syntax highlighting")
1820 "Pygments is a syntax highlighting package written in Python.")
1823 (define-public python2-pygments
1824 (package-with-python2 python-pygments))
1826 (define-public python-sphinx
1828 (name "python-sphinx")
1834 "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-"
1838 "011xizm3jnmf4cvs5i6kgf6c5nn046h79i8j0vd0f27yw9j3p4wl"))))
1839 (build-system python-build-system)
1841 `(("python-setuptools" ,python-setuptools)
1842 ("python-jinja2" ,python-jinja2)
1843 ("python-docutils" ,python-docutils)
1844 ("python-pygments" ,python-pygments)))
1845 (home-page "http://sphinx-doc.org/")
1846 (synopsis "Python documentation generator")
1847 (description "Sphinx is a tool that makes it easy to create documentation
1848 for Python projects or other documents consisting of multiple reStructuredText
1852 (define-public python2-sphinx
1853 (package-with-python2 python-sphinx))
1855 (define-public python-cython
1857 (name "python-cython")
1862 (uri (string-append "http://cython.org/release/Cython-"
1866 "0ddz2l2dvcy5hdkxx4xlfiwpccvwia7ixgcy4h0pdv46a4i4vxj3"))))
1867 (build-system python-build-system)
1868 ;; we need the full python package and not just the python-wrapper
1869 ;; because we need libpython3.3m.so
1871 `(("python" ,python)))
1876 ;; some tests require access to "$HOME/.cython"
1877 (lambda* _ (setenv "HOME" "/tmp"))
1880 (lambda _ (zero? (system* "python" "runtests.py" "-vv")))
1881 %standard-phases))))
1882 (home-page "http://cython.org/")
1883 (synopsis "C extensions for Python")
1884 (description "Cython is an optimising static compiler for both the Python
1885 programming language and the extended Cython programming language. It makes
1886 writing C extensions for Python as easy as Python itself.")
1889 (define-public python2-cython
1890 (package (inherit (package-with-python2 python-cython))
1891 (name "python2-cython")
1893 `(("python-2" ,python-2))))) ; this is not automatically changed
1895 ;; This version of numpy is missing the documentation and is only used to
1896 ;; build matplotlib which is required to build numpy's documentation.
1897 (define python-numpy-bootstrap
1899 (name "python-numpy-bootstrap")
1904 (uri (string-append "mirror://sourceforge/numpy"
1905 "/numpy-" version ".tar.gz"))
1908 "070ybfvpgfmiz2hs94x445hvkh9dh52nyi0m8jp5kdihgvhbnx80"))))
1909 (build-system python-build-system)
1911 `(("python-nose" ,python-nose)
1914 `(("gfortran" ,gfortran-4.8)))
1918 'build 'set-environment-variables
1919 (lambda* (#:key inputs #:allow-other-keys)
1920 (let* ((atlas-threaded
1921 (string-append (assoc-ref inputs "atlas")
1922 "/lib/libtatlas.so"))
1923 ;; On single core CPUs only the serial library is created.
1925 (if (file-exists? atlas-threaded)
1927 (string-append (assoc-ref inputs "atlas")
1928 "/lib/libsatlas.so"))))
1929 (setenv "ATLAS" atlas-lib)))
1930 ;; Tests can only be run after the library has been installed and not
1931 ;; within the source directory.
1935 (with-directory-excursion "/tmp"
1936 (zero? (system* "python" "-c" "import numpy; numpy.test()"))))
1939 %standard-phases)))))
1940 (home-page "http://www.numpy.org/")
1941 (synopsis "Fundamental package for scientific computing with Python")
1942 (description "NumPy is the fundamental package for scientific computing
1943 with Python. It contains among other things: a powerful N-dimensional array
1944 object, sophisticated (broadcasting) functions, tools for integrating C/C++
1945 and Fortran code, useful linear algebra, Fourier transform, and random number
1949 (define python2-numpy-bootstrap
1950 (package-with-python2 python-numpy-bootstrap))
1952 (define-public python-numpy
1953 (package (inherit python-numpy-bootstrap)
1954 (name "python-numpy")
1955 (outputs '("out" "doc"))
1958 ("python-setuptools" ,python-setuptools)
1959 ("python-matplotlib" ,python-matplotlib)
1960 ("python-sphinx" ,python-sphinx)
1961 ("python-pyparsing" ,python-pyparsing)
1962 ("python-numpydoc" ,python-numpydoc)
1963 ,@(package-inputs python-numpy-bootstrap)))
1965 `(("pkg-config" ,pkg-config)
1966 ("texlive" ,texlive)
1967 ("texinfo" ,texinfo)
1969 ,@(package-native-inputs python-numpy-bootstrap)))
1971 `(,@(substitute-keyword-arguments
1972 (package-arguments python-numpy-bootstrap)
1975 'install 'install-doc
1976 (lambda* (#:key outputs #:allow-other-keys)
1977 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
1979 data "/doc/" ,name "-"
1980 ,(package-version python-numpy-bootstrap)))
1981 (info (string-append data "/info"))
1982 (html (string-append doc "/html"))
1983 (pyver ,(string-append "PYVER=")))
1984 (with-directory-excursion "doc"
1986 (system* "make" "html" pyver)
1987 (system* "make" "latex" "PAPER=a4" pyver)
1988 (system* "make" "-C" "build/latex"
1989 "all-pdf" "PAPER=a4" pyver)
1990 ;; FIXME: Generation of the info file fails.
1991 ;; (system* "make" "info" pyver)
1993 ;; (copy-file "build/texinfo/numpy.info"
1994 ;; (string-append info "/numpy.info"))
1995 (for-each (lambda (file)
1996 (copy-file (string-append "build/latex" file)
1997 (string-append doc file)))
1998 '("/numpy-ref.pdf" "/numpy-user.pdf"))
1999 (with-directory-excursion "build/html"
2000 (for-each (lambda (file)
2001 (let* ((dir (dirname file))
2002 (tgt-dir (string-append html "/" dir)))
2003 (unless (equal? "." dir)
2005 (copy-file file (string-append html "/" file))))
2006 (find-files "." ".*"))))))
2009 (define-public python2-numpy
2010 (let ((numpy (package-with-python2 python-numpy)))
2011 (package (inherit numpy)
2012 ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is customized for
2013 ;; Python 2. Since it is also an input to PYTHON2-MATPLOTLIB, we need to
2014 ;; import the right version of 'matplotlib' as well.
2015 (inputs `(("python2-numpydoc" ,python2-numpydoc)
2016 ("python2-matplotlib" ,python2-matplotlib)
2017 ,@(alist-delete "python-numpydoc"
2018 (alist-delete "python-matplotlib"
2019 (package-inputs numpy))))))))
2021 (define-public python-pyparsing
2023 (name "python-pyparsing")
2028 (uri (string-append "mirror://sourceforge/pyparsing"
2029 "/pyparsing-" version ".tar.gz"))
2032 "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p"))))
2033 (build-system python-build-system)
2034 (outputs '("out" "doc"))
2036 `(#:tests? #f ; no test target
2037 #:modules ((guix build python-build-system)
2041 'install 'install-doc
2042 (lambda* (#:key outputs #:allow-other-keys)
2043 (let* ((doc (string-append (assoc-ref outputs "doc")
2044 "/share/doc/" ,name "-" ,version))
2045 (html-doc (string-append doc "/html"))
2046 (examples (string-append doc "/examples")))
2052 (copy-file file (string-append tgt "/" (basename file))))
2053 (find-files dir ".*")))
2054 (list "docs" "htmldoc" "examples")
2055 (list doc html-doc examples))))
2057 (home-page "http://pyparsing.wikispaces.com")
2058 (synopsis "Python parsing class library")
2060 "The pyparsing module is an alternative approach to creating and
2061 executing simple grammars, vs. the traditional lex/yacc approach, or the use
2062 of regular expressions. The pyparsing module provides a library of classes
2063 that client code uses to construct the grammar directly in Python code.")
2066 (define-public python2-pyparsing
2067 (package-with-python2 python-pyparsing))
2069 (define-public python-numpydoc
2071 (name "python-numpydoc")
2077 "https://pypi.python.org/packages/source/n/numpydoc/numpydoc-"
2081 "0d4dnifaxkll50jx6czj05y8cb4ny60njd2wz299sj2jxfy51w4k"))))
2082 (build-system python-build-system)
2084 `(("python-setuptools" ,python-setuptools)
2085 ("python-docutils" ,python-docutils)
2086 ("python-sphinx" ,python-sphinx)
2087 ("python-nose" ,python-nose)))
2088 (home-page "https://pypi.python.org/pypi/numpydoc")
2090 "Numpy's Sphinx extensions")
2092 "Sphinx extension to support docstrings in Numpy format.")
2095 (define-public python2-numpydoc
2097 (inherit (package-with-python2 python-numpydoc))
2098 ;; With python-2 1 test (out of 30) fails because it doesn't find
2099 ;; matplotlib. With python-3 it seems to detect at run-time the absence
2101 (arguments `(#:tests? #f
2102 #:python ,python-2))))
2104 (define-public python-matplotlib
2106 (name "python-matplotlib")
2111 (uri (string-append "mirror://sourceforge/matplotlib"
2112 "/matplotlib-" version ".tar.gz"))
2115 "0m6v9nwdldlwk22gcd339zg6mny5m301fxgks7z8sb8m9wawg8qp"))))
2116 (build-system python-build-system)
2117 (outputs '("out" "doc"))
2119 `(("python-setuptools" ,python-setuptools)
2120 ("python-dateutil" ,python-dateutil-2)
2121 ("python-pyparsing" ,python-pyparsing)
2122 ("python-six" ,python-six)
2123 ("python-pytz" ,python-pytz)
2124 ("python-numpy" ,python-numpy-bootstrap)
2125 ("python-sphinx" ,python-sphinx)
2126 ("python-numpydoc" ,python-numpydoc)
2127 ("python-nose" ,python-nose)
2128 ("python-mock" ,python-mock)
2130 ("imagemagick" ,imagemagick)
2131 ("freetype" ,freetype)
2132 ;; FIXME: Add backends when available.
2133 ;("python-pygtk" ,python-pygtk)
2134 ;("python-pycairo" ,python-pycairo)
2135 ;("python-pygobject" ,python-pygobject)
2136 ;("python-wxpython" ,python-wxpython)
2137 ;("python-pyqt" ,python-pyqt)
2140 `(("pkg-config" ,pkg-config)
2141 ("texlive" ,texlive)
2142 ("texinfo" ,texinfo)))
2146 'install 'install-doc
2147 (lambda* (#:key outputs #:allow-other-keys)
2148 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
2149 (doc (string-append data "/doc/" ,name "-" ,version))
2150 (info (string-append data "/info"))
2151 (html (string-append doc "/html")))
2152 (with-directory-excursion "doc"
2153 ;; Without setting this variable we get an encoding error.
2154 (setenv "LANG" "en_US.UTF-8")
2155 ;; Produce pdf in 'A4' format.
2156 (substitute* (find-files "." "conf\\.py")
2157 (("latex_paper_size = 'letter'")
2158 "latex_paper_size = 'a4'"))
2161 ;; The doc recommends to run the 'html' target twice.
2162 (system* "python" "make.py" "html")
2163 (system* "python" "make.py" "html")
2164 (system* "python" "make.py" "latex")
2165 (system* "python" "make.py" "texinfo")
2166 (copy-file "build/texinfo/matplotlib.info"
2167 (string-append info "/matplotlib.info"))
2168 (copy-file "build/latex/Matplotlib.pdf"
2169 (string-append doc "/Matplotlib.pdf"))
2170 (with-directory-excursion "build/html"
2172 (let* ((dir (dirname file))
2173 (tgt-dir (string-append html "/" dir)))
2174 (unless (equal? "." dir)
2176 (copy-file file (string-append html "/" file))))
2177 (find-files "." ".*"))))))
2179 (home-page "http://matplotlib.org")
2180 (synopsis "2D plotting library for Python")
2182 "Matplotlib is a Python 2D plotting library which produces publication
2183 quality figures in a variety of hardcopy formats and interactive environments
2184 across platforms. Matplotlib can be used in Python scripts, the python and
2185 ipython shell, web application servers, and six graphical user interface
2189 (define-public python2-matplotlib
2190 (let ((matplotlib (package-with-python2 python-matplotlib)))
2191 (package (inherit matplotlib)
2192 ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is
2193 ;; customized for Python 2.
2194 (inputs `(("python2-numpydoc" ,python2-numpydoc)
2195 ,@(alist-delete "python-numpydoc"
2196 (package-inputs matplotlib)))))))
2198 (define-public python-sqlalchemy
2200 (name "python-sqlalchemy")
2205 (uri (string-append "https://pypi.python.org/packages/source/S/"
2206 "SQLAlchemy/SQLAlchemy-" version ".tar.gz"))
2209 "059ayifj5l08v6vv56anhyibyllscn10dlzr2fcw68gz1hfjdzsz"))))
2210 (build-system python-build-system)
2212 `(("python-cython" ,python-cython) ;for c extensions
2213 ("python-pytest" ,python-pytest)
2214 ("python-mock" ,python-mock))) ;for tests
2216 `(#:phases (alist-replace
2218 (lambda _ (zero? (system* "py.test")))
2220 (home-page "http://www.sqlalchemy.org")
2221 (synopsis "Database abstraction library")
2223 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2224 gives application developers the full power and flexibility of SQL. It
2225 provides a full suite of well known enterprise-level persistence patterns,
2226 designed for efficient and high-performing database access, adapted into a
2227 simple and Pythonic domain language.")
2230 (define-public python2-sqlalchemy
2231 (package-with-python2 python-sqlalchemy))
2233 (define-public python-pillow
2235 (name "python-pillow")
2240 (uri (string-append "https://pypi.python.org/packages/source/P/"
2241 "Pillow/Pillow-" version ".tar.gz"))
2244 "0iw36c73wkhz88wa78v6l43llsb080ihw8yq7adhfqxdib7l4hzr"))))
2245 (build-system python-build-system)
2247 `(("python-setuptools" ,python-setuptools)
2248 ("python-nose" ,python-nose)))
2252 ("libjpeg" ,libjpeg)
2253 ("openjpeg" ,openjpeg)
2254 ("libtiff" ,libtiff)))
2256 `(;; Used at runtime for pkg_resources
2257 ("python-setuptools" ,python-setuptools)))
2259 `(#:phases (alist-cons-after
2260 'install 'check-installed
2263 (setenv "HOME" (getcwd))
2264 (and (zero? (system* "python" "selftest.py" "--installed"))
2265 (zero? (system* "python" "test-installed.py")))))
2266 (alist-delete 'check %standard-phases))))
2267 (home-page "https://pypi.python.org/pypi/Pillow")
2268 (synopsis "Fork of the Python Imaging Library")
2270 "The Python Imaging Library adds image processing capabilities to your
2271 Python interpreter. This library provides extensive file format support, an
2272 efficient internal representation, and fairly powerful image processing
2273 capabilities. The core image library is designed for fast access to data
2274 stored in a few basic pixel formats. It should provide a solid foundation for
2275 a general image processing tool.")
2277 "http://www.pythonware.com/products/pil/license.htm"
2278 "The PIL Software License"))))
2280 (define-public python2-pillow
2281 (package-with-python2 python-pillow))