gnu: python-html5lib: Add propagated input.
[jackhill/guix/guix.git] / gnu / packages / python.scm
index 2f518d9..bbff241 100644 (file)
@@ -1,10 +1,13 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2014, 2015 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2015 Omar Radwan <toxemicsquire4@gmail.com>
+;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu>
+;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages python)
   #:use-module ((guix licenses)
-                #:select (asl2.0 bsd-3 bsd-2 bsd-style cc0 expat x11 x11-style
+                #:select (asl2.0 bsd-3 bsd-2 bsd-style cc0 x11 x11-style
                           gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+
-                          psfl public-domain))
-  #:use-module ((guix licenses) #:select (zlib) #:prefix license:)
+                          psfl public-domain x11-style))
+  #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages elf)
+  #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gdbm)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages libffi)
-  #:use-module (gnu packages readline)
-  #:use-module (gnu packages openssl)
-  #:use-module (gnu packages elf)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
-  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages openssl)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages databases)
-  #:use-module (gnu packages zip)
-  #:use-module (gnu packages ghostscript)
-  #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages readline)
   #:use-module (gnu packages texlive)
   #:use-module (gnu packages texinfo)
-  #:use-module (gnu packages image)
-  #:use-module (gnu packages imagemagick)
-  #:use-module (gnu packages fontutils)
   #:use-module (gnu packages which)
-  #:use-module (gnu packages perl)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
-  #:use-module (gnu packages glib)
-  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages zip)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -339,7 +342,7 @@ etc. ")
     (description
      "The lockfile package exports a LockFile class which provides a simple
 API for locking files.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-lockfile
   (package-with-python2 python-lockfile))
@@ -364,7 +367,7 @@ API for locking files.")
      "Mock is a library for testing in Python.  It allows you to replace parts
 of your system under test with mock objects and make assertions about how they
 have been used.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-mock
   (package-with-python2 python-mock))
@@ -373,7 +376,7 @@ have been used.")
 (define-public python-setuptools
   (package
     (name "python-setuptools")
-    (version "1.1.4")
+    (version "12.1")
     (source
      (origin
       (method url-fetch)
@@ -381,14 +384,12 @@ have been used.")
                           version ".tar.gz"))
       (sha256
        (base32
-        "0hl9sa5xr9bi2ifq51wy1bawsjv5nzvpbac7m9z1ciz778874csf"))))
+        "04bfk7si1pwj3b5k2b1x9b1zkiclybmzpw6alrs5bciri56lg9zs"))))
     (build-system python-build-system)
+    ;; FIXME: Tests require pytest, which itself relies on setuptools.
+    ;; One could bootstrap with an internal untested setuptools.
     (arguments
      `(#:tests? #f))
-         ;;FIXME: test_sdist_with_utf8_encoded_filename fails in
-         ;; /tmp/nix-build-python2-setuptools-1.1.4.drv-0/setuptools-1.1.4/setuptools/tests/test_sdist.py"
-         ;; line 354
-         ;; The tests pass with Python 2.7.5.
     (home-page "https://pypi.python.org/pypi/setuptools")
     (synopsis
      "Library designed to facilitate packaging Python projects")
@@ -506,6 +507,9 @@ Six supports every Python version since 2.5.  It is contained in only one
 Python file, so it can be easily copied into your project.")
     (license x11)))
 
+(define-public python2-six
+  (package-with-python2 python-six))
+
 (define-public python-dateutil-2
   (package
     (name "python-dateutil")
@@ -651,7 +655,7 @@ under several distributions that's hard or impossible to figure out.")
      "Pysam is a Python module for reading and manipulating files in the
 SAM/BAM format.  Pysam is a lightweight wrapper of the SAMtools C API.  It
 also includes an interface for tabix.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-pysam
   (package-with-python2 python-pysam))
@@ -1021,7 +1025,7 @@ software.")
     (synopsis "Useful extensions to the Python standard library")
     (description
      "Extras is a set of extensions to the Python standard library.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-extras
   (package-with-python2 python-extras))
@@ -1050,7 +1054,7 @@ software.")
     (description
      "Mimeparse provides basic functions for parsing MIME type names and
 matching them against a list of media-ranges.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-mimeparse
   (package-with-python2 python-mimeparse))
@@ -1145,7 +1149,7 @@ standard library.")
     (description
      "Py is a Python library for file name parsing, .ini file parsing, I/O,
 code introspection, and logging.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-py
   (package-with-python2 python-py))
@@ -1181,7 +1185,7 @@ code introspection, and logging.")
      "Pytest is a testing tool that provides auto-discovery of test modules
 and functions, detailed info on failing assert statements, modular fixtures,
 and many external plugins.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-pytest
   (package-with-python2 python-pytest))
@@ -1208,7 +1212,7 @@ and many external plugins.")
     (description "Scripttest is a Python helper library for testing
 interactive command-line applications.  With it you can run a script in a
 subprocess and see the output as well as any file modifications.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-scripttest
   (package-with-python2 python-scripttest))
@@ -1596,7 +1600,7 @@ than Python’s urllib2 library.")
     (synopsis "Implementation of JSON Schema for Python")
     (description
      "Jsonschema is an implementation of JSON Schema for Python.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-jsonschema
   (package-with-python2 python-jsonschema))
@@ -1652,7 +1656,7 @@ somewhat intelligeble.")
     (synopsis "JSON Web Token implementation in Python")
     (description
      "PyJWT is a JSON Web Token implementation written in Python.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-pyjwt
   (package-with-python2 python-pyjwt))
@@ -1688,17 +1692,6 @@ OAuth request-signing logic.")
   (let ((base (package-with-python2 python-oauthlib)))
     (package
       (inherit base)
-      (name "python2-oauthlib")
-      (version "0.6.3")
-      (source (origin
-                (method url-fetch)
-                (uri
-                 (string-append
-                  "https://pypi.python.org/packages/source/o/oauthlib/oauthlib-"
-                  version ".tar.gz"))
-                (sha256
-                 (base32
-                  "1yaj3j64la4arwsbhbfmpnickzh3jpg9nlpyg409v8pp24isn48a"))))
       (inputs
        (append (package-inputs base)
                `(("python2-unittest2" ,python2-unittest2)))))))
@@ -1751,7 +1744,7 @@ environments and back.")
     (synopsis "Virtual Python environment builder")
     (description
      "Virtualenv is a tool to create isolated Python environments.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-virtualenv
   (package-with-python2 python-virtualenv))
@@ -1894,6 +1887,39 @@ sources.")
 (define-public python2-sphinx
   (package-with-python2 python-sphinx))
 
+(define-public python-sphinx-rtd-theme
+  (package
+    (name "python-sphinx-rtd-theme")
+    (version "0.1.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://pypi.python.org/packages/source/s/"
+                           "sphinx_rtd_theme/sphinx_rtd_theme-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "19nw3rn7awplcdrz63kg1njqwkbymfg9lwn7l2grhdyhyr2gaa8g"))))
+    (build-system python-build-system)
+    (arguments
+     `(;; With standard flags, the install phase attempts to create a zip'd
+       ;; egg file, and fails with an error: 'ZIP does not support timestamps
+       ;; before 1980'
+       #:configure-flags '("--single-version-externally-managed"
+                           "--record=sphinx-rtd-theme.txt")))
+    (native-inputs
+     `(("python-setuptools" ,python-setuptools)))
+    (inputs
+     `(("python-docutils" ,python-docutils)
+       ("python-sphinx" ,python-sphinx)))
+    (home-page "https://github.com/snide/sphinx_rtd_theme/")
+    (synopsis "ReadTheDocs.org theme for Sphinx")
+    (description "A theme for Sphinx used by ReadTheDocs.org.")
+    (license license:expat)))
+
+(define-public python2-sphinx-rtd-theme
+  (package-with-python2 python-sphinx-rtd-theme))
+
 (define-public python-cython
   (package
     (name "python-cython")
@@ -1960,25 +1986,25 @@ writing C extensions for Python as easy as Python itself.")
         'build 'set-environment-variables
         (lambda* (#:key inputs #:allow-other-keys)
           (let* ((atlas-threaded
-                  (string-append (assoc-ref inputs "atlas") 
+                  (string-append (assoc-ref inputs "atlas")
                                  "/lib/libtatlas.so"))
                  ;; On single core CPUs only the serial library is created.
                  (atlas-lib
                   (if (file-exists? atlas-threaded)
                       atlas-threaded
-                      (string-append (assoc-ref inputs "atlas") 
+                      (string-append (assoc-ref inputs "atlas")
                                      "/lib/libsatlas.so"))))
             (setenv "ATLAS" atlas-lib)))
         ;; Tests can only be run after the library has been installed and not
         ;; within the source directory.
         (alist-cons-after
          'install 'check
-         (lambda _ 
+         (lambda _
            (with-directory-excursion "/tmp"
-             (zero? (system* "python" "-c" 
+             (zero? (system* "python" "-c"
                              "import numpy; numpy.test(verbose=2)"))))
-         (alist-delete 
-          'check 
+         (alist-delete
+          'check
           %standard-phases)))))
     (home-page "http://www.numpy.org/")
     (synopsis "Fundamental package for scientific computing with Python")
@@ -1996,7 +2022,7 @@ capabilities.")
   (package (inherit python-numpy-bootstrap)
     (name "python-numpy")
     (outputs '("out" "doc"))
-    (inputs 
+    (inputs
      `(("which" ,which)
        ("python-setuptools" ,python-setuptools)
        ("python-matplotlib" ,python-matplotlib)
@@ -2011,15 +2037,15 @@ capabilities.")
        ("perl" ,perl)
        ,@(package-native-inputs python-numpy-bootstrap)))
     (arguments
-     `(,@(substitute-keyword-arguments 
+     `(,@(substitute-keyword-arguments
              (package-arguments python-numpy-bootstrap)
            ((#:phases phases)
             `(alist-cons-after
               'install 'install-doc
               (lambda* (#:key outputs #:allow-other-keys)
                 (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                       (doc (string-append 
-                             data "/doc/" ,name "-" 
+                       (doc (string-append
+                             data "/doc/" ,name "-"
                              ,(package-version python-numpy-bootstrap)))
                        (info (string-append data "/info"))
                        (html (string-append doc "/html"))
@@ -2028,7 +2054,7 @@ capabilities.")
                     (mkdir-p html)
                     (system* "make" "html" pyver)
                     (system* "make" "latex" "PAPER=a4" pyver)
-                    (system* "make" "-C" "build/latex" 
+                    (system* "make" "-C" "build/latex"
                              "all-pdf" "PAPER=a4" pyver)
                     ;; FIXME: Generation of the info file fails.
                     ;; (system* "make" "info" pyver)
@@ -2057,14 +2083,14 @@ capabilities.")
       ;; import the right version of 'matplotlib' as well.
       (inputs `(("python2-numpydoc" ,python2-numpydoc)
                 ("python2-matplotlib" ,python2-matplotlib)
-                ,@(alist-delete "python-numpydoc" 
+                ,@(alist-delete "python-numpydoc"
                                 (alist-delete "python-matplotlib"
                                               (package-inputs numpy))))))))
 
 (define-public python-pyparsing
   (package
     (name "python-pyparsing")
-    (version "2.0.2")
+    (version "2.0.3")
     (source
      (origin
        (method url-fetch)
@@ -2072,7 +2098,7 @@ capabilities.")
                            "/pyparsing-" version ".tar.gz"))
        (sha256
         (base32
-         "01lasib0n2fp2k99c988qhz16lm9hcwmnmrmhybdb3jq2xmkvr0p"))))
+         "0kw4py7gn45j93q8r7bzajfrjdc3xlsn2yzln41lf9zmrghjkrq6"))))
     (build-system python-build-system)
     (outputs '("out" "doc"))
     (arguments
@@ -2083,15 +2109,15 @@ capabilities.")
        (alist-cons-after
         'install 'install-doc
         (lambda* (#:key outputs #:allow-other-keys)
-          (let* ((doc (string-append (assoc-ref outputs "doc") 
+          (let* ((doc (string-append (assoc-ref outputs "doc")
                                      "/share/doc/" ,name "-" ,version))
                  (html-doc (string-append doc "/html"))
                  (examples (string-append doc "/examples")))
             (mkdir-p html-doc)
             (mkdir-p examples)
-            (for-each 
+            (for-each
              (lambda (dir tgt)
-               (map (lambda (file) 
+               (map (lambda (file)
                       (copy-file file (string-append tgt "/" (basename file))))
                     (find-files dir ".*")))
              (list "docs" "htmldoc" "examples")
@@ -2104,7 +2130,7 @@ capabilities.")
 executing simple grammars, vs. the traditional lex/yacc approach, or the use
 of regular expressions.  The pyparsing module provides a library of classes
 that client code uses to construct the grammar directly in Python code.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-pyparsing
   (package-with-python2 python-pyparsing))
@@ -2116,7 +2142,7 @@ that client code uses to construct the grammar directly in Python code.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append 
+       (uri (string-append
              "https://pypi.python.org/packages/source/n/numpydoc/numpydoc-"
              version ".tar.gz"))
        (sha256
@@ -2136,7 +2162,7 @@ that client code uses to construct the grammar directly in Python code.")
     (license bsd-2)))
 
 (define-public python2-numpydoc
-  (package 
+  (package
     (inherit (package-with-python2 python-numpydoc))
     ;; With python-2 1 test (out of 30) fails because it doesn't find
     ;; matplotlib.  With python-3 it seems to detect at run-time the absence
@@ -2192,7 +2218,7 @@ that client code uses to construct the grammar directly in Python code.")
        ("freetype" ,freetype)
        ("cairo" ,cairo)
        ("glib" ,glib)
-       ;("python-pillow" ,python-pillow)
+       ("python-pillow" ,python-pillow)
        ;; FIXME: Add backends when available.
        ;("python-wxpython" ,python-wxpython)
        ;("python-pyqt" ,python-pyqt)
@@ -2225,7 +2251,11 @@ backend = GTK3Agg~%")))))
                   (info (string-append data "/info"))
                   (html (string-append doc "/html")))
              (with-directory-excursion "doc"
-               ;; Without setting this variable we get an encoding error.
+               ;; Install and set UTF-8 locale to avoid an encoding error.
+               (setenv "LOCPATH" (getcwd))
+               (system* "localedef" "--no-archive"
+                        "--prefix" (getcwd) "-i" "en_US"
+                        "-f" "UTF-8" "./en_US.UTF-8")
                (setenv "LANG" "en_US.UTF-8")
                ;; Produce pdf in 'A4' format.
                (substitute* (find-files "." "conf\\.py")
@@ -2259,16 +2289,16 @@ toolkits.")
     (package (inherit matplotlib)
       ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is
       ;; customized for Python 2.
-      (propagated-inputs 
+      (propagated-inputs
        `(("python2-py2cairo" ,python2-py2cairo)
          ("python2-pygobject-2" ,python2-pygobject-2)
          ,@(alist-delete "python-pycairo"
                          (alist-delete "python-pygobject"
-                                       (package-propagated-inputs 
+                                       (package-propagated-inputs
                                         matplotlib)))))
-      (inputs 
+      (inputs
        `(("python2-numpydoc" ,python2-numpydoc)
-         ,@(alist-delete "python-numpydoc" 
+         ,@(alist-delete "python-numpydoc"
                          (package-inputs matplotlib)))))))
 
 (define-public python-scipy
@@ -2302,13 +2332,13 @@ toolkits.")
         'build 'set-environment-variables
         (lambda* (#:key inputs #:allow-other-keys)
           (let* ((atlas-threaded
-                  (string-append (assoc-ref inputs "atlas") 
+                  (string-append (assoc-ref inputs "atlas")
                                  "/lib/libtatlas.so"))
                  ;; On single core CPUs only the serial library is created.
                  (atlas-lib
                   (if (file-exists? atlas-threaded)
                       atlas-threaded
-                      (string-append (assoc-ref inputs "atlas") 
+                      (string-append (assoc-ref inputs "atlas")
                                      "/lib/libsatlas.so"))))
             (setenv "ATLAS" atlas-lib)))
         (alist-cons-after
@@ -2319,7 +2349,11 @@ toolkits.")
                   (html (string-append doc "/html"))
                   (pyver ,(string-append "PYVER=")))
              (with-directory-excursion "doc"
-               ;; Without setting this variable we get an encoding error.
+               ;; Install and set UTF-8 locale to avoid an encoding error.
+               (setenv "LOCPATH" (getcwd))
+               (system* "localedef" "--no-archive"
+                        "--prefix" (getcwd) "-i" "en_US"
+                        "-f" "UTF-8" "./en_US.UTF-8")
                (setenv "LANG" "en_US.UTF-8")
                ;; Fix generation of images for mathematical expressions.
                (substitute* (find-files "source" "conf\\.py")
@@ -2343,11 +2377,11 @@ toolkits.")
          ;; within the source directory.
          (alist-cons-after
           'install 'check
-          (lambda _ 
+          (lambda _
             (with-directory-excursion "/tmp"
               (zero? (system* "python" "-c" "import scipy; scipy.test()"))))
-          (alist-delete 
-           'check 
+          (alist-delete
+           'check
            %standard-phases))))))
     (home-page "http://www.scipy.org/")
     (synopsis "The Scipy library provides efficient numerical routines")
@@ -2362,8 +2396,8 @@ routines such as routines for numerical integration and optimization.")
       ;; Use packages customized for python-2.
       (inputs `(("python2-matplotlib" ,python2-matplotlib)
                 ("python2-numpy" ,python2-numpy)
-                ,@(alist-delete "python-matplotlib" 
-                                (alist-delete "python-numpy" 
+                ,@(alist-delete "python-matplotlib"
+                                (alist-delete "python-numpy"
                                               (package-inputs scipy))))))))
 
 (define-public python-sqlalchemy
@@ -2530,7 +2564,7 @@ a general image processing tool.")
      `(("pkg-config" ,pkg-config)
        ("python-setuptools" ,python-setuptools)))
     (arguments
-     `(#:phases 
+     `(#:phases
        (alist-replace
         'check
         (lambda _
@@ -2569,7 +2603,7 @@ a front-end for C compilers or analysis tools.")
       (method url-fetch)
       (uri (string-append "https://pypi.python.org/packages/source/c/"
                           "cffi/cffi-" version ".tar.gz"))
-      (sha256 
+      (sha256
        (base32 "0406j3sgndmx88idv5zxkkrwfqxmjl18pj8gf47nsg4ymzixjci5"))))
     (build-system python-build-system)
     (outputs '("out" "doc"))
@@ -2583,7 +2617,7 @@ a front-end for C compilers or analysis tools.")
        ("python-setuptools" ,python-setuptools)))
     (arguments
      `(#:tests? #f ; FIXME: requires pytest
-       #:phases 
+       #:phases
        (alist-cons-after
         'install 'install-doc
         (lambda* (#:key outputs #:allow-other-keys)
@@ -2600,7 +2634,7 @@ a front-end for C compilers or analysis tools.")
     (synopsis "Foreign function interface for Python")
     (description
      "Foreign Function Interface for Python calling C code.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-cffi
   (package-with-python2 python-cffi))
@@ -2626,7 +2660,7 @@ a front-end for C compilers or analysis tools.")
     (propagated-inputs
      `(("python-cffi" ,python-cffi))) ; used at run time
     (arguments
-     `(#:phases 
+     `(#:phases
        (alist-cons-after
         'install 'install-doc
         (lambda* (#:key outputs #:allow-other-keys)
@@ -2641,7 +2675,7 @@ a front-end for C compilers or analysis tools.")
     (description
      "Xcffib is a replacement for xpyb, an XCB Python bindings.  It adds
 support for Python 3 and PyPy.  It is based on cffi.")
-    (license expat)))
+    (license license:expat)))
 
 (define-public python2-xcffib
   (package-with-python2 python-xcffib))
@@ -2672,14 +2706,14 @@ support for Python 3 and PyPy.  It is based on cffi.")
     (propagated-inputs
      `(("python-xcffib" ,python-xcffib))) ; used at run time
     (arguments
-     `(#:phases 
+     `(#:phases
        (alist-cons-after
         'install 'install-doc
         (lambda* (#:key inputs outputs #:allow-other-keys)
           (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
                  (doc (string-append data "/doc/" ,name "-" ,version))
                  (html (string-append doc "/html")))
-            (setenv "LD_LIBRARY_PATH" 
+            (setenv "LD_LIBRARY_PATH"
                     (string-append (assoc-ref inputs "cairo") "/lib" ":"
                                    (assoc-ref inputs "gdk-pixbuf") "/lib"))
             (setenv "LANG" "en_US.UTF-8")
@@ -2730,7 +2764,7 @@ PNG, PostScript, PDF, and SVG file output.")
        ("texinfo" ,texinfo)
        ("python-setuptools" ,python-setuptools)))
     (arguments
-     `(#:phases 
+     `(#:phases
        (alist-cons-after
         'install 'install-doc
         (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -2766,8 +2800,8 @@ PNG, PostScript, PDF, and SVG file output.")
            ;;   (zero? (system* (string-append (assoc-ref outputs "out")
            ;;                                  "/bin/iptest"))))
            #t)
-         (alist-delete 
-          'check 
+         (alist-delete
+          'check
           %standard-phases)))))
     (home-page "http://ipython.org")
     (synopsis "IPython is a tool for interactive computing in Python")
@@ -2782,9 +2816,394 @@ computing.")
   (let ((ipython (package-with-python2 python-ipython)))
     (package (inherit ipython)
       ;; Make sure we use custom python2-NAME packages.
-      (inputs 
+      (inputs
        `(("python2-numpydoc" ,python2-numpydoc)
          ("python2-matplotlib" ,python2-matplotlib)
          ,@(alist-delete "python-numpydoc"
                          (alist-delete "python-matplotlib"
                                        (package-inputs ipython))))))))
+
+(define-public python-isodate
+  (package
+    (name "python-isodate")
+    (version "0.5.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/i/isodate/isodate-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "1yqjn0is0p64cmk9xhq4hc6q06jk86d60kg2jws58d78q0qysami"))))
+    (build-system python-build-system)
+    (inputs
+      `(("python-setuptools" ,python-setuptools)))
+    (home-page
+      "http://cheeseshop.python.org/pypi/isodate")
+    (synopsis
+      "Python date parser and formatter")
+    (description
+      "Python-isodate is a python module for parsing and formatting
+ISO 8601 dates, time and duration.")
+    (license bsd-3)))
+
+(define-public python2-isodate
+  (package-with-python2 python-isodate))
+
+(define-public python-html5lib
+  (package
+    (name "python-html5lib")
+    (version "1.0b3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/h/html5lib/html5lib-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "1l5i6xzckzx4hnh9qzv9q3kyhkgjx2hsi2k9srgci3qizjmvp6ln"))))
+    (build-system python-build-system)
+    (propagated-inputs
+      `(("python-six" ,python-six))) ; required to "import html5lib"
+    (inputs
+      `(("python-setuptools" ,python-setuptools)))
+    (arguments
+     `(#:test-target "check"))
+    (home-page
+      "https://github.com/html5lib/html5lib-python")
+    (synopsis
+      "Python HTML parser based on the WHATWG HTML specifcation")
+    (description
+      "Html5lib is an HTML parser based on the WHATWG HTML specifcation
+and written in Python.")
+    (license license:expat)))
+
+(define-public python2-html5lib
+  (package-with-python2 python-html5lib))
+
+(define-public python-urwid
+  (package
+    (name "python-urwid")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/source/u/urwid/urwid-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "18mb0yy94sjc434rd61m2sfnw27sa0nyrszpj5a9r9zh7fnlzw19"))))
+    (build-system python-build-system)
+    (native-inputs `(("python-setuptools" ,python-setuptools)))
+    (home-page "http://urwid.org")
+    (synopsis "Console user interface library for Python")
+    (description
+     "Urwid is a curses-based UI/widget library for Python.  It includes many
+features useful for text console applications.")
+    (license lgpl2.1+)))
+
+(define-public python2-urwid
+  (package-with-python2 python-urwid))
+
+(define-public python-dbus
+  (package
+    (name "python-dbus")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-"
+             version ".tar.gz"))
+       (sha256
+        (base32 "1py62qir966lvdkngg0v8k1khsqxwk5m4s8nflpk1agk5f5nqb71"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("python" ,python)
+       ("dbus" ,dbus)
+       ("dbus-glib" ,dbus-glib)
+       ("glib" ,glib)))
+    (synopsis "Python bindings for D-bus")
+    (description "python-dbus provides bindings for libdbus, the reference
+implementation of D-Bus.")
+    (home-page "http://www.freedesktop.org/wiki/Software/DBusBindings/")
+    (license license:expat)))
+
+(define-public python2-dbus
+  (package (inherit python-dbus)
+    (name "python2-dbus")
+    (inputs `(("python" ,python-2)
+              ,@(alist-delete "python"
+                              (package-inputs python-dbus)
+                              equal?)))
+    ;; FIXME: on Python 2, the test_utf8 fails with:
+    ;; "ValueError: unichr() arg not in range(0x10000) (narrow Python build)"
+    (arguments `(#:tests? #f))))
+
+(define-public python-apsw
+  (package
+    (name "python-apsw")
+    (version "3.8.7.3-r1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/a/apsw/apsw-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "1rgxdypg7hym0qny15rx5khrghx9fkppfgsfa2s8lg917924mv7l"))))
+    (build-system python-build-system)
+    (inputs
+      `(("python-setuptools" ,python-setuptools)
+        ("sqlite" ,sqlite)))
+    (arguments
+     `(#:phases
+        ;; swap check and install phases
+        (alist-cons-after
+         'install 'check
+         (assoc-ref %standard-phases 'check)
+         (alist-delete
+          'check
+          %standard-phases))))
+    (home-page "https://github.com/rogerbinns/apsw/")
+    (synopsis "Another Python SQLite Wrapper")
+    (description "APSW is a Python wrapper for the SQLite
+embedded relational database engine.  In contrast to other wrappers such as
+pysqlite it focuses on being a minimal layer over SQLite attempting just to
+translate the complete SQLite API into Python.")
+    (license license:zlib)))
+
+(define-public python2-apsw
+  (package-with-python2 python-apsw))
+
+(define-public python-lxml
+  (package
+    (name "python-lxml")
+    (version "3.4.2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/l/lxml/lxml-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "0pd23qz8vms1mgm41p96h4vac5y91igs4wr9640gnvxgk019kmf7"))))
+    (build-system python-build-system)
+    (inputs
+      `(("libxml2" ,libxml2)
+        ("libxslt" ,libxslt)
+        ("python-setuptools" ,python-setuptools)))
+    (home-page "http://lxml.de/")
+    (synopsis
+      "Python XML processing library")
+    (description
+      "The lxml XML toolkit is a Pythonic binding for the C libraries
+libxml2 and libxslt.")
+    (license bsd-3))) ; and a few more, see LICENSES.txt
+
+(define-public python2-lxml
+  (package-with-python2 python-lxml))
+
+(define-public python-pillow
+  (package
+    (name "python-pillow")
+    (version "2.7.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/P/Pillow/Pillow-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "1y0rysgd7vqpl5lh0lsra7j2k30azwxqlh5jnqk1i0pmfc735s96"))))
+    (build-system python-build-system)
+    (inputs
+      `(("freetype" ,freetype)
+        ("lcms" ,lcms)
+        ("libjpeg" ,libjpeg)
+        ("libtiff" ,libtiff)
+        ("openjpeg" ,openjpeg)
+        ("python-setuptools" ,python-setuptools)
+        ("zlib" ,zlib)))
+    (arguments
+     `(#:tests? #f)) ; no check target
+    (home-page "http://python-pillow.github.io/")
+    (synopsis "Pillow fork of Python Imaging Library")
+    (description "Pillow is a fork of the Python Imaging Library (PIL).")
+    ;; PIL license, see
+    ;; http://www.pythonware.com/products/pil/license.htm
+    (license (x11-style
+               "file://PKG-INFO"
+               "See http://www.pythonware.com/products/pil/license.htm"))))
+
+(define-public python2-pillow
+  (package-with-python2 python-pillow))
+
+(define-public python2-pil
+  (package
+    (name "python2-pil")
+    (version "1.1.7")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "http://effbot.org/downloads/Imaging-"
+              version ".tar.gz"))
+        (sha256
+          (base32
+            "04aj80jhfbmxqzvmq40zfi4z3cw6vi01m3wkk6diz3lc971cfnw9"))))
+    (build-system python-build-system)
+    (inputs
+      `(("freetype" ,freetype)
+        ("libjpeg" ,libjpeg)
+        ("libtiff" ,libtiff)
+        ("python-setuptools" ,python-setuptools)
+        ("zlib" ,zlib)))
+    (arguments
+     ;; Only the fork python-pillow works with Python 3.
+     `(#:python ,python-2
+       #:tests? #f ; no check target
+       #:phases
+         (alist-cons-before
+          'build 'configure
+          ;; According to README and setup.py, manual configuration is
+          ;; the preferred way of "searching" for inputs.
+          ;; lcms is not found, TCL_ROOT refers to the unavailable tkinter.
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((jpeg (assoc-ref inputs "libjpeg"))
+                  (zlib (assoc-ref inputs "zlib"))
+                  (tiff (assoc-ref inputs "libtiff"))
+                  (freetype (assoc-ref inputs "freetype")))
+              (substitute* "setup.py"
+                (("JPEG_ROOT = None")
+                 (string-append "JPEG_ROOT = libinclude(\"" jpeg "\")"))
+                (("ZLIB_ROOT = None")
+                 (string-append "ZLIB_ROOT = libinclude(\"" zlib "\")"))
+                (("TIFF_ROOT = None")
+                 (string-append "TIFF_ROOT = libinclude(\"" tiff "\")"))
+                (("FREETYPE_ROOT = None")
+                 (string-append "FREETYPE_ROOT = libinclude(\""
+                                freetype "\")")))))
+          %standard-phases)))
+    (home-page "http://www.pythonware.com/products/pil/")
+    (synopsis "Python Imaging Library")
+    (description "The Python Imaging Library (PIL) adds image processing
+capabilities to the Python interpreter.")
+    (license (x11-style
+               "file://README"
+               "See 'README' in the distribution."))))
+
+(define-public python2-cssutils
+  (package
+    (name "python2-cssutils")
+    (version "1.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/c/cssutils/cssutils-"
+              version
+              ".zip"))
+        (sha256
+          (base32
+            "1bwim1353r4hqiir73sn4sc43y7ymh09qx0kly7vj048blppc125"))))
+    (build-system python-build-system)
+    (native-inputs
+      `(("python2-mock" ,python2-mock) ; for the tests
+        ("unzip" ,unzip))) ; for unpacking the source
+    (inputs
+      `(("python2-setuptools" ,python2-setuptools)))
+    (arguments
+     `(#:python ,python-2 ; Otherwise tests fail with a syntax error.
+       #:tests? #f ; The tests apparently download an external URL.
+       #:phases
+       (alist-replace
+        'unpack
+        (lambda* (#:key source #:allow-other-keys)
+          (and (zero? (system* "unzip" source))
+               (chdir "cssutils-1.0")))
+        %standard-phases)))
+    (home-page "http://cthedot.de/cssutils/")
+    (synopsis
+      "CSS Cascading Style Sheets library for Python")
+    (description
+      "Cssutils is a Python package for parsing and building CSS
+Cascading Style Sheets.  Currently it provides a DOM only and no rendering
+options.")
+    (license lgpl3+)))
+
+(define-public python-cssselect
+  (package
+    (name "python-cssselect")
+    (version "0.9.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/c/cssselect/cssselect-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "10h623qnp6dp1191jri7lvgmnd4yfkl36k9smqklp1qlf3iafd85"))))
+    (build-system python-build-system)
+    (inputs
+      `(("python-setuptools" ,python-setuptools)))
+    (arguments
+     ;; tests fail with message
+     ;; AttributeError: 'module' object has no attribute 'tests'
+     `(#:tests? #f))
+    (home-page
+      "https://pythonhosted.org/cssselect/")
+    (synopsis
+      "CSS3 selector parser and translator to XPath 1.0")
+    (description
+      "Cssselect ia a Python module that parses CSS3 Selectors and translates
+them to XPath 1.0 expressions.  Such expressions can be used in lxml or
+another XPath engine to find the matching elements in an XML or HTML document.")
+    (license bsd-3)))
+
+(define-public python2-cssselect
+  (package-with-python2 python-cssselect))
+
+(define-public python-netifaces
+  (package
+    (name "python-netifaces")
+    (version "0.10.4")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://pypi.python.org/packages/source/n/netifaces/netifaces-"
+              version
+              ".tar.gz"))
+        (sha256
+          (base32
+            "1plw237a4zib4z8s62g0mrs8gm3kjfrp5sxh6bbk9nl3rdls2mln"))))
+    (build-system python-build-system)
+    (inputs
+      `(("python-setuptools" ,python-setuptools)))
+    (home-page
+      "https://bitbucket.org/al45tair/netifaces")
+    (synopsis
+      "Python module for portable network interface information")
+    (description
+      "Netifaces is a Python module providing information on network
+interfaces in an easy and portable manner.")
+    (license license:expat)))
+
+(define-public python2-netifaces
+  (package-with-python2 python-netifaces))