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