Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / python-xyz.scm
index 601e4b1..daef86b 100644 (file)
@@ -19,7 +19,7 @@
 ;;; Copyright © 2015, 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
-;;; Copyright © 2016, 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2016, 2018-2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016, 2017 Troy Sankey <sankeytms@gmail.com>
@@ -65,6 +65,7 @@
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
 ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -335,7 +336,14 @@ by @code{binstar}, @code{binstar-build} and @code{chalmers}.")
     (arguments
      `(#:phases (modify-phases %standard-phases
                   (replace 'check
-                    (lambda _ (invoke "pytest" "-vv"))))))
+                    (lambda _
+                      (invoke "pytest" "-vv" "-k"
+                              (string-append
+                               ;; XXX: These tests fail when using Pytest 4.x and
+                               ;; Babel 2.6.0.  Try removing this for later versions.
+                               "not test_no_inherit_metazone_marker_never_in_output"
+                               " and not test_smoke_dates"
+                               " and not test_smoke_numbers")))))))
     (home-page "http://babel.pocoo.org/")
     (synopsis
      "Tools for internationalizing Python applications")
@@ -386,6 +394,32 @@ certificate returned by the server to which a connection has been established,
 and verifies that it matches the intended target hostname.")
     (license license:psfl)))
 
+(define-public python-boolean.py
+  (package
+    (name "python-boolean.py")
+    (version "3.6")
+    (source
+     (origin
+       ;; There's no source tarball on PyPI.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/bastikr/boolean.py")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1wc89y73va58cj7dsx6c199zpxsy9q53dsffsdj6zmc90inqz6qs"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/bastikr/boolean.py")
+    (synopsis "Boolean algebra in one Python module")
+    (description
+     "This is a small Python library that implements boolean algebra.
+It defines two base elements, @code{TRUE} and @code{FALSE}, and a
+@code{Symbol} class that can take on one of these two values.  Calculations
+are done only in terms of @code{AND}, @code{OR}, and @code{NOT}---other
+compositions like @code{XOR} and @code{NAND} are emulated on top of them.
+Expressions are constructed from parsed strings or directly in Python.")
+    (license license:bsd-2)))
+
 (define-public python-hdf4
   (package
    (name "python-hdf4")
@@ -582,6 +616,29 @@ to users of that module.")
 (define-public python2-netcdf4
   (package-with-python2 python-netcdf4))
 
+(define-public python-license-expression
+  (package
+    (name "python-license-expression")
+    (version "0.999")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "license-expression" version))
+       (sha256
+        (base32 "08ppb0bxbrsxazy88sgpl9yffvdsabw6dkk1nc332wcz2mphwwyf"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-boolean.py" ,python-boolean.py)))
+    (home-page "https://github.com/nexB/license-expression")
+    (synopsis "Apply boolean logic to license expressions")
+    (description
+     "This Python module defines a tiny language to evaluate and compare
+license expressions using boolean logic.  Logical combinations of licenses can
+be tested for equality, containment, and equivalence.  They can be normalised
+and simplified.  It supports SPDX license expressions as well as other naming
+conventions and aliases in the same expression.")
+    (license license:gpl2+)))
+
 (define-public python-lockfile
   (package
     (name "python-lockfile")
@@ -707,6 +764,19 @@ Python 3 support.")
 (define-public python2-setuptools
   (package-with-python2 python-setuptools))
 
+;; The setuptools provided by Python 3.7.4 is too new for Tensorflow.
+(define-public python-setuptools-for-tensorflow
+  (hidden-package
+   (package
+     (inherit python-setuptools)
+     (version "39.1.0")
+     (source (origin
+               (inherit (package-source python-setuptools))
+               (uri (pypi-uri "setuptools" version ".zip"))
+               (sha256
+                (base32
+                 "1mzdhvfhnv4lggxa8rjl0dzqxvfx377gg5sqs57v89wrp09lwj65")))))))
+
 (define-public python-uniseg
   (package
     (name "python-uniseg")
@@ -882,6 +952,27 @@ messages in color.")
 (define-public python2-coloredlogs
   (package-with-python2 python-coloredlogs))
 
+(define-public python-editorconfig
+  (package
+    (name "python-editorconfig")
+    (version "0.12.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "EditorConfig" version))
+       (sha256
+        (base32
+         "0v55z351p9qkyp3bbspwywwn28sbcknhirngjbj779n3z52z63hv"))))
+    (build-system python-build-system)
+    (home-page "https://editorconfig.org/")
+    (synopsis "EditorConfig bindings for python")
+    (description "The EditorConfig project consists of a file format for
+defining coding styles and a collection of text editor plugins that enable
+editors to read the file format and adhere to defined styles.  EditorConfig
+files are easily readable and they work nicely with version control systems.")
+    ;; "fnmatch.py" and "ini.py" are licensed under psfl, the rest is bsd-2.
+    (license (list license:bsd-2 license:psfl))))
+
 (define-public python-et-xmlfile
   (package
     (name "python-et-xmlfile")
@@ -988,14 +1079,14 @@ from the Python interpreter, or as a small part of a larger application.")
 (define-public python-six
   (package
     (name "python-six")
-    (version "1.11.0")
+    (version "1.12.0")
     (source
      (origin
       (method url-fetch)
       (uri (pypi-uri "six" version))
       (sha256
        (base32
-        "1scqzwc51c875z23phj48gircqjgnn3af8zy2izjwmnlxrxsgs3h"))))
+        "0wxs1q74v07ssjywbbm7x6h5v9qx209ld2yfsif4060sxi0h2sni"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -1201,14 +1292,14 @@ Python 3.3+.")
 (define-public python-pyicu
   (package
     (name "python-pyicu")
-    (version "2.2")
+    (version "2.3.1")
     (source
      (origin
       (method url-fetch)
       (uri (pypi-uri "PyICU" version))
       (sha256
        (base32
-        "0wq9y5fi1ighgf5aws9nr87vi1w44p7q1k83rx2y3qj5d2xyhspa"))))
+        "1x4w8m7ifki9z2a187pgjr33z6z0rp2fii9b73djak1vhm9v9cnx"))))
     (build-system python-build-system)
     (inputs
      `(("icu4c" ,icu4c)))
@@ -1657,14 +1748,14 @@ server.")
 (define-public python-py
   (package
     (name "python-py")
-    (version "1.5.4")
+    (version "1.8.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "py" version))
        (sha256
         (base32
-         "1xxvwfn82457djf55f5n2c94699rfqnk43br8fif2r2q8gvrmm9z"))))
+         "0lsy1gajva083pzc7csj1cvbmminb7b4l6a0prdzyb3fd829nqyw"))))
     (build-system python-build-system)
     (arguments
      ;; FIXME: "ImportError: 'test' module incorrectly imported from
@@ -2106,14 +2197,14 @@ somewhat intelligible.")
 (define-public python-pyjwt
   (package
     (name "python-pyjwt")
-    (version "1.5.3")
+    (version "1.7.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "PyJWT" version))
        (sha256
         (base32
-         "1rxsg14i33vm2i6lz0my628108c81k43v10n4h3p0gx62xdyf2sh"))
+         "15hflax5qkw1v6nssk1r0wkj83jgghskcmn875m3wgvpzdvajncd"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -2201,13 +2292,13 @@ JavaScript-like message boxes.  Types of dialog boxes include:
   (package
     (name "python-pympler")
     (home-page "https://pythonhosted.org/Pympler/")
-    (version "0.5")
+    (version "0.7")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "Pympler" version))
               (sha256
                (base32
-                "03qwsbilqgvnbl3a1jmpgixbr2kq6m3fvdlzyr3wdp01bwlc85kx"))))
+                "0ki7bqp1h9l1xc2k1h4vjyzsgs20i8ingvcdhszyi72s28wyf4bs"))))
     (build-system python-build-system)
     (arguments
      `(#:phases (modify-phases %standard-phases
@@ -3252,11 +3343,39 @@ writing C extensions for Python as easy as Python itself.")
     (properties `((python2-variant . ,(delay python2-cython))))))
 
 (define-public python2-cython
-  (package (inherit (package-with-python2
-                     (strip-python2-variant python-cython)))
-    (name "python2-cython")
-    (inputs
-     `(("python-2" ,python-2))))) ; this is not automatically changed
+  (let ((base (package-with-python2 (strip-python2-variant python-cython))))
+    (package
+      (inherit base)
+      (name "python2-cython")
+      (inputs
+       `(("python-2" ,python-2)))       ;this is not automatically changed
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'check 'adjust-test_embed
+               (lambda _
+                 (substitute* "runtests.py"
+                   ;; test_embed goes great lengths to find the static libpythonX.Y.a
+                   ;; so it can give the right -L flag to GCC when embedding static
+                   ;; builds of Python.  It is unaware that the Python "config"
+                   ;; directory (where the static library lives) was renamed in
+                   ;; Python 3, and falls back to sysconfig.get_config_var('LIBDIR'),
+                   ;; which works fine, because that is where the shared library is.
+                   ;;
+                   ;; It also appears to be unaware that the Makefile in Demos/embed
+                   ;; already unconditionally pass the static library location to GCC,
+                   ;; after checking sysconfig.get_config_var('LIBPL).
+                   ;;
+                   ;; The effect is that the linker is unable to resolve libexpat
+                   ;; symbols when building for Python 2, because neither the Python 2
+                   ;; shared library nor Expat is available.   To fix it, we can either
+                   ;; add Expat as an input and make it visible to the linker, or just
+                   ;; prevent it from overriding the Python shared library location.
+                   ;; The end result is identical, so we take the easy route.
+                   ((" or libname not in os\\.listdir\\(libdir\\)")
+                    ""))
+                 #t)))))))))
 
 ;; The RPython toolchain currently does not support Python 3.
 (define-public python2-rpython
@@ -4267,14 +4386,14 @@ as the original project seems to have been abandoned circa 2007.")
 (define-public python-pycodestyle
   (package
     (name "python-pycodestyle")
-    (version "2.4.0")
+    (version "2.5.0")
     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "pycodestyle" version))
-        (sha256
-          (base32
-            "0fhy4vnlgpjq4qd1wdnl6pvdw7rah0ypmn8c9mkhz8clsndskz6b"))))
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pycodestyle" version))
+       (sha256
+        (base32
+         "0v4prb05n21bm8650v0a01k1nyqjdmkrsm3zycfxh2j5k9n962p4"))))
     (build-system python-build-system)
     (home-page "https://pycodestyle.readthedocs.io/")
     (synopsis "Python style guide checker")
@@ -4936,13 +5055,13 @@ child application and control it as if a human were typing commands.")
 (define-public python-setuptools-scm
   (package
     (name "python-setuptools-scm")
-    (version "3.1.0")
+    (version "3.2.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "setuptools_scm" version))
               (sha256
                (base32
-                "0h4bglwfz8b9prqljv8z3w9rgydfyxzaj05bm1y6zs5m6shz548i"))))
+                "0n3knn3p1sqlx31k2lahn7z9bacvlv8nhlfidj77vz50bxqlgasj"))))
     (build-system python-build-system)
     (home-page "https://github.com/pypa/setuptools_scm/")
     (synopsis "Manage Python package versions in SCM metadata")
@@ -4981,14 +5100,13 @@ older Python versions.")
 (define-public python-importlib-metadata
   (package
     (name "python-importlib-metadata")
-    (version "0.18")
+    (version "0.23")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "importlib_metadata" version))
        (sha256
-        (base32
-         "1nqj6vj2z4byi8flzf2lbldhqgicsz9mkpv4k69kjd8p8qxy4vnb"))))
+        (base32 "09mdqdfv5rdrwz80jh9m379gxmvk2vhjfz0fg53hid00icvxf65a"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-configparser" ,python-configparser)
@@ -5152,14 +5270,14 @@ away.")
 (define-public python-traitlets
   (package
     (name "python-traitlets")
-    (version "4.3.2")
+    (version "4.3.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "traitlets" version))
        (sha256
         (base32
-         "0dbq7sx26xqz5ixs711k5nc88p8a0nqyz6162pwks5dpcz9d4jww"))))
+         "1xsrwgivpkxlbr4dfndfsi098s29yqgswgjc1qqn69yxklvfw8yh"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -5167,7 +5285,7 @@ away.")
          (replace 'check (lambda _ (invoke "pytest" "-vv" "traitlets"))))))
     (propagated-inputs
      `(("python-ipython-genutils" ,python-ipython-genutils)
-       ("python-decorator" ,python-decorator)))    ;not needed for >4.3.2
+       ("python-decorator" ,python-decorator)))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
     (properties `((python2-variant . ,(delay python2-traitlets))))
@@ -5944,23 +6062,15 @@ of the structure, dynamics, and functions of complex networks.")
 (define-public python-datrie
   (package
     (name "python-datrie")
-    (version "0.7.1")
+    (version "0.8")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "datrie" version))
        (sha256
         (base32
-         "08r0if7dry2q7p34gf7ffyrlnf4bdvnprxgydlfxgfnvq8f3f4bs"))))
+         "0338r8xgmpy78556jhms0h6qkvyjr10p8bpgdvcpqzm9lrmxmmdx"))))
     (build-system python-build-system)
-    (arguments
-     `(#:phases (modify-phases %standard-phases
-                  (add-before 'build 'cythonize
-                    (lambda _
-                      ;; Regenerate Cython classes to solve ABI issues with Python
-                      ;; 3.7.0.  See <https://github.com/pytries/datrie/issues/52>.
-                      (invoke "cython" "src/datrie.pyx" "src/cdatrie.pxd"
-                              "src/stdio_ext.pxd" "-a"))))))
     (native-inputs
      `(("python-cython" ,python-cython)
        ("python-hypothesis" ,python-hypothesis)
@@ -6434,7 +6544,8 @@ applications.")
         (uri (pypi-uri "pep8" version))
         (sha256
           (base32
-            "002rkl4lsn6x2mxmf8ar00l0m8i3mzrc6pnzz77blyksmpsxa4x1"))))
+           "002rkl4lsn6x2mxmf8ar00l0m8i3mzrc6pnzz77blyksmpsxa4x1"))
+        (patches (search-patches "python-pep8-stdlib-tokenize-compat.patch"))))
     (build-system python-build-system)
     (home-page "https://pep8.readthedocs.org/")
     (synopsis "Python style guide checker")
@@ -6449,14 +6560,14 @@ PEP 8.")
 (define-public python-pyflakes
   (package
     (name "python-pyflakes")
-    (version "2.0.0")
+    (version "2.1.1")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "pyflakes" version))
         (sha256
           (base32
-            "0jba28czyvimdc72llms3f17swp3i8jdcabf5w0j00adfbn64xls"))))
+            "18pq95a1xj2dgdd0m85gyfsn40jajj4xc3lp8wfv7igqhrc86xnr"))))
     (build-system python-build-system)
     (home-page
       "https://github.com/pyflakes/pyflakes")
@@ -6545,35 +6656,20 @@ complexity of Python source code.")
 (define-public python2-pyflakes-0.8.1
   (package-with-python2 python-pyflakes-0.8.1))
 
-;; This package is used by hypothesis which has thousands of dependent packages.
-;; FIXME: Consolidate this with "python-flake8" below in the next rebuild cycle.
-(define-public python-flake8-3.5
+(define-public python-flake8
   (package
     (name "python-flake8")
-    (version "3.5.0")
-    (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "flake8" version))
-        (sha256
-          (base32
-            "184b33grvvjmiwlv9kyd7yng9qv5ld24154j70z332xxg9gjclvj"))))
+    (version "3.7.7")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "flake8" version))
+              (sha256
+               (base32
+                "0qg6zggqigrd4k3gv88shd1a27d0cwgfql8vfiq2c7rl7w3rd6c5"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         ;; Two errors don't seem to have assigned codes.
-         (add-after 'unpack 'delete-broken-test
-           (lambda _ (delete-file "tests/unit/test_pyflakes_codes.py") #t))
-         (add-after 'unpack 'fix-problem-with-pycodestyle
-           (lambda _
-             ;; See https://gitlab.com/pycqa/flake8/merge_requests/230
-             ;; This should no longer be needed with the next release.
-             (substitute* "setup.py"
-               (("PEP8_PLUGIN\\('break_around_binary_operator'\\),")
-                "PEP8_PLUGIN('break_after_binary_operator'),\
-PEP8_PLUGIN('break_before_binary_operator'),"))
-             #t))
          (delete 'check)
          (add-after 'install 'check
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -6582,6 +6678,7 @@ PEP8_PLUGIN('break_before_binary_operator'),"))
              #t)))))
     (propagated-inputs
      `(("python-pycodestyle" ,python-pycodestyle)
+       ("python-entrypoints" ,python-entrypoints)
        ("python-pyflakes" ,python-pyflakes)
        ("python-mccabe" ,python-mccabe)))
     (native-inputs
@@ -6593,45 +6690,18 @@ PEP8_PLUGIN('break_before_binary_operator'),"))
       "The modular source code checker: pep8, pyflakes and co")
     (description
       "Flake8 is a wrapper around PyFlakes, pep8 and python-mccabe.")
-    (properties `((python2-variant . ,(delay python2-flake8-3.5))))
+    (properties `((python2-variant . ,(delay python2-flake8))))
     (license license:expat)))
 
-(define-public python2-flake8-3.5
-  (let ((base (package-with-python2 (strip-python2-variant python-flake8-3.5))))
+(define-public python2-flake8
+  (let ((base (package-with-python2 (strip-python2-variant python-flake8))))
     (package (inherit base)
       (propagated-inputs
        `(("python2-configparser" ,python2-configparser)
          ("python2-enum34" ,python2-enum34)
+         ("python2-typing" ,python2-typing)
           ,@(package-propagated-inputs base))))))
 
-;; Version 3.5.0 has compatibility issues with Pyflakes 2.0, so we need
-;; this newer version.  Keep it as a separate variable for now to avoid
-;; rebuilding "python-hypothesis"; this should be removed in the next
-;; rebuild cycle.
-(define-public python-flake8
-  (package
-    (inherit python-flake8-3.5)
-    (version "3.6.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "flake8" version))
-              (sha256
-               (base32
-                "0w0nprx22rbvrrkbfx9v5jc5gskbm08g219l7r8wai8zfswgadba"))))
-    (arguments
-     (substitute-keyword-arguments (package-arguments python-flake8-3.5)
-       ((#:phases phases)
-        `(modify-phases ,phases
-           (delete 'delete-broken-test)
-           (delete 'fix-problem-with-pycodestyle)))))
-    (properties `((python2-variant . ,(delay python2-flake8))))))
-
-(define-public python2-flake8
-  (let ((base (package-with-python2 (strip-python2-variant python-flake8))))
-    (package (inherit base)
-             (propagated-inputs
-              (package-propagated-inputs python2-flake8-3.5)))))
-
 ;; python-hacking requires flake8 <2.6.0.
 (define-public python-flake8-2.5
   (package
@@ -6675,6 +6745,12 @@ PEP8_PLUGIN('break_before_binary_operator'),"))
        (modify-phases %standard-phases
          (replace 'check
            (lambda _
+             ;; Be compatible with Pytest 4:
+             ;; https://gitlab.com/pycqa/flake8-polyfill/merge_requests/7
+             (substitute* "setup.cfg"
+               (("\\[pytest\\]")
+                "[tool:pytest]"))
+
              (setenv "PYTHONPATH"
                      (string-append (getcwd) "/build/lib:"
                                     (getenv "PYTHONPATH")))
@@ -6808,12 +6884,16 @@ pseudo terminal (pty), and interact with both the process and its pty.")
                ;; lines, but the test expects a single line...
                (("env\\['COLUMNS'\\] = '80'")
                 "env['COLUMNS'] = '160'"))
+
+             (substitute* "Makefile"
+               ;; Recent versions of python-coverage have caused the test
+               ;; coverage to decrease (as of version 0.7).  Allow that.
+               (("--fail-under=100")
+                "--fail-under=90"))
+
              #t))
-         (delete 'check)
-         (add-after 'install 'check
+         (replace 'check
            ;; The test phase uses the built library and executable.
-           ;; It's easier to run it after install since the build
-           ;; directory contains version-specific PATH.
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (add-installed-pythonpath inputs outputs)
              (setenv "PATH" (string-append (getenv "PATH") ":"
@@ -6859,13 +6939,13 @@ add functionality and customization to your projects with their own plugins.")
 (define-public python-fonttools
   (package
     (name "python-fonttools")
-    (version "3.28.0")
+    (version "3.38.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "fonttools" version ".zip"))
               (sha256
                (base32
-                "0vsvjhidpb5kywpjgz1j3fywzkddxkb0afqai18qa3h6lqjyxwpb"))))
+                "12ripk3s7skgxr1bs9r8n13r94ym3s8iir7ivfixls9fa4dabmlh"))))
     (build-system python-build-system)
     (native-inputs
      `(("unzip" ,unzip)
@@ -7662,20 +7742,21 @@ Jupyter Notebook format and Python APIs for working with notebooks.")
 (define-public python-bleach
   (package
     (name "python-bleach")
-    (version "1.4.3")
+    (version "3.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "bleach" version))
        (sha256
         (base32
-         "0jvg3jxrvnx7xmm9gj262v60ib452xlnwlb0navyp7jsvcd0d4qj"))))
+         "1yhrgrhkln8bd6gn3imj69g1h4xqah9gaz9q26crqr6gmmvpzprz"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-html5lib" ,python-html5lib-0.9)
+     `(("python-webencodings" ,python-webencodings)
        ("python-six" ,python-six)))
     (native-inputs
-     `(("python-nose" ,python-nose)))
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner-2)))
     (home-page "https://github.com/jsocol/bleach")
     (synopsis "Whitelist-based HTML-sanitizing tool")
     (description "Bleach is an easy whitelist-based HTML-sanitizing tool.")
@@ -8014,6 +8095,45 @@ Jupyter kernels such as IJulia and IRKernel.")
 support for rich media output.")
     (license license:bsd-3)))
 
+(define-public python-jsbeautifier
+  (package
+    (name "python-jsbeautifier")
+    (version "1.10.2")
+    (home-page "https://github.com/beautify-web/js-beautify")
+    (source (origin
+             (method git-fetch)
+             (uri (git-reference
+                   (url home-page)
+                   (commit (string-append "v" version))))
+             (file-name (git-file-name name version))
+             (sha256
+              (base32
+               "0wawb070ki1axb3jc9xvsrgpji52vcfif3zmjzc3z4g98m5xw4kg"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'chdir
+                    (lambda _
+                      ;; The upstream Git repository contains all the code,
+                      ;; but this package only builds the python code.
+                      (chdir "python")
+                      #t))
+                  (add-after 'unpack 'patch-python-six-requirements
+                    (lambda _
+                      (substitute* "python/setup.py"
+                        (("six>=1.12.0")
+                         "six>=1.11.0"))
+                      #t)))))
+    (propagated-inputs
+     `(("python-editorconfig" ,python-editorconfig)
+       ("python-six" ,python-six)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (synopsis "JavaScript unobfuscator and beautifier")
+    (description "Beautify, unpack or deobfuscate JavaScript, leveraging
+popular online obfuscators.")
+    (license license:expat)))
+
 (define-public jupyter
   (package
     (name "jupyter")
@@ -8063,6 +8183,8 @@ simulation, statistical modeling, machine learning and much more.")
        ("python-pytest" ,python-pytest)
        ("python-pytest-runner" ,python-pytest-runner)))
     (build-system python-build-system)
+    ;; XXX: Incompatible with Pytest 4: <https://github.com/chardet/chardet/issues/173>.
+    (arguments `(#:tests? #f))
     (home-page "https://github.com/chardet/chardet")
     (synopsis "Universal encoding detector for Python 2 and 3")
     (description
@@ -8309,13 +8431,13 @@ tables.")
 (define-public python-atomicwrites
   (package
     (name "python-atomicwrites")
-    (version "1.1.5")
+    (version "1.3.0")
     (source (origin
              (method url-fetch)
              (uri (pypi-uri "atomicwrites" version))
              (sha256
               (base32
-               "11bm90fwm2avvf4f3ib8g925w7jr4m11vcsinn1bi6ns4bm32214"))))
+               "19ngcscdf3jsqmpcxn6zl5b6anmsajb6izp1smcd1n02midl9abm"))))
     (build-system python-build-system)
     (synopsis "Atomic file writes in Python")
     (description "Library for atomic file writes using platform dependent tools
@@ -8628,11 +8750,14 @@ otherwise matches 3.2’s API.")
          (base32
           "0rdjmmsab550kxsssdq49jcniz77zlkpw4pvi9hvib3lsskjmh4y"))))
     (build-system python-build-system)
-    (arguments `(#:python ,python-2
-                 ;; FIXME: Python 2.7.14 moved the test.support library,
-                 ;; but our package has not yet been adjusted.  Enable
-                 ;; tests when the python2 package has been fixed.
-                 #:tests? #f))
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "python" "test_futures.py")
+             #t)))))
     (home-page "https://github.com/agronholm/pythonfutures")
     (synopsis
      "Backport of the concurrent.futures package from Python 3.2")
@@ -8746,14 +8871,14 @@ library as well as on the command line.")
 (define-public python-pluggy
   (package
    (name "python-pluggy")
-   (version "0.7.1")
+   (version "0.11.0")
    (source
     (origin
      (method url-fetch)
      (uri (pypi-uri "pluggy" version))
      (sha256
       (base32
-       "1qbn70mksmr03hac6jgp6fiqc4l7859z8dchx2x950vhlij87swm"))))
+       "10511a54dvafw1jrk75mrhml53c7b7w4yaw7241696lc2hfvr895"))))
    (build-system python-build-system)
    (native-inputs
     `(("python-setuptools-scm" ,python-setuptools-scm)))
@@ -9391,13 +9516,13 @@ anymore.")
 (define-public python2-pathlib2
   (package
     (name "python2-pathlib2")
-    (version "2.3.2")
+    (version "2.3.3")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "pathlib2" version))
               (sha256
                (base32
-                "10yb0iv5x2hs631rcppkhbddx799d3h8pcwmkbh2a66ns3w71ccf"))))
+                "0hpp92vqqgcd8h92msm9slv161b1q160igjwnkf2ag6cx0c96695"))))
     (build-system python-build-system)
     ;; We only need the the Python 2 variant, since for Python 3 our minimum
     ;; version is 3.4 which already includes this package as part of the
@@ -9989,13 +10114,6 @@ graphviz.")
                   (guix build utils)
                   (guix build python-build-system))
        #:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'unpack-libev
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (mkdir-p "deps/libev")
-                      ;; FIXME: gevent requires building libev, even though
-                      ;; it only links against the proper one.
-                      (invoke "tar" "-xf" (assoc-ref inputs "libev-source")
-                              "--strip-components=1" "-C" "deps/libev")))
                   (add-before 'patch-source-shebangs 'patch-hard-coded-paths
                     (lambda _
                       (substitute* "src/gevent/subprocess.py"
@@ -10013,6 +10131,11 @@ graphviz.")
                       (setenv "CARES_EMBED" "false")
                       (setenv "EMBED" "false")
 
+                      ;; Prevent building bundled libev.
+                      (substitute* "setup.py"
+                        (("run_make=_BUILDING")
+                         "run_make=False"))
+
                       (let ((greenlet (string-append
                                        (assoc-ref inputs "python-greenlet")
                                        "/include")))
@@ -10020,7 +10143,7 @@ graphviz.")
                                         (lambda (item)
                                           (string-prefix? "python" item)))
                           ((python)
-                           (setenv "CPATH"
+                           (setenv "C_INCLUDE_PATH"
                                    (string-append greenlet "/" python)))))
                       #t))
                   (add-before 'check 'skip-timer-test
@@ -10052,8 +10175,7 @@ graphviz.")
      `(("python-greenlet" ,python-greenlet)
        ("python-objgraph" ,python-objgraph)))
     (native-inputs
-     `(("libev-source" ,(package-source libev))
-       ("python-six" ,python-six)))
+     `(("python-six" ,python-six)))
     (inputs
      `(("c-ares" ,c-ares)
        ("libev" ,libev)))
@@ -10851,6 +10973,16 @@ hardware-accelerated multitouch applications.")
                (base32
                 "0qc006986rb6bcbmiymwgcl1mns2jphr1j7sr7nk41nlr7gh359m"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tests
+           (lambda _
+             ;; TypeError: binary() got an unexpected keyword argument
+             ;; 'average_size'.
+             (substitute* "tests/test_check.py"
+              (("average_size=512") ""))
+             #t)))))
     (propagated-inputs
      `(("python-chardet" ,python-chardet)
        ("python-hypothesis" ,python-hypothesis)))
@@ -12139,15 +12271,6 @@ protocols.")
   (package
     (inherit python-attrs)
     (name "python-attrs-bootstrap")
-    ;; Keep this on a fixed version so python-attrs can be updated without
-    ;; triggering a mass-rebuild.  FIXME: Update this in the next rebuild cycle.
-    (version "17.4.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "attrs" version))
-              (sha256
-               (base32
-                "1jafnn1kzd6qhxgprhx6y6ik1r5m2rilx25syzcmq03azp660y8w"))))
     (native-inputs `())
     (arguments `(#:tests? #f))))
 
@@ -12447,17 +12570,14 @@ of @code{functools.lru_cache} from python 3.3.")
 (define-public python-configparser
   (package
     (name "python-configparser")
-    (version "3.5.0")
+    (version "3.7.1")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://bitbucket.org/ambv/configparser/get/"
-             version ".tar.bz2"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (uri (pypi-uri "configparser" version))
        (sha256
         (base32
-         "0waq40as14abwzbb321hfz4vr1fi363nscy32ga14qvfygrg96wa"))))
+         "0cnz213il9lhgda6x70fw7mfqr8da43s3wm343lwzhqx94mgmmav"))))
     (build-system python-build-system)
     (home-page "https://github.com/jaraco/configparser/")
     (synopsis "Backport of configparser from python 3.5")
@@ -12810,14 +12930,14 @@ several utilities, as well as an API for building localization tools.")
 (define-public python-packaging
   (package
     (name "python-packaging")
-    (version "19.0")
+    (version "19.2")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "packaging" version))
         (sha256
          (base32
-          "1brjhygq9dz6x1kdljivkjfldi3qf5rbkqgck1bpgv9qpv8ab60c"))))
+          "0izwlz9h0bw171a1chr311g2y7n657zjaf4mq4rgm8pp9lbj9f98"))))
     (build-system python-build-system)
     (arguments
      `(#:phases (modify-phases %standard-phases
@@ -13637,10 +13757,15 @@ ignoring formatting changes.")
       "Make loops show a progress bar on the console by just wrapping any
 iterable with @code{|tqdm(iterable)|}.  Offers many options to define
 design and layout.")
-    (license (list license:mpl2.0 license:expat))))
+    (license (list license:mpl2.0 license:expat))
+    (properties `((python2-variant . ,(delay python2-tqdm))))))
 
 (define-public python2-tqdm
-  (package-with-python2 python-tqdm))
+  (let ((tqdm (package-with-python2
+                (strip-python2-variant python-tqdm))))
+    (package (inherit tqdm)
+      (native-inputs `(("python2-functools32" ,python2-functools32)
+                        ,@(package-native-inputs tqdm))))))
 
 (define-public python-pkginfo
   (package
@@ -14774,41 +14899,40 @@ file system events on Linux.")
 (define-public python-more-itertools
   (package
     (name "python-more-itertools")
-    (version "4.3.0")
+    (version "7.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "more-itertools" version))
        (sha256
         (base32
-         "17h3na0rdh8xq30w4b9pizgkdxmm51896bxw600x84jflg9vaxn4"))))
+         "16phg2f2dvm6ci5wr49ncha5lmc0m2in3bsl33c61vzca4gkvd4b"))))
     (build-system python-build-system)
-    (arguments
-     `(,@(if (any (cute string-prefix? <> (or (%current-system)
-                                              (%current-target-system)))
-                  '("armhf" "i686"))
-        '(#:phases
-          (modify-phases %standard-phases
-          ;; This is required for 32-bit hardware.
-          ;; TODO: Try to remove this when upgrading.
-          (add-after 'unpack 'patch-test
-            (lambda _
-              (substitute* "more_itertools/tests/test_more.py"
-                (("10 \\*\\* 10") "9 ** 9"))
-              #t))))
-        '())))
-    (propagated-inputs
-     `(("python-six" ,python-six-bootstrap)))
     (home-page "https://github.com/erikrose/more-itertools")
     (synopsis "More routines for operating on iterables, beyond itertools")
     (description "Python's built-in @code{itertools} module implements a
 number of iterator building blocks inspired by constructs from APL, Haskell,
 and SML.  @code{more-itertools} includes additional building blocks for
 working with iterables.")
+    (properties `((python2-variant . ,(delay python2-more-itertools))))
     (license license:expat)))
 
+;; The 5.x series are the last versions supporting Python 2.7.
 (define-public python2-more-itertools
-  (package-with-python2 python-more-itertools))
+  (package
+    (inherit python-more-itertools)
+    (name "python2-more-itertools")
+    (version "5.0.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "more-itertools" version))
+              (sha256
+               (base32
+                "1r12cm6mcdwdzz7d47a6g4l437xsvapdlgyhqay3i2nrlv03da9q"))))
+    (arguments
+     `(#:python ,python2-minimal))
+    (propagated-inputs
+     `(("python2-six" ,python2-six-bootstrap)))))
 
 (define-public python-latexcodec
   (package
@@ -15078,7 +15202,7 @@ under Python 2.7.")
 (define-public pybind11
   (package
     (name "pybind11")
-    (version "2.2.4")
+    (version "2.3.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -15086,7 +15210,7 @@ under Python 2.7.")
                     (commit (string-append "v" version))))
               (sha256
                (base32
-                "0pa79ymcasv8br5ifbx7878id5py2jpjac3i20cqxr6gs9l6ivlv"))
+                "11b6dniri8m05spfd2a19irz82shf4sdca73566bniggrf3zclnf"))
               (file-name (git-file-name name version))))
     (build-system cmake-build-system)
     (native-inputs
@@ -16316,3 +16440,51 @@ 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)))
+
+(define-public python-bibtexparser
+  (package
+    (name "python-bibtexparser")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "bibtexparser" version))
+       (sha256
+        (base32
+         "0zwhfkrzf3n5847dbnfng92k7ak199l9v6x6ax3dgdidfpm6d2fz"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-pyparsing" ,python-pyparsing)))
+    (native-inputs
+     `(("python-future" ,python-future)))
+    (home-page "https://github.com/sciunto-org/python-bibtexparser")
+    (synopsis "Python library to parse BibTeX files")
+    (description "BibtexParser is a Python library to parse BibTeX files.")
+    (license (list license:bsd-3 license:lgpl3))))
+
+(define-public python-distro
+  (package
+    (name "python-distro")
+    (version "1.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "distro" version))
+       (sha256
+        (base32
+         "0mrg75w4ap7mdzyga75yaid9n8bgb345ih5mwjp3plj6v1jxwb9n"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/nir0s/distro")
+    (synopsis
+     "OS platform information API")
+    (description
+     "@code{distro} provides information about the OS distribution it runs on,
+such as a reliable machine-readable ID, or version information.
+
+It is the recommended replacement for Python's original
+`platform.linux_distribution` function (which will be removed in Python 3.8).
+@code{distro} also provides a command-line interface to output the platform
+information in various formats.")
+    (license license:asl2.0)))