gnu: python-responses: Update to 0.10.6.
[jackhill/guix/guix.git] / gnu / packages / python-web.scm
index 7c6d055..735f033 100644 (file)
@@ -28,6 +28,8 @@
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2019 Vagrant Cascadian <vagrant@debian.org>
+;;; Copyright © 2019 Brendan Tildesley <mail@brendan.scot>
+;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages django)
+  #:use-module (gnu packages groff)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages time)
   #:use-module (gnu packages web)
 (define-public python-aiohttp
   (package
     (name "python-aiohttp")
-    (version "3.4.4")
+    (version "3.5.4")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "aiohttp" version))
        (sha256
         (base32
-         "1ykm6kdjkrg556j0zd7dx2l1rsrbh0d9g27ivr6dmaahz9pyrbsi"))))
+         "1gy95ni8rkdwzir9zf14ivpfwp02g69xbhibldykff0rzbs86k4w"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f))                    ;missing pytest-timeout
@@ -150,22 +154,22 @@ using @url{https://github.com/saghul/pycares,pycares}.")
 (define-public python-aiorpcx
   (package
     (name "python-aiorpcx")
-    (version "0.10.2")
+    (version "0.18.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "aiorpcX" version))
        (sha256
         (base32
-         "1p88k15jh0d2a18pnnbfcamsqi2bxvmmhpizmdlxfdxf8vy5ggyj"))))
+         "0k545hc7wl6sh1svydzbv6x7sx5pig2pqkl3yxs9riwmvzawx9xp"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-attrs" ,python-attrs)))
     (home-page "https://github.com/kyuupichan/aiorpcX")
     (synopsis "Generic asyncio RPC implementation")
     (description
-     "aiorpcX is a generic asyncio library implementation of RPC suitable for
-an application that is a client, server or both.
+     "The aiorpcX library is a generic asyncio implementation of RPC suitable
+for an application that is a client, server or both.
 
 The package includes a module with full coverage of JSON RPC versions 1.0 and
 2.0, JSON RPC protocol auto-detection, and arbitrary message framing.  It also
@@ -299,6 +303,28 @@ other HTTP libraries.")
 (define-public python2-httplib2
   (package-with-python2 python-httplib2))
 
+(define-public python-html2text
+  (package
+    (name "python-html2text")
+    (version "2018.1.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "html2text" version))
+       (sha256
+        (base32
+         "1m6d7ciq30adc3d1n8g6r46072n7q8kdy039pqvnnmp763xi8xb2"))))
+    (build-system python-build-system)
+    (home-page "https://pypi.org/project/html2text/")
+    (synopsis "Convert HTML into plain text")
+    (description "html2text takes HTML and converts it into plain ASCII text
+which is also valid markdown.  html2text was originally written by Aaron
+Swartz.")
+    (license license:gpl3+)))
+
+(define-public python2-html2text
+  (package-with-python2 python-html2text))
+
 (define-public python-mechanicalsoup
   (package
     (name "python-mechanicalsoup")
@@ -637,6 +663,28 @@ options.")
 (define-public python2-cssutils
   (package-with-python2 python-cssutils))
 
+(define-public python-css-parser
+  (package
+    (inherit python-cssutils)
+    (name "python-css-parser")
+    (version "1.0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "css-parser" version ".tar.gz"))
+       (sha256
+        (base32
+         "0i4xfykiffxzr4f6y0m2ggqvx1rzam6pw6krlr5k6ldf29akbay7"))))
+    (home-page "https://github.com/ebook-utils/css-parser")
+    (synopsis "Fork of cssutils modified for parsing ebooks")
+    (description
+     "Css-parser is a fork of cssutils 1.0.2, updated and modified for parsing
+ebooks, due to cssutils not receiving updates as of 1.0.2.")
+    (license license:lgpl3+)))
+
+(define-public python2-css-parser
+  (package-with-python2 python-css-parser))
+
 (define-public python-cssselect
   (package
     (name "python-cssselect")
@@ -816,6 +864,7 @@ term.js Javascript terminal emulator library.")
       (propagated-inputs
        `(("python2-backport-ssl-match-hostname"
           ,python2-backport-ssl-match-hostname)
+         ("python2-futures" ,python2-futures)
           ,@(package-propagated-inputs terminado))))))
 
 (define-public python-wsgi-intercept
@@ -1280,15 +1329,19 @@ WebSocket usage in Python programs.")
 (define-public python-requests
   (package
     (name "python-requests")
-    (version "2.13.0")
+    (version "2.22.0")
     (source (origin
              (method url-fetch)
              (uri (pypi-uri "requests" version))
              (sha256
               (base32
-               "1s0wg4any4dsv5l3hqjxqk2zgb7pdbqhy9rhc8kh3aigfq4ws8jp"))))
-    ;; TODO: unbundle urllib3 and chardet.
+               "1d5ybh11jr5sm7xp6mz8fyc7vrp4syifds91m7sj60xalal0gq0i"))))
     (build-system python-build-system)
+    (propagated-inputs
+     `(("python-certifi" ,python-certifi)
+       ("python-chardet" ,python-chardet)
+       ("python-idna" ,python-idna)
+       ("python-urllib3" ,python-urllib3)))
     (arguments
      ;; FIXME: Some tests require network access.
      '(#:tests? #f))
@@ -1299,6 +1352,22 @@ WebSocket usage in Python programs.")
 than Python’s urllib2 library.")
     (license license:asl2.0)))
 
+;; Some software requires an older version of Requests, notably Docker/Docker
+;; Compose.
+(define-public python-requests-2.20
+  (package (inherit python-requests)
+           (version "2.20.1")
+           (source (origin
+                     (method url-fetch)
+                     (uri (pypi-uri "requests" version))
+                     (sha256
+                      (base32
+                       "0qzj6cgv3k9wyj7wlxgz7xq0cfg4jbbkfm24pp8dnhczwl31527a"))))
+           (propagated-inputs
+            `(("python-urllib3" ,python-urllib3-1.24)
+              ("python-idna" ,python-idna-2.7)
+              ,@(package-propagated-inputs python-requests)))))
+
 ;; Some software requires an older version of Requests, notably Docker
 ;; Compose.
 (define-public python-requests-2.7
@@ -1383,34 +1452,36 @@ with python-requests.")
 (define-public python-oauthlib
   (package
     (name "python-oauthlib")
-    (version "1.0.3")
+    (version "3.0.1")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "oauthlib" version))
               (sha256
                (base32
-                "1bfrj70vdjxjw74khbyh6f0dksv7p5rh2346jnlrffyacd3gwjzg"))))
+                "163jg4a8f7c5ki655grrr47kgljy12wri3qly7ijf64sk1fjrqqc"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (invoke "pytest" "-vv"))))))
     (native-inputs
-     `(("python-nose" ,python-nose)
-       ("python-mock" ,python-mock)
-       ("python-cryptography" ,python-cryptography)
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-mock" ,python-mock)))
+    (propagated-inputs
+     `(("python-cryptography" ,python-cryptography)
        ("python-pyjwt" ,python-pyjwt)
        ("python-blinker" ,python-blinker)))
-    (home-page "https://github.com/idan/oauthlib")
+    (home-page "https://github.com/oauthlib/oauthlib")
     (synopsis "OAuth implementation for Python")
     (description
      "Oauthlib is a generic, spec-compliant, thorough implementation of the
 OAuth request-signing logic.")
-    (license license:bsd-3)
-    (properties `((python2-variant . ,(delay python2-oauthlib))))))
+    (license license:bsd-3)))
 
 (define-public python2-oauthlib
-  (let ((base (package-with-python2 (strip-python2-variant python-oauthlib))))
-    (package
-      (inherit base)
-      (native-inputs `(("python2-unittest2" ,python2-unittest2)
-                       ,@(package-native-inputs base))))))
+  (package-with-python2 python-oauthlib))
 
 (define-public python-rauth
   (package
@@ -1447,21 +1518,16 @@ authenticated session objects providing things like keep-alive.")
 (define-public python-urllib3
   (package
     (name "python-urllib3")
-    (version "1.24.1")
+    (version "1.25.3")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "urllib3" version))
         (sha256
          (base32
-          "08lwd9f3hqznyf32vnzwvp87pchx062nkbgyrf67rwlkgj0jk5fy"))))
+          "0cij8qcvvpj62g1q8n785qjkdymfh4b7vf45si4sw64l41rr3rfv"))))
     (build-system python-build-system)
     (arguments `(#:tests? #f))
-    (native-inputs
-     `(;; some packages for tests
-       ("python-mock" ,python-mock)
-       ("python-pytest" ,python-pytest)
-       ("python-tornado" ,python-tornado)))
     (propagated-inputs
      `(;; These 5 inputs are used to build urrlib3[secure]
        ("python-certifi" ,python-certifi)
@@ -1478,6 +1544,18 @@ can reuse the same socket connection for multiple requests, it can POST files,
 supports url redirection and retries, and also gzip and deflate decoding.")
     (license license:expat)))
 
+;; Some software requires an older version of urllib3, notably Docker.
+(define-public python-urllib3-1.24
+  (package (inherit python-urllib3)
+           (version "1.24.3")
+           (source (origin
+                     (method url-fetch)
+                     (uri (pypi-uri "urllib3" version))
+                     (sha256
+                      (base32
+                       "1x0slqrv6kixkbcdnxbglvjliwhc1payavxjvk8fvbqjrnasd4r3"))))))
+
+
 (define-public python2-urllib3
   (package-with-python2 python-urllib3))
 
@@ -1493,6 +1571,19 @@ supports url redirection and retries, and also gzip and deflate decoding.")
       (base32
        "0sispclx263lybbk19zp1n9yhg8xxx4jddypzgi24vpjaqnsbwlc"))))
    (build-system python-build-system)
+   (arguments
+    ;; FIXME: The 'pypi' release does not contain tests.
+    '(#:tests? #f
+      #:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'fix-reference-to-groff
+          (lambda _
+            (substitute* "awscli/help.py"
+              (("if not self._exists_on_path\\('groff'\\):") "")
+              (("raise ExecutableNotFoundError\\('groff'\\)") "")
+              (("cmdline = \\['groff'")
+               (string-append "cmdline = ['" (which "groff") "'")))
+            #t)))))
    (propagated-inputs
     `(("python-colorama" ,python-colorama)
       ("python-botocore" ,python-botocore)
@@ -1500,9 +1591,8 @@ supports url redirection and retries, and also gzip and deflate decoding.")
       ("python-docutils" ,python-docutils)
       ("python-pyyaml" ,python-pyyaml)
       ("python-rsa" ,python-rsa)))
-   (arguments
-    ;; FIXME: The 'pypi' release does not contain tests.
-    '(#:tests? #f))
+   (inputs
+    `(("groff" ,groff)))
    (home-page "https://aws.amazon.com/cli/")
    (synopsis "Command line client for AWS")
    (description "AWS CLI provides a unified command line interface to the
@@ -1599,13 +1689,13 @@ minimum of WSGI.")
 (define-public python-flask
   (package
     (name "python-flask")
-    (version "1.0.2")
+    (version "1.0.3")
     (source (origin
               (method url-fetch)
-              (uri (pypi-uri "flask" version))
+              (uri (pypi-uri "Flask" version))
               (sha256
                (base32
-                "0j6f4a9rpfh25k1gp7azqhnni4mb4fgy50jammgjgddw1l3w0w92"))))
+                "1wxnhjlxwwjhjxmghykjhllpahv5pkdc5hln4ab6nab43s26sz5d"))))
     (build-system python-build-system)
     (arguments
      '(#:phases
@@ -1718,13 +1808,13 @@ Python.")
 (define-public python-responses
   (package
     (name "python-responses")
-    (version "0.5.1")
+    (version "0.10.6")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "responses" version))
               (sha256
                (base32
-                "1spcfxixyk9k7pk82jm6zqkwk031s95lh8q0mz7539jrb7269bcc"))))
+                "147pacwkkqy3qf3hr33fnl1xbzgw0zsm3qppvvy9qhq8h069qbah"))))
     (build-system python-build-system)
     (arguments
      `(;; Test suite is not distributed:
@@ -1820,14 +1910,14 @@ concurrent HTTP client library for python using @code{gevent}.")
 (define-public python-requests-oauthlib
   (package
     (name "python-requests-oauthlib")
-    (version "0.6.2")
+    (version "1.2.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "requests-oauthlib" version))
        (sha256
         (base32
-         "0ykff67sjcl227c23g0rxzfx34rr5bf21kwv0z3zmgk0lfmch7hn"))))
+         "0mrglgcvq7k48pf27s4gifdk0za8xmgpf55jy15yjj471qrk6rdx"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -1838,7 +1928,8 @@ concurrent HTTP client library for python using @code{gevent}.")
              (delete-file "tests/test_core.py")
              #t)))))
     (native-inputs
-     `(("python-requests-mock" ,python-requests-mock)
+     `(("python-pyjwt" ,python-pyjwt)
+       ("python-requests-mock" ,python-requests-mock)
        ("python-mock" ,python-mock)))
     (propagated-inputs
      `(("python-oauthlib" ,python-oauthlib)
@@ -1891,15 +1982,15 @@ provide an easy-to-use Python interface for building OAuth1 and OAuth2 clients."
     (version "0.11.6")
     (source
      (origin
-       (method url-fetch)
+       (method git-fetch)
        ;; Pypi does not have tests.
-       (uri (string-append
-             "https://github.com/ionrock/cachecontrol/archive/v"
-             version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (uri (git-reference
+             (url "https://github.com/ionrock/cachecontrol")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "0yj60d0f69a2l8p7y86k4zhzzm6rnxpq74sfl240pry9l0lfw2vw"))))
+         "0pb16bzbkk99nh317xyfk8fxc2ngimsbz7lz9pxsw8c82n83d4dh"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -1983,21 +2074,21 @@ Betamax.")
 (define-public python-s3transfer
   (package
     (name "python-s3transfer")
-    (version "0.1.13")
+    (version "0.2.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "s3transfer" version))
               (sha256
                (base32
-                "1harvyn1s8v54n1w5h7c0lg4bgjh68aylhg28s8n174q53h1ip4h"))))
+                "08fhj73b1ai52hrs2q3nggshq3pswn1gq8ch3m009cb2v2vmqggj"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (replace 'check
            (lambda _
-             ;; 7 of the 'integration' tests require network access or login
-             ;; credentials.
+             ;; Some of the 'integration' tests require network access or
+             ;; login credentials.
              (invoke "nosetests" "--exclude=integration")
              #t)))))
     (native-inputs
@@ -2005,7 +2096,8 @@ Betamax.")
        ("python-mock" ,python-mock)
        ("python-nose" ,python-nose)))
     (propagated-inputs
-     `(("python-botocore" ,python-botocore)))
+     `(("python-botocore" ,python-botocore)
+       ("python-urllib3" ,python-urllib3)))
     (synopsis "Amazon S3 Transfer Manager")
     (description "S3transfer is a Python library for managing Amazon S3
 transfers.")
@@ -2099,6 +2191,30 @@ pretty printer and a tree visitor.")
       "This package provides HTTP basic access authentication for Flask.")
     (license license:bsd-3)))
 
+(define-public python-flask-htpasswd
+  (package
+    (name "python-flask-htpasswd")
+    (version "0.3.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "flask-htpasswd" version))
+        (sha256
+          (base32
+            "14q1y1y9i9bhabdnwd25jqzc4ljli23smxfyyh8abxz1vq93pxra"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-flask" ,python-flask)
+       ("python-itsdangerous" ,python-itsdangerous)
+       ("python-passlib" ,python-passlib)
+       ("python-tox" ,python-tox)))
+    (home-page "http://github.com/carsongee/flask-htpasswd")
+    (synopsis "Basic authentication via htpasswd files in Flask applications")
+    (description "This package provides Basic authentication via
+@file{htpasswd} files and access_token authentication in Flask
+applications.")
+    (license license:bsd-3)))
+
 (define-public python-flask-sqlalchemy
   (package
     (name "python-flask-sqlalchemy")
@@ -2437,6 +2553,14 @@ this it tries to be opinion-free and very extendable.")
         (base32
           "0r8w2v89nj6b9p91p495cga5m72a673l2wc0hp0zqk05j4yrc9b4"))))
   (build-system python-build-system)
+  (arguments
+   `(#:phases
+     (modify-phases %standard-phases
+       (add-after 'unpack 'patch-tests
+         (lambda _
+           (substitute* "tests.py"
+            (("flask\\.ext\\.script") "flask_script"))
+           #t)))))
   (propagated-inputs
    `(("python-flask" ,python-flask)
      ("python-argcomplete" ,python-argcomplete)
@@ -2960,14 +3084,14 @@ ecosystem.")
 (define-public python-hyperlink
   (package
     (name "python-hyperlink")
-    (version "18.0.0")
+    (version "19.0.0")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "hyperlink" version))
         (sha256
          (base32
-          "01m3y19arfqljksngy8grc966zdb4larysralb8cajzi8kvly6zh"))))
+          "0m2nhi0j8wmgfscf974wd5v1xfq8mah286hil6npy1ys0m3y7222"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-idna" ,python-idna)))
@@ -3094,3 +3218,33 @@ Python.")
     (propagated-inputs
      `(("python-gevent" ,python2-gevent)
        ("python-tornado" ,python2-tornado)))))
+
+(define-public python-slugify
+  (package
+    (name "python-slugify")
+    (version "3.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-slugify" version))
+       (sha256
+        (base32
+         "0n6pfmsq899c54plpvzi46l7zrpa3zfpm8im6h32czjw6kxky5jp"))
+       (patches
+        (search-patches "python-slugify-depend-on-unidecode.patch"))))
+    (native-inputs
+     `(("python-wheel" ,python-wheel)))
+    (propagated-inputs
+     `(("python-unidecode" ,python-unidecode)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "python" "test.py"))))))
+    (build-system python-build-system)
+    (home-page "https://github.com/un33k/python-slugify")
+    (synopsis "Python Slugify application that handles Unicode")
+    (description "This package provides a @command{slufigy} command and
+library to create slugs from unicode strings while keeping it DRY.")
+    (license license:expat)))