gnu: python-dbusmock: Adjust indentation.
[jackhill/guix/guix.git] / gnu / packages / python-xyz.scm
index 59f7128..57c40aa 100644 (file)
@@ -41,7 +41,7 @@
 ;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
+;;; Copyright © 2017, 2018, 2019 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com>
 ;;; Copyright © 2017, 2019 Brendan Tildesley <mail@brendan.scot>
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages graphics)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-compression)
   #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
@@ -1154,95 +1156,6 @@ human-friendly syntax.")
 (define-public python2-schedule
   (package-with-python2 python-schedule))
 
-(define-public python-pandas
-  (package
-    (name "python-pandas")
-    (version "0.25.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "pandas" version))
-       (sha256
-        (base32 "1gp2pvzdiakvgjmykdzdlzrsfbg4vjm49jjdl9s0ha0a3yfs34fa"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:modules ((guix build utils)
-                  (guix build python-build-system)
-                  (ice-9 ftw)
-                  (srfi srfi-26))
-       #:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'patch-which
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (let ((which (assoc-ref inputs "which")))
-                        (substitute* "pandas/io/clipboard/__init__.py"
-                          (("^CHECK_CMD = .*")
-                           (string-append "CHECK_CMD = \"" which "\"\n"))))
-                      #t))
-                  (replace 'check
-                    (lambda _
-                      (let ((build-directory
-                             (string-append
-                              (getcwd) "/build/"
-                              (car (scandir "build"
-                                            (cut string-prefix? "lib." <>))))))
-                        ;; Disable the "strict data files" option which causes
-                        ;; the build to error out if required data files are
-                        ;; not available (as is the case with PyPI archives).
-                        (substitute* "setup.cfg"
-                          (("addopts = --strict-data-files") "addopts = "))
-                        (with-directory-excursion build-directory
-                          ;; Delete tests that require "moto" which is not yet
-                          ;; in Guix.
-                          (for-each delete-file
-                                    '("pandas/tests/io/conftest.py"
-                                      "pandas/tests/io/json/test_compression.py"
-                                      "pandas/tests/io/parser/test_network.py"
-                                      "pandas/tests/io/test_parquet.py"))
-                          (invoke "pytest" "-vv" "pandas" "--skip-slow"
-                                  "--skip-network" "-k"
-                                  ;; XXX: Due to the deleted tests above.
-                                  "not test_read_s3_jsonl"))))))))
-    (propagated-inputs
-     `(("python-numpy" ,python-numpy)
-       ("python-openpyxl" ,python-openpyxl)
-       ("python-pytz" ,python-pytz)
-       ("python-dateutil" ,python-dateutil)
-       ("python-xlrd" ,python-xlrd)))
-    (inputs
-     `(("which" ,which)))
-    (native-inputs
-     `(("python-cython" ,python-cython)
-       ("python-beautifulsoup4" ,python-beautifulsoup4)
-       ("python-lxml" ,python-lxml)
-       ("python-html5lib" ,python-html5lib)
-       ("python-nose" ,python-nose)
-       ("python-pytest" ,python-pytest)
-       ("python-pytest-mock" ,python-pytest-mock)))
-    (home-page "https://pandas.pydata.org")
-    (synopsis "Data structures for data analysis, time series, and statistics")
-    (description
-     "Pandas is a Python package providing fast, flexible, and expressive data
-structures designed to make working with structured (tabular,
-multidimensional, potentially heterogeneous) and time series data both easy
-and intuitive.  It aims to be the fundamental high-level building block for
-doing practical, real world data analysis in Python.")
-    (properties `((python2-variant . ,(delay python2-pandas))))
-    (license license:bsd-3)))
-
-;; Pandas 0.24.x are the last versions that support Python 2.
-(define-public python2-pandas
-  (let ((pandas (package-with-python2
-                 (strip-python2-variant python-pandas))))
-    (package/inherit
-     pandas
-     (version "0.24.2")
-     (source (origin
-               (method url-fetch)
-               (uri (pypi-uri "pandas" version))
-               (sha256
-                (base32
-                 "18imlm8xbhcbwy4wa957a1fkamrcb0z988z006jpfda3ki09z4ag")))))))
-
 (define-public python2-mechanize
   (package
     (name "python2-mechanize")
@@ -3094,19 +3007,20 @@ Language (TOML) configuration files.")
 (define-public python-jsonrpc-server
   (package
     (name "python-jsonrpc-server")
-    (version "0.1.2")
+    (version "0.3.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-jsonrpc-server" version))
        (sha256
         (base32
-         "0m4ykpcdy52x37n1ikysp07j7p8ialcdvvvsrjp3545sn7iiid09"))))
+         "0ddgdp26dfxaz6isjbb12974b3rxavgsqrn2zrmck62cmipg5g05"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-future" ,python-future)
        ("python-mock" ,python-mock)
-       ("python-pytest" ,python-pytest)))
+       ("python-pytest" ,python-pytest)
+       ("python-ujson" ,python-ujson)))
     (home-page
      "https://github.com/palantir/python-jsonrpc-server")
     (synopsis "JSON RPC 2.0 server library")
@@ -3140,14 +3054,14 @@ Server (PLS).")
 (define-public python-language-server
   (package
     (name "python-language-server")
-    (version "0.29.1")
+    (version "0.31.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-language-server" version))
        (sha256
         (base32
-         "1f8qlflh6j3s7qfmzhirpl8fgidl6f0qbakdmiml96wdxzvka0s3"))))
+         "1iq69wc1fyhirfyq25ih41wq9yvr7bchiw0i116adpdgcq6m9idq"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-pluggy" ,python-pluggy)
@@ -3307,42 +3221,6 @@ Mallard using the @command{ducktype} tool.  The yelp-tools package
 provides additional functionality on the produced Mallard documents.")
     (license license:expat)))
 
-(define-public python-scikit-image
-  (package
-    (name "python-scikit-image")
-    (version "0.14.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "scikit-image" version))
-       (sha256
-        (base32 "07qchljkyxvg5nrm12fvszi7pmjk4m01qp0w0z8syxzxxs20pz8s"))))
-    (build-system python-build-system)
-    (arguments
-     ;; TODO: Some tests require running X11 server. Disable them?
-     '(#:tests? #f))
-    ;; See DEPENDS.txt for the list of build and run time requiremnts
-    (propagated-inputs
-     `(("python-cloudpickle" ,python-cloudpickle)
-       ("python-dask" ,python-dask)
-       ("python-matplotlib" ,python-matplotlib)
-       ("python-networkx" ,python-networkx)
-       ("python-numpy" ,python-numpy)
-       ("python-pillow" ,python-pillow)
-       ("python-pywavelets" ,python-pywavelets)
-       ("python-scipy" ,python-scipy)
-       ("python-six" ,python-six)))
-    (native-inputs
-     `(("python-cython" ,python-cython)))
-    (home-page "http://scikit-image.org/")
-    (synopsis "Image processing in Python")
-    (description
-     "Scikit-image is a collection of algorithms for image processing.")
-    (license license:bsd-3)))
-
-(define-public python2-scikit-image
-  (package-with-python2 python-scikit-image))
-
 (define-public python-cython
   (package
     (name "python-cython")
@@ -4312,125 +4190,6 @@ those files.  It can also efficiently manipulate ranges of integers using set
 operators such as union, intersection, and difference.")
     (license license:asl2.0)))
 
-(define-public python-scipy
-  (package
-    (name "python-scipy")
-    (version "1.3.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "scipy" version))
-       (sha256
-        (base32 "192d8dsybvhv19igkrsafbdafx198nz7pibkjgrqjhlr66s3jfd0"))))
-    (build-system python-build-system)
-    (propagated-inputs
-     `(("python-numpy" ,python-numpy)
-       ("python-matplotlib" ,python-matplotlib)
-       ("python-pyparsing" ,python-pyparsing)))
-    (inputs
-     `(("lapack" ,lapack)
-       ("openblas" ,openblas)))
-    (native-inputs
-     `(("python-cython" ,python-cython)
-       ("python-pytest" ,python-pytest)
-       ("python-sphinx" ,python-sphinx)
-       ("python-numpydoc" ,python-numpydoc)
-       ("gfortran" ,gfortran)
-       ("perl" ,perl)
-       ("which" ,which)))
-    (outputs '("out" "doc"))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'disable-broken-tests
-           (lambda _
-             (substitute* "scipy/sparse/linalg/dsolve/tests/test_linsolve.py"
-               (("^( +)def test_threads_parallel\\(self\\):" m indent)
-                (string-append indent
-                               "@pytest.mark.skip(reason=\"Disabled by Guix\")\n"
-                               m)))
-             (substitute* "scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py"
-               (("^def test_parallel_threads\\(\\):" m)
-                (string-append "@pytest.mark.skip(reason=\"Disabled by Guix\")\n"
-                               m)))
-             #t))
-         (add-before 'build 'configure-openblas
-           (lambda* (#:key inputs #:allow-other-keys)
-             (call-with-output-file "site.cfg"
-               (lambda (port)
-                 (format port
-                         "[blas]
-libraries = openblas
-library_dirs = ~a/lib
-include_dirs = ~a/include
-
-# backslash-n to make emacs happy
-\n[atlas]
-library_dirs = ~a/lib
-atlas_libs = openblas
-"
-                         (assoc-ref inputs "openblas")
-                         (assoc-ref inputs "openblas")
-                         (assoc-ref inputs "openblas"))))
-             #t))
-         (add-after 'install 'install-doc
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                    (doc (string-append data "/doc/" ,name "-" ,version))
-                    (html (string-append doc "/html"))
-                    (pyver ,(string-append "PYVER=" (version-major+minor
-                                                     (package-version python))))
-                    ;; By default it tries to run sphinx-build through the Python
-                    ;; interpreter which won't work with our shell wrapper.
-                    (sphinxbuild "SPHINXBUILD=LANG=C sphinx-build"))
-               ;; Make installed package available for building the
-               ;; documentation
-               (add-installed-pythonpath inputs outputs)
-               (with-directory-excursion "doc"
-                 ;; Fix generation of images for mathematical expressions.
-                 (substitute* (find-files "source" "conf\\.py")
-                   (("pngmath_use_preview = True")
-                    "pngmath_use_preview = False"))
-                 (mkdir-p html)
-                 (invoke "make" "html" pyver sphinxbuild)
-                 (with-directory-excursion "build/html"
-                   (for-each (lambda (file)
-                               (let* ((dir (dirname file))
-                                      (tgt-dir (string-append html "/" dir)))
-                                 (install-file file html)))
-                             (find-files "." ".*")))))
-             #t))
-         ;; Tests can only be run after the library has been installed and not
-         ;; within the source directory.
-         (delete 'check)
-         (add-after 'install 'check
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (add-installed-pythonpath inputs outputs)
-             (with-directory-excursion "/tmp"
-               (invoke "python" "-c"
-                       "import scipy; scipy.test(verbose=2)")))))))
-    (home-page "https://www.scipy.org/")
-    (synopsis "The Scipy library provides efficient numerical routines")
-    (description "The SciPy library is one of the core packages that make up
-the SciPy stack.  It provides many user-friendly and efficient numerical
-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
-    (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
     (name "python-socksipy-branch")
@@ -4462,7 +4221,7 @@ as the original project seems to have been abandoned circa 2007.")
 (define-public python-socksipychain
   (package
     (name "python-socksipychain")
-    (version "2.0.15")
+    (version "2.1.0")
     (source
      (origin
        (method git-fetch)
@@ -4472,7 +4231,7 @@ as the original project seems to have been abandoned circa 2007.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1pkljnh9hfwla8sg7mil4f9zrnsqj0dbhr3crxjw3k8dnjz70dvk"))))
+         "0idm9a050rd2kbgbz2sk9ib9589kj4xh1xdnggs6xbq2v2y8f6zn"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f)) ; Tests try to access the network.
@@ -4485,9 +4244,6 @@ TLS/SSL encryption.  It was developed for use in PageKite, and also includes
 a simple netcat replacement with chaining support.")
     (license license:bsd-3)))
 
-(define-public python2-socksipychain
-  (package-with-python2 python-socksipychain))
-
 (define-public python-pycodestyle
   (package
     (name "python-pycodestyle")
@@ -4677,25 +4433,25 @@ the OleFileIO module from PIL, the Python Image Library.")
 (define-public python-pillow
   (package
     (name "python-pillow")
-    (version "6.1.0")
+    (version "6.2.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Pillow" version))
        (sha256
         (base32
-         "1pnrsz0f0n0c819v1pdr8j6rm8xvhc9f3kh1fv9xpdp9n5ygf108"))))
+         "1c8wkzc58f5wdh006jvmwdk3wxld1xgagcbdvj7iv17qi0m9fkmz"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-pytest" ,python-pytest)))
     (inputs
      `(("freetype" ,freetype)
        ("lcms"     ,lcms)
-       ("zlib"     ,zlib)
        ("libjpeg"  ,libjpeg)
-       ("openjpeg" ,openjpeg)
        ("libtiff"  ,libtiff)
-       ("libwebp"  ,libwebp)))
+       ("libwebp"  ,libwebp)
+       ("openjpeg" ,openjpeg)
+       ("zlib"     ,zlib)))
     (propagated-inputs
      `(("python-olefile" ,python-olefile)))
     (arguments
@@ -4706,13 +4462,15 @@ the OleFileIO module from PIL, the Python Image Library.")
              (substitute* "setup.py"
                (("\\['/sbin/ldconfig', '-p'\\]") "['true']"))))
          (replace 'check
-           (lambda* (#:key outputs inputs #:allow-other-keys)
-             (begin
-               (setenv "HOME" (getcwd))
-               ;; Make installed package available for running the tests.
-               (add-installed-pythonpath inputs outputs)
-               (invoke "python" "selftest.py" "--installed")
-               (invoke "python" "-m" "pytest" "-vv")))))))
+           (lambda* (#:key outputs inputs tests? #:allow-other-keys)
+             (if tests?
+               (begin
+                 (setenv "HOME" (getcwd))
+                 ;; Make installed package available for running the tests.
+                 (add-installed-pythonpath inputs outputs)
+                 (invoke "python" "selftest.py" "--installed")
+                 (invoke "python" "-m" "pytest" "-vv"))
+               #t))))))
     (home-page "https://python-pillow.org")
     (synopsis "Fork of the Python Imaging Library")
     (description
@@ -13288,14 +13046,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
@@ -16930,3 +16688,88 @@ scratch and manipulate data from Intel HEX file format.  It also includes
 several convenience Python scripts, including \"classic\" hex2bin and bin2hex
 converters and more, those based on the library itself.")
     (license license:bsd-3)))
+
+(define-public python-pykwalify
+  (package
+    (name "python-pykwalify")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pykwalify" version))
+       (sha256
+        (base32
+         "1cnfzkg1b01f825ikpw2fhjclf9c8akxjfrbd1vc22x1lg2kk2vy"))))
+    (build-system python-build-system)
+    (arguments '(#:tests? #f))          ;missing dependencies
+    (propagated-inputs
+     `(("python-dateutil" ,python-dateutil)
+       ("python-docopt" ,python-docopt)
+       ("python-pyyaml" ,python-pyyaml)))
+    (home-page "https://github.com/grokzen/pykwalify")
+    (synopsis
+     "Python lib/cli for JSON/YAML schema validation")
+    (description
+     "This package provides a parser, schema validator, and data binding tool
+for YAML and JSON.")
+    (license license:expat)))
+
+(define-public python-dbusmock
+  (package
+    (name "python-dbusmock")
+    (version "0.18.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-dbusmock" version))
+       (sha256
+        (base32
+         "0hp2kyac88nh9iv6l8hlmv7s1sa1s5f1a3wc2pmlmmxnd211fjlr"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-shell-path
+           (lambda _
+             (substitute* "tests/test_code.py"
+               (("/bin/bash") (which "bash")))
+             #t)))))
+    (native-inputs
+     `(;; For tests.
+       ("dbus" ,dbus) ; for dbus-daemon
+       ("python-nose" ,python-nose)
+       ("which" ,which)))
+    (propagated-inputs
+     `(("python-dbus" ,python-dbus)
+       ("python-pygobject" ,python-pygobject)))
+    (home-page "https://github.com/martinpitt/python-dbusmock")
+    (synopsis "Python library for mock D-Bus objects")
+    (description "python-dbusmock allows for the easy creation of mock objects on
+D-Bus.  This is useful for writing tests for software which talks to D-Bus
+services such as upower, systemd, logind, gnome-session or others, and it is
+hard (or impossible without root privileges) to set the state of the real
+services to what you expect in your tests.")
+    (license license:lgpl3+)))
+
+(define-public python-ujson
+  (package
+    (name "python-ujson")
+    (version "1.35")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ujson" version))
+       (sha256
+        (base32
+         "11jz5wi7mbgqcsz52iqhpyykiaasila4lq8cmc2d54bfa3jp6q7n"))))
+    (build-system python-build-system)
+    (home-page "http://www.esn.me")
+    (synopsis
+     "Ultra fast JSON encoder and decoder for Python")
+    (description
+     "UltraJSON is an ultra fast JSON encoder and decoder written in pure C with
+ bindings for Python 2.5+ and 3.")
+    (license license:bsd-3)))
+
+(define-public python2-ujson
+  (package-with-python2 python-ujson))