gnu: Add bst.
[jackhill/guix/guix.git] / gnu / packages / python-xyz.scm
index e27cb16..4541604 100644 (file)
@@ -62,6 +62,9 @@
 ;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
+;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -315,14 +318,14 @@ by @code{binstar}, @code{binstar-build} and @code{chalmers}.")
 (define-public python-babel
   (package
     (name "python-babel")
-    (version "2.6.0")
+    (version "2.7.0")
     (source
      (origin
       (method url-fetch)
       (uri (pypi-uri "Babel" version))
       (sha256
        (base32
-        "08rxmbx2s4irp0w0gmn498vns5xy0fagm0fg33xa772jiks51flc"))))
+        "0a7wawx8vsg7igvz6p3x909fskhg4b2y1910xk4f4c8y22p3aqg8"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-freezegun" ,python-freezegun)
@@ -347,6 +350,18 @@ etc. ")
 (define-public python2-babel
   (package-with-python2 python-babel))
 
+;; Sphinx < 2.0 requires this version.  Remove once no longer needed.
+(define-public python2-babel-2.6
+  (package
+    (inherit python2-babel)
+    (version "2.6.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "Babel" version))
+              (sha256
+               (base32
+                "08rxmbx2s4irp0w0gmn498vns5xy0fagm0fg33xa772jiks51flc"))))))
+
 (define-public python2-backport-ssl-match-hostname
   (package
     (name "python2-backport-ssl-match-hostname")
@@ -2328,15 +2343,33 @@ e.g. filters, callbacks and errbacks can all be promises.")
 (define-public python-markupsafe
   (package
     (name "python-markupsafe")
-    (version "1.0")
+    (version "1.1.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "MarkupSafe" version))
        (sha256
         (base32
-         "0rdn1s8x9ni7ss8rfiacj7x1085lx8mh2zdwqslnw8xc3l4nkgm6"))))
+         "0sqipg4fk7xbixqd8kq6rlkxj664d157bdwbh93farcphf92x1r9"))))
     (build-system python-build-system)
+    (arguments
+     `(#:modules ((ice-9 ftw)
+                  (srfi srfi-1)
+                  (srfi srfi-26)
+                  (guix build utils)
+                  (guix build python-build-system))
+       #:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (let ((cwd (getcwd))
+                            (libdir (find (cut string-prefix? "lib." <>)
+                                          (scandir "build"))))
+                      (setenv "PYTHONPATH"
+                              (string-append cwd "/build/" libdir ":"
+                                             (getenv "PYTHONPATH")))
+                      (invoke "pytest" "-vv")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (home-page "https://github.com/mitsuhiko/markupsafe")
     (synopsis "XML/HTML/XHTML markup safe string implementation for Python")
     (description
@@ -2514,14 +2547,14 @@ reStructuredText.")
 (define-public python-pygments
   (package
     (name "python-pygments")
-    (version "2.4.0")
+    (version "2.4.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Pygments" version))
        (sha256
         (base32
-         "1xb5n3hvhk63kxypc03k7kfry20pny6gygi4bsl9kw1rnzzsdjri"))))
+         "15v2sqm5g12bqa0c7wikfh9ck2nl97ayizy1hpqhmws5gqalq748"))))
     (build-system python-build-system)
     (arguments
      ;; FIXME: Tests require sphinx, which depends on this.
@@ -2951,38 +2984,44 @@ Language (TOML) configuration files.")
 Server (PLS).")
     (license license:expat)))
 
+;; XXX: We must use a non-release version since the latest release version
+;; requires python-jedi version < 0.15.
 (define-public python-language-server
-  (package
-    (name "python-language-server")
-    (version "0.26.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "python-language-server" version))
-       (sha256
-        (base32
-         "1vs9ckfmm534n1hq3m871916wsjvi5h4gyj6wlzg13ck6506lx0s"))))
-    (build-system python-build-system)
-    (propagated-inputs
-     `(("python-pluggy" ,python-pluggy)
-       ("python-jsonrpc-server" ,python-jsonrpc-server)
-       ("python-jedi" ,python-jedi)
-       ("python-yapf" ,python-yapf)
-       ("python-pyflakes" ,python-pyflakes)
-       ("python-pydocstyle" ,python-pydocstyle)
-       ("python-pycodestyle" ,python-pycodestyle)
-       ("python-mccabe" ,python-mccabe)
-       ("python-rope" ,python-rope)
-       ("python-autopep8" ,python-autopep8)
-       ("python-pylint" ,python-pylint)))
-    (home-page "https://github.com/palantir/python-language-server")
-    (synopsis "Python implementation of the Language Server Protocol")
-    (description
-     "The Python Language Server (pyls) is an implementation of the Python 3
+  (let ((commit "c3cab77a85b1de4af1aec1bafea6a7320d6baec5")
+        (revision "1"))
+    (package
+      (name "python-language-server")
+      (version (git-version "0.28.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/palantir/python-language-server.git")
+               (commit commit)))
+         (sha256
+          (base32
+           "1q0xdwgln09sh58j0ryygj92hfgdhwcs57zjvqihya23jr5v0bz4"))))
+      (build-system python-build-system)
+      (propagated-inputs
+       `(("python-pluggy" ,python-pluggy)
+         ("python-jsonrpc-server" ,python-jsonrpc-server)
+         ("python-jedi" ,python-jedi)
+         ("python-yapf" ,python-yapf)
+         ("python-pyflakes" ,python-pyflakes)
+         ("python-pydocstyle" ,python-pydocstyle)
+         ("python-pycodestyle" ,python-pycodestyle)
+         ("python-mccabe" ,python-mccabe)
+         ("python-rope" ,python-rope)
+         ("python-autopep8" ,python-autopep8)
+         ("python-pylint" ,python-pylint)))
+      (home-page "https://github.com/palantir/python-language-server")
+      (synopsis "Python implementation of the Language Server Protocol")
+      (description
+       "The Python Language Server (pyls) is an implementation of the Python 3
 language specification for the Language Server Protocol (LSP).  This tool is
 used in text editing environments to provide a complete and integrated
 feature-set for programming Python effectively.")
-    (license license:expat)))
+      (license license:expat))))
 
 (define-public python-black
   (package
@@ -3090,20 +3129,27 @@ and is very extensible.")
 (define-public mallard-ducktype
   (package
     (name "mallard-ducktype")
-    (version "1.0.1")
+    (version "1.0.2")
     (source
      (origin
        (method git-fetch)
-       ;; git-reference because a proper source tarball is not available
-       ;; https://lists.gnu.org/archive/html/guix-devel/2019-05/msg00209.html
+       ;; git-reference because tests are not included in pypi source tarball
+       ;; https://issues.guix.gnu.org/issue/36755#2
        (uri (git-reference
              (url "https://github.com/projectmallard/mallard-ducktype.git")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0crland0kmpsyjfmnflcw7gaqy5b87b6ah17cmr9d5z1kyazf54n"))))
+         "1jk9bfz7g04ip78s03b0xak6d54rj4h9zpgadkziy1ji216g6y4c"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (with-directory-excursion "tests"
+               (invoke "sh" "runtests")))))))
     (home-page "http://projectmallard.org")
     (synopsis "Convert Ducktype to Mallard documentation markup")
     (description
@@ -3152,14 +3198,14 @@ provides additional functionality on the produced Mallard documents.")
 (define-public python-cython
   (package
     (name "python-cython")
-    (version "0.29.7")
+    (version "0.29.13")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Cython" version))
        (sha256
         (base32
-         "1s61hq2ikawxp6qvmkbfvvaxy9rqj67cddzwgcfc3dwi44b83l2m"))))
+         "13k37lrcgagwwnzr5bzririsscb793vndj234d475x1h9ad0d7f2"))))
     (build-system python-build-system)
     ;; we need the full python package and not just the python-wrapper
     ;; because we need libpython3.3m.so
@@ -3191,7 +3237,12 @@ provides additional functionality on the produced Mallard documents.")
 
          (replace 'check
            (lambda _
-             (invoke "python" "runtests.py" "-vv"))))))
+             ;; Disable compiler optimizations to greatly reduce the running
+             ;; time of the test suite.
+             (setenv "CFLAGS" "-O0")
+
+             (invoke "python" "runtests.py" "-vv"
+                     "-j" (number->string (parallel-job-count))))))))
     (home-page "https://cython.org/")
     (synopsis "C extensions for Python")
     (description "Cython is an optimising static compiler for both the Python
@@ -3456,12 +3507,11 @@ color scales, and color space conversion easy.  It has support for:
        ("pkg-config" ,pkg-config)
        ("python-sphinx" ,python-sphinx)
        ("python-numpydoc" ,python-numpydoc)
-       ("texlive" ,(texlive-union (list texlive-fonts-amsfonts
-                                        texlive-fonts-cm-super
+       ("texlive" ,(texlive-union (list texlive-fonts-cm-super
                                         texlive-fonts-ec
                                         texlive-generic-ifxetex
                                         texlive-generic-pdftex
-                                        texlive-latex-amsfonts
+                                        texlive-amsfonts
                                         texlive-latex-capt-of
                                         texlive-latex-cmap
                                         texlive-latex-environ
@@ -3756,14 +3806,14 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
 (define-public python-matplotlib
   (package
     (name "python-matplotlib")
-    (version "2.2.3")
+    (version "3.1.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "matplotlib" version))
        (sha256
         (base32
-         "1rcc7x9ig3hpchkc4cwdvym3y451w74275fxr455zkfagrsvymbk"))))
+         "14qc109dibp32xfd9lah54djc0rc76fhbsj9cwyb328lzqmd5sqz"))))
     (build-system python-build-system)
     (propagated-inputs ; the following packages are all needed at run time
      `(("python-cycler" ,python-cycler)
@@ -3777,22 +3827,11 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
        ("python-pillow" ,python-pillow)
        ("python-pytz" ,python-pytz)
        ("python-six" ,python-six)
-       ;; The 'gtk+' package (and 'gdk-pixbuf', 'atk' and 'pango' propagated
-       ;; from 'gtk+') provides the required 'typelib' files used by
-       ;; 'gobject-introspection'. The location of these files is set with the
-       ;; help of the environment variable GI_TYPELIB_PATH. At build time this
-       ;; is done automatically by a 'native-search-path' procedure. However,
-       ;; at run-time the user must set this variable as follows:
-       ;;
-       ;; export GI_TYPELIB_PATH=~/.guix-profile/lib/girepository-1.0
-       ("gtk+" ,gtk+)
        ;; From version 1.4.0 'matplotlib' makes use of 'cairocffi' instead of
        ;; 'pycairo'. However, 'pygobject' makes use of a 'pycairo' 'context'
        ;; object. For this reason we need to import both libraries.
-       ;; https://pythonhosted.org/cairocffi/cffi_api.html#converting-pycairo
+       ;; https://cairocffi.readthedocs.io/en/stable/cffi_api.html#converting-pycairo-wrappers-to-cairocffi
        ("python-pycairo" ,python-pycairo)
-       ;; XXX: qtwebkit cannot be built reliably.
-       ("python-pyqt" ,python-pyqt-without-qtwebkit)
        ("python-cairocffi" ,python-cairocffi)))
     (inputs
      `(("libpng" ,libpng)
@@ -3806,26 +3845,72 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
        ("tk" ,tk)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("python-nose" ,python-nose)
-       ("python-mock" ,python-mock)))
+       ("python-pytest" ,python-pytest)
+       ("python-mock" ,python-mock)
+       ("unzip" ,unzip)
+       ("jquery-ui"
+        ,(origin
+           (method url-fetch)
+           (uri "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip")
+           (sha256
+            (base32
+             "0kb21xf38diqgxcdi1z3s9ssq36pldvyqxy56hn6pcva6rs3c8zq"))))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         ;; XXX We disable all image comparison tests because we're using a
+         ;; newer version of FreeType than matplotlib expects.  This leads to
+         ;; minor differences throughout the tests.
+         (add-after 'unpack 'fix-and-disable-failing-tests
+           (lambda _
+             (substitute* (append (find-files "lib/matplotlib/tests/"
+                                              "test_.*\\.py$")
+                                  (find-files "lib/mpl_toolkits/tests"
+                                              "test_.*\\.py$"))
+               (("^from matplotlib" match)
+                (string-append "import pytest\n" match))
+               (("( *)@image_comparison" match indent)
+                (string-append indent
+                               "@pytest.mark.skip(reason=\"unknown minor image differences\")\n"
+                               match)))
+             (substitute* "lib/matplotlib/tests/test_animation.py"
+               (("/bin/sh") (which "sh")))
+             (for-each delete-file
+                       ;; test_normal_axes, test_get_tightbbox_polar
+                       '("lib/matplotlib/tests/test_axes.py"
+                         ;; test_outward_ticks
+                         "lib/matplotlib/tests/test_tightlayout.py"
+                         ;; Fontconfig returns no fonts.
+                         "lib/matplotlib/tests/test_font_manager.py"))
+             #t))
+         (add-before 'install 'install-jquery-ui
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((dir (string-append (assoc-ref outputs "out")
+                                       "/lib/python3.7/site-packages/matplotlib/backends/web_backend/")))
+               (mkdir-p dir)
+               (invoke "unzip"
+                       (assoc-ref inputs "jquery-ui")
+                       "-d" dir))
+             #t))
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "python" "tests.py" "-v"
+                     "-m" "not network")))
          (add-before 'build 'configure-environment
            (lambda* (#:key outputs inputs #:allow-other-keys)
-             (let ((cairo (assoc-ref inputs "cairo"))
-                   (gtk+ (assoc-ref inputs "gtk+")))
-               ;; Setting these directories in the 'basedirlist' of 'setup.cfg'
+             (let ((cairo (assoc-ref inputs "cairo")))
+               ;; Setting this directory in the 'basedirlist' of 'setup.cfg'
                ;; has not effect.
-               (setenv "LD_LIBRARY_PATH"
-                       (string-append cairo "/lib:" gtk+ "/lib"))
+               (setenv "LD_LIBRARY_PATH" (string-append cairo "/lib"))
                (setenv "HOME" (getcwd))
                (call-with-output-file "setup.cfg"
                  (lambda (port)
                    (format port "[directories]~%
 basedirlist = ~a,~a~%
- [rc_options]~%
-backend = TkAgg~%"
+[packages]~%
+tests = True~%"
                         (assoc-ref inputs "tcl")
                         (assoc-ref inputs "tk")))))
              #t)))))
@@ -3844,6 +3929,14 @@ toolkits.")
   (let ((matplotlib (package-with-python2
                      (strip-python2-variant python-matplotlib))))
     (package (inherit matplotlib)
+      (version "2.2.3")
+      (source
+       (origin
+         (method url-fetch)
+         (uri (pypi-uri "matplotlib" version))
+         (sha256
+          (base32
+           "1rcc7x9ig3hpchkc4cwdvym3y451w74275fxr455zkfagrsvymbk"))))
       ;; Make sure to use special packages for Python 2 instead
       ;; of those automatically rewritten by package-with-python2.
       (propagated-inputs
@@ -3867,13 +3960,14 @@ toolkits.")
      `(("python-matplotlib" ,python-matplotlib)
        ("python-colorspacious" ,python-colorspacious)
        ("python-sphinx" ,python-sphinx)
+       ("python-sphinx-copybutton" ,python-sphinx-copybutton)
        ("python-sphinx-gallery" ,python-sphinx-gallery)
        ("python-numpydoc" ,python-numpydoc)
        ("python-ipython" ,python-ipython)
        ("python-ipykernel" ,python-ipykernel)
        ("python-mock" ,python-mock)
        ("graphviz" ,graphviz)
-       ("texlive" ,(texlive-union (list texlive-latex-amsfonts
+       ("texlive" ,(texlive-union (list texlive-amsfonts
                                         texlive-latex-amsmath
                                         texlive-latex-enumitem
                                         texlive-latex-expdlist
@@ -3884,7 +3978,6 @@ toolkits.")
 
                                         texlive-generic-pdftex
 
-                                        texlive-fonts-amsfonts
                                         texlive-fonts-ec
                                         texlive-fonts-adobe-times
                                         texlive-fonts-txfonts)))
@@ -3894,6 +3987,9 @@ toolkits.")
      `(#:tests? #f ; we're only generating documentation
        #:phases
        (modify-phases %standard-phases
+         ;; The tests in python-matplotlib are run after the install phase, so
+         ;; we need to delete the extra phase here.
+         (delete 'check)
          (replace 'build
            (lambda _
              (chdir "doc")
@@ -3942,7 +4038,12 @@ toolkits.")
     (license (package-license python-matplotlib))))
 
 (define-public python2-matplotlib-documentation
-  (package-with-python2 python-matplotlib-documentation))
+  (let ((parent (package-with-python2 python-matplotlib-documentation)))
+    (package
+      (inherit parent)
+      (native-inputs
+       (alist-delete "python-sphinx-copybutton"
+                     (package-native-inputs parent))))))
 
 (define-public python-matplotlib-venn
   (package
@@ -4003,14 +4104,14 @@ operators such as union, intersection, and difference.")
 (define-public python-scipy
   (package
     (name "python-scipy")
-    (version "1.2.2")
+    (version "1.3.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "scipy" version))
        (sha256
         (base32
-         "1cgvgin8fvckv96hjh3ikmwkra5rif51bdb75ifzf7xbil5iwcx4"))))
+         "1df113c9i6vazsn6y3n9wc22jh737z1g7dmx3mypkdwpdnscyhr6"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-numpy" ,python-numpy)
@@ -4106,9 +4207,19 @@ routines such as routines for numerical integration and optimization.")
     (properties `((python2-variant . ,(delay python2-scipy))))
     (license license:bsd-3)))
 
+;; Version 1.2.2 is the last version to support Python 2
 (define-public python2-scipy
-  (package-with-python2
-   (strip-python2-variant python-scipy)))
+  (package
+    (inherit (package-with-python2
+              (strip-python2-variant python-scipy)))
+    (version "1.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "scipy" version))
+       (sha256
+        (base32
+         "1cgvgin8fvckv96hjh3ikmwkra5rif51bdb75ifzf7xbil5iwcx4"))))))
 
 (define-public python-socksipy-branch
   (package
@@ -4327,14 +4438,14 @@ the OleFileIO module from PIL, the Python Image Library.")
 (define-public python-pillow
   (package
     (name "python-pillow")
-    (version "5.4.1")
+    (version "6.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Pillow" version))
        (sha256
         (base32
-         "17waygkhhzjd75kajlfw9v57mbb41lcpg6cvkdijqd7smm76ccsj"))))
+         "1pnrsz0f0n0c819v1pdr8j6rm8xvhc9f3kh1fv9xpdp9n5ygf108"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-pytest" ,python-pytest)))
@@ -4383,14 +4494,14 @@ a general image processing tool.")
 (define-public python-pycparser
   (package
     (name "python-pycparser")
-    (version "2.18")
+    (version "2.19")
     (source
      (origin
       (method url-fetch)
       (uri (pypi-uri "pycparser" version))
       (sha256
        (base32
-        "09mjyw82ibqzl449g7swy8bfxnfpmas0815d2rkdjlcqw81wma4r"))))
+        "1cr5dcj9628lkz1qlwq3fv97c25363qppkmcayqvd05dpy573259"))))
     (outputs '("out" "doc"))
     (build-system python-build-system)
     (native-inputs
@@ -4413,7 +4524,8 @@ a general image processing tool.")
                            (copy-file (string-append "." file)
                                       (string-append doc file)))
                          '("/README.rst" "/CHANGES" "/LICENSE"))
-               (copy-recursively "examples" examples)))))))
+               (copy-recursively "examples" examples)
+               #t))))))
     (home-page "https://github.com/eliben/pycparser")
     (synopsis "C parser in Python")
     (description
@@ -4844,7 +4956,7 @@ them as the version argument or in a SCM managed file.")
      `(("python-scandir" ,python-scandir)
        ("python-six" ,python-six)))
     (home-page "https://pypi.python.org/pypi/pathlib2/")
-    (synopsis "Object-oriented filesystem paths")
+    (synopsis "Object-oriented file system paths")
     (description "The goal of pathlib2 is to provide a backport of the
 standard @code{pathlib} module which tracks the standard library module, so
 all the newest features of the standard @code{pathlib} can be used also on
@@ -4925,7 +5037,8 @@ releases.")
     (outputs '("out" "doc"))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-appdirs" ,python-appdirs)))
+     `(("python-appdirs" ,python-appdirs)
+       ("python-importlib-metadata" ,python-importlib-metadata)))
     (native-inputs
      `(("python-setuptools-scm" ,python-setuptools-scm)
        ("python-sphinx" ,python-sphinx)
@@ -5102,7 +5215,19 @@ without using the configuration machinery.")
     ;; Tests fail because of missing native python kernel which I assume is
     ;; provided by the ipython package, which we cannot use because it would
     ;; cause a dependency cycle.
-    (arguments `(#:tests? #f))
+    (arguments
+     `(#:tests? #f
+
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'set-tool-file-names
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (let ((iproute (assoc-ref inputs "iproute")))
+                        (substitute* "jupyter_client/localinterfaces.py"
+                          (("'ip'")
+                           (string-append "'" iproute "/sbin/ip'")))
+                        #t))))))
+    (inputs
+     `(("iproute" ,iproute)))
     (propagated-inputs
      `(("python-pyzmq" ,python-pyzmq)
        ("python-traitlets" ,python-traitlets)
@@ -5137,7 +5262,17 @@ installing @code{kernelspec}s for use with Jupyter frontends.")
            (lambda _
              (setenv "HOME" "/tmp")
              (invoke "pytest" "-v")
-             #t)))))
+             #t))
+         (add-after 'install 'set-python-file-name
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Record the absolute file name of the 'python' executable in
+             ;; 'kernel.json'.
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* (string-append out "/share/jupyter"
+                                           "/kernels/python3/kernel.json")
+                 (("\"python\"")
+                  (string-append "\"" (which "python") "\"")))
+               #t))))))
     (propagated-inputs
      `(("python-ipython" ,python-ipython)
        ;; imported at runtime during connect
@@ -5336,6 +5471,13 @@ computing.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'make-docs-reproducible
+           (lambda _
+             (substitute* "IPython/sphinxext/ipython_directive.py"
+               ((".*import datetime") "")
+               ((".*datetime.datetime.now\\(\\)") "")
+               (("%timeit") "# %timeit"))
+             #t))
          ;; Tests can only be run after the library has been installed and not
          ;; within the source directory.
          (delete 'check)
@@ -5418,11 +5560,10 @@ computing.")
      `(("python-sphinx" ,python-sphinx)
        ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
        ;; FIXME: It's possible that a smaller union would work just as well.
-       ("texlive" ,(texlive-union (list texlive-fonts-amsfonts
+       ("texlive" ,(texlive-union (list texlive-amsfonts
                                         texlive-fonts-ec
                                         texlive-generic-ifxetex
                                         texlive-generic-pdftex
-                                        texlive-latex-amsfonts
                                         texlive-latex-capt-of
                                         texlive-latex-cmap
                                         texlive-latex-environ
@@ -6938,14 +7079,14 @@ Supported netlink families and protocols include:
 (define-public python-wrapt
   (package
     (name "python-wrapt")
-    (version "1.11.1")
+    (version "1.11.2")
     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "wrapt" version))
-        (sha256
-          (base32
-            "0cqmysny1pz01jw26q48q5zasvns6507rwhgm6wcw743f0r01sja"))))
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "wrapt" version))
+       (sha256
+        (base32
+         "1q81762dgsgrd12f8qc39zk8s5wll3m5xc32jdmlf6cls4gh4njn"))))
     (build-system python-build-system)
     (arguments
      ;; Tests are not included in the tarball, they are only available in the
@@ -6954,7 +7095,7 @@ Supported netlink families and protocols include:
     (home-page "https://github.com/GrahamDumpleton/wrapt")
     (synopsis "Module for decorators, wrappers and monkey patching")
     (description
-      "The aim of the wrapt module is to provide a transparent object proxy for
+     "The aim of the wrapt module is to provide a transparent object proxy for
   Python, which can be used as the basis for the construction of function
   wrappers and decorator functions.")
     (license license:bsd-2)))
@@ -7200,6 +7341,17 @@ the Python standard library but currently only supports the older 2003
 specification.")
     (license license:bsd-4)))
 
+(define-public python-idna-2.7
+  (package (inherit python-idna)
+           (version "2.7")
+           (source (origin
+                     (method url-fetch)
+                     (uri (pypi-uri "idna" version))
+                     (sha256
+                      (base32
+                       "05jam7d31767dr12x0rbvvs8lxnpb1mhdb2zdlfxgh83z6k3hjk8"))))))
+
+
 (define-public python2-idna
   (package-with-python2 python-idna))
 
@@ -7250,14 +7402,14 @@ responses, rather than doing any computation.")
 (define-public python-pip
   (package
     (name "python-pip")
-    (version "18.1")
+    (version "19.2.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pip" version))
        (sha256
         (base32
-         "188fclay154s520n43s7cxxlhdaiysvxf19zk8vr1xbyjyyr58n0"))))
+         "100sd12ss4mbdj5lf3wawad29cm573b27765mq098x6xhcj71395"))))
     (build-system python-build-system)
     (arguments
      '(#:tests? #f))          ; there are no tests in the pypi archive.
@@ -7417,17 +7569,31 @@ serve the same purpose: provide Python bindings for libmagic.")))
   (package
     (name "python-debian")
     (home-page "https://salsa.debian.org/python-debian-team/python-debian")
-    (version "0.1.28")
+    (version "0.1.36")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri name version))
+       ;; Use git-fetch, as pypi doesn't include test suite.
+       (method git-fetch)
+       (uri (git-reference
+             (url home-page)
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "0i15f0xzx679sd0ldq2sls9pnnps9fv6vhqvnv9dzf4qhma42i0y"))))
+         "0qy6x28bj6yfikhjww932v5xq4mf5bm1iczl7acy4c7zm6mwhqfa"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'remove-debian-specific-tests
+                    ;; python-apt, apt and dpkg are not yet available in guix,
+                    ;; and these tests heavily depend on them.
+                    (lambda _
+                      (delete-file "lib/debian/tests/test_deb822.py")
+                      (delete-file "lib/debian/tests/test_debfile.py")
+                      #t)))))
     (propagated-inputs
-     `(("python-six" ,python-six)))
+     `(("python-six" ,python-six)
+       ("python-chardet" ,python-chardet)))
     (synopsis "Debian package related modules")
     (description
      ;; XXX: Use @enumerate instead of @itemize to work around
@@ -8106,14 +8272,14 @@ the standard library.")
 (define-public python-texttable
   (package
     (name "python-texttable")
-    (version "0.8.7")
+    (version "0.9.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "texttable" version))
        (sha256
         (base32
-         "1liiiydgkg37i46a418aw19fyf6z3ds51wdwwpyjbs12x0phhf4a"))))
+         "0yawv64c0zbawwv6zz84whb32fnb2n9jylwjcfsrcdgh7xvl340i"))))
     (build-system python-build-system)
     (arguments '(#:tests? #f)) ; no tests
     (home-page "https://github.com/foutaise/texttable/")
@@ -8494,6 +8660,28 @@ concurrent.futures package from Python 3.2")
          ("python2-pytest" ,python2-pytest)
          ,@(package-native-inputs promise))))))
 
+(define-public python-progressbar33
+  (package
+    (name "python-progressbar33")
+    (version "2.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "progressbar33" version))
+       (sha256
+        (base32
+         "1zvf6zs5hzrc03p9nfs4p16vhilqikycvv1yk0pxn8s07fdhvzji"))))
+    (build-system python-build-system)
+    (home-page "http://github.com/germangh/python-progressbar")
+    (synopsis "Text progress bar library for Python")
+    (description
+     "This package provides a text progress bar library for Python.  This
+version only differs from the original @code{progressbar} package in that it
+uses relative package imports instead of absolute imports, which is necessary
+for the module to work under Python 3.3.")
+    ;; Either or both of these licenses may be selected.
+    (license (list license:lgpl2.1+ license:bsd-3))))
+
 (define-public python-colorama
   (package
    (name "python-colorama")
@@ -8703,20 +8891,24 @@ python-xdo for newer bindings.)")
 (define-public python-mako
   (package
     (name "python-mako")
-    (version "1.0.10")
+    (version "1.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Mako" version))
        (sha256
         (base32
-         "0r9rysn19fmrxnzfcn7sg20kjhcrx9qri0my9n5vdzp1g2g92rbi"))))
+         "0jqa3qfpykyn4fmkn0kh6043sfls7br8i2bsdbccazcvk9cijsd3"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (invoke "pytest" "-vv"))))))
     (propagated-inputs
      `(("python-markupsafe" ,python-markupsafe)))
     (native-inputs
      `(("python-mock" ,python-mock)
-       ("python-nose" ,python-nose)
        ("python-pytest" ,python-pytest)))
     (home-page "https://www.makotemplates.org/")
     (synopsis "Templating language for Python")
@@ -9890,13 +10082,13 @@ format.")
 (define-public python-twisted
   (package
     (name "python-twisted")
-    (version "19.2.1")
+    (version "19.7.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "Twisted" version ".tar.bz2"))
               (sha256
                (base32
-                "0liymyd4pzphizjlpwkncxjpm9akyr3lkfkm77yfg6wasv108b7s"))))
+                "17d3hnxv9qndagzz63mdpyk99xj63p9gq586vjn0rxk8cl197nym"))))
     (build-system python-build-system)
     (arguments
      '(#:tests? #f))                    ; FIXME: some tests fail
@@ -10443,25 +10635,29 @@ characters, mouse support, and auto suggestions.")
 (define-public python-jedi
   (package
     (name "python-jedi")
-    (version "0.13.3")
+    (version "0.15.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "jedi" version))
        (sha256
         (base32
-         "0nsrjlb57njqppxmi8wjsb1dkad7qa7svx67jbkhixq66lz61c1b"))))
+         "0bp4pxhsynaarbvzblsn5x32lzp29svy3sxfy8i6m5iwz9s9r1ds"))))
     (build-system python-build-system)
     (arguments
-     `( ;; Many tests are failing with Python 3.7.x as of version 0.13.3 (see:
-        ;; https://github.com/davidhalter/jedi/issues/1263)
-       #:tests? #f
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'disable-file-completion-test
+           ;; A single parameterized test currently fail (see:
+           ;; https://github.com/davidhalter/jedi/issues/1395).  Remove it.
+           (lambda _
+             (substitute* "test/test_api/test_completion.py"
+               ((".*'example.py', 'rb\"' \\+ join\\('\\.\\.'.*") ""))
+             #t))
          (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "py.test" "-vv")))))))
+           (lambda _
+             (setenv "HOME" "/tmp")
+             (invoke "python" "-m" "pytest"))))))
     (native-inputs
      `(("python-pytest" ,python-pytest)
        ("python-docopt" ,python-docopt)))
@@ -10479,11 +10675,7 @@ well.")
     (license license:expat)))
 
 (define-public python2-jedi
-  (let ((base (package-with-python2 (strip-python2-variant python-jedi))))
-    (package
-      (inherit base)
-      (arguments (substitute-keyword-arguments (package-arguments base)
-                   ((#:tests? _) #t))))))
+  (package-with-python2 python-jedi))
 
 (define-public ptpython
   (package
@@ -10863,25 +11055,36 @@ command @command{natsort} that exposes this functionality in the command line.")
 (define-public python-glances
   (package
   (name "python-glances")
-  (version "3.0.2")
+  (version "3.1.1")
   (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "Glances" version))
       (sha256
         (base32
-          "09fxysfp1n16csqvzvawy74qm6a94nvwjf3vcf5gkqp4i6k4vjjy"))))
+          "07j1ggzsqiskyz1i4mrnyr9i95v0dqi0i0hibnv1l188km8shmi8"))
+      (modules '((guix build utils)))
+      (snippet
+       '(begin
+          ;; Glances phones PyPI for weekly update checks by default.
+          ;; Disable these.  The user can re-enable them if desired.
+          (substitute* "glances/outdated.py"
+            (("^(.*)self\\.load_config\\(config\\)\n" line indentation)
+             (string-append indentation
+                            "self.args.disable_check_update = True\n"
+                            line)))
+          #t))))
   (build-system python-build-system)
   (propagated-inputs
-   `(("python-psutil" ,python-psutil)))
+   `(("python-future" ,python-future)
+     ("python-psutil" ,python-psutil)))
   (home-page
     "https://github.com/nicolargo/glances")
-  (synopsis
-    "A cross-platform curses-based monitoring tool")
+  (synopsis "Cross-platform curses-based monitoring tool")
   (description
     "Glances is a curses-based monitoring tool for a wide variety of platforms.
-Glances uses the PsUtil library to get information from your system. It monitors
-CPU, load, memory, network bandwidth, disk I/O, disk use, and more.")
+Glances uses the PsUtil library to get information from your system.  It
+monitors CPU, load, memory, network bandwidth, disk I/O, disk use, and more.")
   (license license:lgpl3+)))
 
 (define-public python2-glances
@@ -13068,17 +13271,18 @@ from your Flask project.  It is a fork of Flask-Swagger.")
 (define-public python-swagger-spec-validator
   (package
     (name "python-swagger-spec-validator")
-    (version "2.1.0")
+    (version "2.4.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "swagger-spec-validator" version))
        (sha256
         (base32
-         "13hkpn2lycwr0468yqhjb3kwszqf7hjwlq61w7vdxq1caz31k4nw"))))
+         "11g627icrsqwazsncwi0sdvprcj6hwaayw5xk3xsj8d97bmrzqjp"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-jsonschema" ,python-jsonschema)
+       ("python-pyyaml" ,python-pyyaml)
        ("python-six" ,python-six)))
     (home-page
      "https://github.com/Yelp/swagger_spec_validator")
@@ -14576,14 +14780,13 @@ working with iterables.")
 (define-public python-pybtex
   (package
     (name "python-pybtex")
-    (version "0.21")
+    (version "0.22.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pybtex" version))
        (sha256
-        (base32
-         "00300j8dn5pxq4ndxmfmbmycg2znawkqs49val2x6jlmfiy6r2mg"))))
+        (base32 "070wfcmxrd7xg1si421mi9150gmx2qwx431nwf69sq3hhmgnx080"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-nose" ,python-nose)))
@@ -14620,17 +14823,21 @@ time-based (TOTP) passwords.")
 (define-public python-parso
   (package
     (name "python-parso")
-    (version "0.3.1")
+    (version "0.5.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "parso" version))
        (sha256
         (base32
-         "18p89iwcm8mnf380f92g9w0bhx5km8wxp392vvjcq4y1ld1llw1m"))))
+         "171a9ivhxwsd52h1cgsz40zgzpgzscn7yqb7sdjhy8m1lzj0wsv6"))))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
     (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _ (invoke "pytest" "-vv"))))))
     (home-page "https://github.com/davidhalter/parso")
     (synopsis "Python Parser")
     (description "Parso is a Python parser that supports error recovery and
@@ -15901,3 +16108,160 @@ hash, recno, and queue.  Complete support of Berkeley DB distributed
 transactions.  Complete support for Berkeley DB Replication Manager.
 Complete support for Berkeley DB Base Replication.  Support for RPC.")
     (license license:bsd-3)))
+
+(define-public python-dbfread
+  (package
+    (name "python-dbfread")
+    (version "2.0.7")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "dbfread" version))
+              (sha256
+               (base32
+                "0gdpwdzf1fngsi6jrdyj4qdf6cr7gnnr3zp80dpkzbgz0spskj07"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://dbfread.readthedocs.io")
+    (synopsis "Read DBF Files with Python")
+    (description
+     "This library reads DBF files and returns the data as native Python data
+types for further processing.  It is primarily intended for batch jobs and
+one-off scripts.")
+    (license license:expat)))
+
+(define-public python-cached-property
+  (package
+    (name "python-cached-property")
+    (version "1.5.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cached-property" version))
+       (sha256
+        (base32
+         "010m1bl380l2r3vwq24r5v14l6gwvgm9v0mqqjkjss552jgsa5wj"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; https://github.com/pydanny/cached-property/issues/131
+         ;; recent versions of freezegun break one test
+         (add-after 'unpack 'disable-broken-test
+           (lambda _
+             (substitute* "tests/test_cached_property.py"
+               (("def test_threads_ttl_expiry\\(self\\)" m)
+                (string-append "@unittest.skip(\"Disabled by Guix\")\n"
+                               "    " m)))
+             #t)))))
+    (native-inputs
+     `(("python-freezegun" ,python-freezegun)))
+    (home-page
+     "https://github.com/pydanny/cached-property")
+    (synopsis
+     "Decorator for caching properties in classes")
+    (description
+     "This package provides a decorator which makes caching
+time-or-computationally-expensive properties quick and easy and works in Python
+2 or 3.")
+    (license license:bsd-3)))
+
+(define-public python-folium
+  (package
+    (name "python-folium")
+    (version "0.10.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "folium" version))
+       (sha256
+        (base32
+         "18fzxijsgrb95r0a8anc9ba5ijyw3nlnv3rpavfbkqa5v878x84f"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-branca" ,python-branca)
+       ("python-jinja2" ,python-jinja2)
+       ("python-numpy" ,python-numpy)
+       ("python-requests" ,python-requests)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/python-visualization/folium")
+    (synopsis "Make beautiful maps with Leaflet.js & Python")
+    (description "@code{folium} makes it easy to visualize data that’s been
+manipulated in Python on an interactive leaflet map.  It enables both the
+binding of data to a map for @code{choropleth} visualizations as well as
+passing rich vector/raster/HTML visualizations as markers on the map.
+
+The library has a number of built-in tilesets from OpenStreetMap, Mapbox, and
+Stamen, and supports custom tilesets with Mapbox or Cloudmade API keys.  It
+supports Image, Video, GeoJSON and TopoJSON overlays.")
+    (license license:expat)))
+
+(define-public jube
+  (package
+    ;; This is a command-line tool, so no "python-" prefix.
+    (name "jube")
+    (version "2.2.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://apps.fz-juelich.de/jsc/jube/jube2/download.php?version="
+                    version))
+              (sha256
+               (base32
+                "0xq4k1q63s1p6swgyp61vahlrd1fqmgbm0gm5kpj8ikwy0yc0nqk"))
+              (file-name (string-append "jube-" version ".tar.gz"))))
+    (build-system python-build-system)
+    (home-page "https://apps.fz-juelich.de/jsc/jube/jube2/docu/index.html")
+    (synopsis "Benchmarking environment")
+    (description
+     "JUBE helps perform and analyze benchmarks in a systematic way.  For each
+benchmarked application, benchmark data is stored in a format that allows JUBE
+to deduct the desired information.  This data can be parsed by automatic pre-
+and post-processing scripts that draw information and store it more densely
+for manual interpretation.")
+    (license license:gpl3+)))
+
+(define-public python-pyroutelib3
+  (package
+    (name "python-pyroutelib3")
+    (version "1.3.post1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyroutelib3" version))
+       (sha256
+        (base32
+         "1hpbydpn2alyswiajfbvhzq4c7f36vdmvxy91hgv8l1lb2g2vfrj"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-dateutil" ,python-dateutil)))
+    (home-page "https://github.com/MKuranowski/pyroutelib3")
+    (synopsis "Library for simple routing on OSM data")
+    (description "Library for simple routing on OSM data")
+    (license license:gpl3+)))
+
+(define-public python-elementpath
+  (package
+    (name "python-elementpath")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "elementpath" version))
+       (sha256
+        (base32
+         "1syn2z543brab23dskh3fjd9pqvz6npqbcicrs2d88dbg26xl08p"))))
+    (build-system python-build-system)
+    (home-page
+     "https://github.com/sissaschool/elementpath")
+    (synopsis
+     "XPath 1.0/2.0 parsers and selectors for ElementTree and lxml")
+    (description
+     "The proposal of this package is to provide XPath 1.0 and 2.0 selectors
+for Python's ElementTree XML data structures, both for the standard
+ElementTree library and for the @uref{http://lxml.de, lxml.etree} library.
+
+For lxml.etree this package can be useful for providing XPath 2.0 selectors,
+because lxml.etree already has it's own implementation of XPath 1.0.")
+    (license license:expat)))