gnu: mingw: Add x86_64 support.
[jackhill/guix/guix.git] / gnu / packages / python-xyz.scm
index e27cb16..459d5d4 100644 (file)
@@ -62,6 +62,8 @@
 ;;; 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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -315,14 +317,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 +349,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 +2342,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 +2546,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.
@@ -3090,20 +3122,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 +3191,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 +3230,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 +3500,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
@@ -3777,22 +3820,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
        ("python-pycairo" ,python-pycairo)
-       ;; XXX: qtwebkit cannot be built reliably.
-       ("python-pyqt" ,python-pyqt-without-qtwebkit)
        ("python-cairocffi" ,python-cairocffi)))
     (inputs
      `(("libpng" ,libpng)
@@ -3813,12 +3845,10 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
        (modify-phases %standard-phases
          (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)
@@ -3873,7 +3903,7 @@ toolkits.")
        ("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 +3914,6 @@ toolkits.")
 
                                         texlive-generic-pdftex
 
-                                        texlive-fonts-amsfonts
                                         texlive-fonts-ec
                                         texlive-fonts-adobe-times
                                         texlive-fonts-txfonts)))
@@ -4383,14 +4412,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 +4442,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 +4874,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
@@ -5102,7 +5132,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 +5179,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
@@ -5418,11 +5470,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
@@ -7200,6 +7251,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))
 
@@ -8106,14 +8168,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 +8556,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 +8787,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")
@@ -10863,25 +10951,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 +13167,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")
@@ -15901,3 +16001,60 @@ 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)))