gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / python-web.scm
index 9626221..4f34502 100644 (file)
@@ -5,11 +5,11 @@
 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2013, 2014, 2015, 2016, 2020 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016, 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2016, 2017, 2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
-;;; Copyright © 2014, 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2017, 2021 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2015, 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
@@ -24,9 +24,9 @@
 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2017 Mark Meyer <mark@ofosos.org>
 ;;; Copyright © 2018 Tomáš Čech <sleep_walker@gnu.org>
-;;; Copyright © 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2018, 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2018, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2018, 2020, 2021 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>
@@ -40,6 +40,7 @@
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -75,6 +76,7 @@
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-compression)
   #:use-module (gnu packages python-crypto)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (srfi srfi-1))
 
+(define-public python-prawcore
+  (package
+    (name "python-prawcore")
+    (version "2.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "prawcore" version))
+       (sha256
+        (base32 "1l9nrn4s03xl8fvkyybdk86bm9cyyk43alkxf9g014a9ynvdk65l"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-betamax" ,python-betamax)
+       ("python-betamax-matchers" ,python-betamax-matchers)
+       ("python-betamax-serializers" ,python-betamax-serializers)
+       ("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)
+       ("python-testfixtures" ,python-testfixtures)))
+    (propagated-inputs
+     `(("python-requests" ,python-requests)))
+    (synopsis "Core component of PRAW")
+    (description "PRAWcore is a low-level communication layer used by PRAW.")
+    (home-page "https://praw.readthedocs.io/en/latest/")
+    (license license:bsd-2)))
+
+(define-public python-praw
+  (package
+    (name "python-praw")
+    (version "7.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "praw" version))
+       (sha256
+        (base32 "0ll1a0n8xs8gykizdsfrw63jp6bc39ab0pk3yzwcak96fyxh0ij3"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             (with-directory-excursion "tests"
+               ;; Require networking.
+               (for-each delete-file-recursively
+                         '("integration/models" "unit/models"))
+               ;; https://github.com/praw-dev/praw/issues/1699
+               ;; #issuecomment-795336704
+               (delete-file "unit/test_config.py"))
+             #t))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "pytest"))
+             #t)))))
+    (native-inputs
+     `(("python-betamax" ,python-betamax)
+       ("python-betamax-matchers" ,python-betamax-matchers)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-prawcore" ,python-prawcore)
+       ("python-websocket-client" ,python-websocket-client)))
+    (synopsis "Python Reddit API Wrapper")
+    (description "PRAW is a Python package that allows for simple access to
+Reddit’s API.  It aims to be easy to use and internally follows all of Reddit’s
+API rules.")
+    (home-page "https://praw.readthedocs.io/en/latest/")
+    (license license:bsd-2)))
+
 (define-public python-aiohttp
   (package
     (name "python-aiohttp")
-    (version "3.7.3")
+    (version "3.7.4")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "aiohttp" version))
        (sha256
-        (base32 "1i3p4yrfgrf1zpbgnywqmb33ps4k51wylcxykhf2cwky0spq26lw"))))
+        (base32 "1pn79h8fng4xi5gl1f6saw31nxgmgyxl41yf3vba1l21673yr12x"))))
     (build-system python-build-system)
     (arguments
      '(#:phases
@@ -167,17 +237,19 @@ Callback Hell.
 (define-public python-aiohttp-socks
   (package
     (name "python-aiohttp-socks")
-    (version "0.2.2")
+    (version "0.5.5")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "aiohttp_socks" version))
        (sha256
         (base32
-         "0473702jk66xrgpm28wbdgpnak4v0dh2qmdjw7ky7hf3lwwqkggf"))))
+         "0jmhb0l1w8k1nishij3awd9zv8zbyb5l35a2pdalrqxxasbhbcif"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-aiohttp" ,python-aiohttp)))
+     `(("python-aiohttp" ,python-aiohttp)
+       ("python-attrs" ,python-attrs)
+       ("python-socks" ,python-socks)))
     (home-page "https://github.com/romis2012/aiohttp-socks")
     (synopsis "SOCKS proxy connector for aiohttp")
     (description "This package provides a SOCKS proxy connector for
@@ -504,16 +576,8 @@ classes
 @item Compatible with both CPython and PyPy
 @item Cython support for better performance when used with CPython
 @end itemize")
-    (properties `((python2-variant . ,(delay python2-falcon))))
     (license license:asl2.0)))
 
-(define-public python2-falcon
-  (let ((falcon (package-with-python2 (strip-python2-variant python-falcon))))
-    (package
-      (inherit falcon)
-      (native-inputs
-       (alist-delete "python-rapidjson" (package-native-inputs falcon))))))
-
 (define-public python-falcon-cors
   (package
     (name "python-falcon-cors")
@@ -537,9 +601,6 @@ CORS object to the incoming requests, enabling the ability to serve resources
 over a different origin than that of the web application.")
     (license license:asl2.0)))
 
-(define-public python2-falcon-cors
-  (package-with-python2 python-falcon-cors))
-
 (define-public python-furl
   (package
     (name "python-furl")
@@ -563,9 +624,6 @@ over a different origin than that of the web application.")
 @code{urllib} and @code{urlparse} modules for manipulating URLs.")
     (license license:unlicense)))
 
-(define-public python2-furl
-  (package-with-python2 python-furl))
-
 (define-public python-httplib2
   (package
     (name "python-httplib2")
@@ -648,8 +706,7 @@ Swartz.")
 
 (define-public python2-html2text
   (let ((base (package-with-python2 python-html2text)))
-    (package
-      (inherit base)
+    (package/inherit base
       ;; This is the last version with support for Python 2.
       (version "2019.8.11")
       (source (origin
@@ -663,7 +720,7 @@ Swartz.")
   (package
     (name "python-jose")
     (version "3.2.0")
-    (home-page "http://github.com/mpdavis/python-jose")
+    (home-page "https://github.com/mpdavis/python-jose")
     (source (origin
               (method git-fetch)
               (uri (git-reference (url home-page) (commit version)))
@@ -739,29 +796,26 @@ object graph to and from JSON.")
 (define-public python-mechanicalsoup
   (package
     (name "python-mechanicalsoup")
-    (version "0.11.0")
+    (version "1.0.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "MechanicalSoup" version))
        (sha256
-        (base32 "0k59wwk75q7nz6i6gynvzhagy02ql0bv7py3qqcwgjw7607yq4i7"))))
+        (base32 "01sddjxy3rznh63hnl5lbv1hhk6xyiviwmkiw4x7v4ap35fb3lrp"))))
     (build-system python-build-system)
-    (arguments
-     ;; TODO: Enable tests when python-flake8@3.5 hits master.
-     `(#:tests? #f))
     (propagated-inputs
      `(("python-beautifulsoup4" ,python-beautifulsoup4)
        ("python-lxml" ,python-lxml)
        ("python-requests" ,python-requests)
        ("python-six" ,python-six)))
-    ;; (native-inputs
-    ;;  ;; For tests.
-    ;;  `(("python-pytest-flake8" ,python-pytest-flake8)
-    ;;    ("python-pytest-httpbin" ,python-pytest-httpbin)
-    ;;    ("python-pytest-mock" ,python-pytest-mock)
-    ;;    ("python-pytest-runner" ,python-pytest-runner)
-    ;;    ("python-requests-mock" ,python-requests-mock)))
+    (native-inputs
+     `(("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-flake8" ,python-pytest-flake8)
+       ("python-pytest-httpbin" ,python-pytest-httpbin)
+       ("python-pytest-mock" ,python-pytest-mock)
+       ("python-pytest-runner" ,python-pytest-runner)
+       ("python-requests-mock" ,python-requests-mock)))
     (home-page "https://mechanicalsoup.readthedocs.io/")
     (synopsis "Python library for automating website interaction")
     (description
@@ -958,9 +1012,6 @@ support for Flask.  This is based on the Python babel module as well as pytz -
 both of which are installed automatically if you install this library.")
     (license license:bsd-3)))
 
-(define-public python2-flask-babel
-  (package-with-python2 python-flask-babel))
-
 (define-public python-flask-cors
   (package
     (name "python-flask-cors")
@@ -1049,7 +1100,9 @@ storage.")
     (build-system python-build-system)
     (propagated-inputs
      `(("python-six" ,python-six)
-       ("python-webencodings" ,python-webencodings)))
+       ("python-webencodings" ,python-webencodings)
+       ;; Required by Calibre 5.
+       ("python-chardet" ,python-chardet)))
     (arguments
      `(#:test-target "check"))
     (home-page
@@ -1635,14 +1688,14 @@ connection to each user.")
 (define-public python-tornado-6
   (package
     (name "python-tornado")
-    (version "6.0.4")
+    (version "6.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "tornado" version))
        (sha256
         (base32
-         "1p5n7sw4580pkybywg93p8ddqdj9lhhy72rzswfa801vlidx9qhg"))))
+         "14cpzdv6p6qvk6vn02krdh5rcfdi174ifdbr5s6lcnymgcfyiiik"))))
     (build-system python-build-system)
     (arguments
      '(#:phases
@@ -1665,7 +1718,7 @@ connection to each user.")
 
 (define-public python2-tornado
   (let ((tornado (package-with-python2 (strip-python2-variant python-tornado))))
-    (package (inherit tornado)
+    (package/inherit tornado
       (propagated-inputs
        `(("python2-backport-ssl-match-hostname"
           ,python2-backport-ssl-match-hostname)
@@ -1696,26 +1749,26 @@ web framework, either via the basic or digest authentication schemes.")
 (define-public python-terminado
   (package
     (name "python-terminado")
-    (version "0.8.1")
+    (version "0.9.4")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "terminado" version))
        (sha256
         (base32
-         "0yh69k6579g848rmjyllb5h75pkvgcy27r1l3yzgkf33wnnzkasm"))))
+         "1glqyw97rddyzvisz8rihsn3x2nrm5xbyq82nzp3123pqbxvqzcs"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-tornado" ,python-tornado)
+     `(("python-tornado" ,python-tornado-6)
        ("python-ptyprocess" ,python-ptyprocess)))
     (native-inputs
-     `(("python-nose" ,python-nose)))
+     `(("python-pytest" ,python-pytest)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (replace 'check
-           (lambda _ (invoke "nosetests") #t)))))
-    (home-page "https://github.com/takluyver/terminado")
+           (lambda _ (invoke "pytest" "-vv"))))))
+    (home-page "https://github.com/jupyter/terminado")
     (synopsis "Terminals served to term.js using Tornado websockets")
     (description "This package provides a Tornado websocket backend for the
 term.js Javascript terminal emulator library.")
@@ -1724,7 +1777,7 @@ term.js Javascript terminal emulator library.")
 
 (define-public python2-terminado
   (let ((terminado (package-with-python2 (strip-python2-variant python-terminado))))
-    (package (inherit terminado)
+    (package/inherit terminado
       (propagated-inputs
        `(("python2-backport-ssl-match-hostname"
           ,python2-backport-ssl-match-hostname)
@@ -2311,7 +2364,7 @@ verification of the SSL peer.")
 ;; python2-openssl requires special care, so package-with-python2 is
 ;; insufficient.
 (define-public python2-ndg-httpsclient
-  (package (inherit python-ndg-httpsclient)
+  (package/inherit python-ndg-httpsclient
     (name "python2-ndg-httpsclient")
     (arguments
      (substitute-keyword-arguments (package-arguments python-ndg-httpsclient)
@@ -2343,8 +2396,7 @@ WebSocket usage in Python programs.")
 (define-public python2-websocket-client
   (let ((base (package-with-python2
                 (strip-python2-variant python-websocket-client))))
-    (package
-      (inherit base)
+    (package/inherit base
       (native-inputs
        `(("python2-backport-ssl-match-hostname"
           ,python2-backport-ssl-match-hostname)
@@ -2429,13 +2481,13 @@ APIs.")
 (define-public python-requests
   (package
     (name "python-requests")
-    (version "2.24.0")
+    (version "2.25.0")
     (source (origin
              (method url-fetch)
              (uri (pypi-uri "requests" version))
              (sha256
               (base32
-               "06r3017hz0hzxv42gpg73l8xvdjbzw7q904ljvp36b5p3l9rlmdk"))))
+               "1y6mb8c0ipd64d5axq2p368yxndp3f966hmabjka2q2a5y9hn6kz"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-certifi" ,python-certifi)
@@ -2471,6 +2523,53 @@ than Python’s urllib2 library.")
 (define-public python2-requests
   (package-with-python2 python-requests))
 
+(define-public python-requests-unixsocket
+  (package
+    (name "python-requests-unixsocket")
+    (version "0.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "requests-unixsocket" version))
+       (sha256
+        (base32
+         "1sn12y4fw1qki5gxy9wg45gmdrxhrndwfndfjxhpiky3mwh1lp4y"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'relax-requirements
+           (lambda _
+             (substitute* "test-requirements.txt"
+               (("(.*)==(.*)" _ name) (string-append name "\n")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv"))))))
+    (propagated-inputs
+     `(("python-pbr" ,python-pbr)
+       ("python-requests" ,python-requests)
+       ("python-urllib3" ,python-urllib3)))
+    (native-inputs
+     `(("python-apipkg" ,python-apipkg)
+       ("python-appdirs" ,python-appdirs)
+       ("python-execnet" ,python-execnet)
+       ("python-packaging" ,python-packaging)
+       ("python-pep8" ,python-pep8)
+       ("python-py" ,python-py)
+       ("python-pyparsing" ,python-pyparsing)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cache" ,python-pytest-cache)
+       ("python-pytest-pep8" ,python-pytest-pep8)
+       ("python-six" ,python-six)
+       ("python-waitress" ,python-waitress)))
+    (home-page "https://github.com/msabramo/requests-unixsocket")
+    (synopsis "Talk HTTP via a UNIX domain socket")
+    (description
+     "This Python package lets you use the @code{requests} library to talk
+HTTP via a UNIX domain socket.")
+    (license license:asl2.0)))
+
 (define-public python-requests_ntlm
   (package
     (name "python-requests_ntlm")
@@ -2525,17 +2624,8 @@ library.")
     (description
       "This module provides a building block to stub out the HTTP requests
 portions of your testing code.")
-    (properties `((python2-variant . ,(delay python2-requests-mock))))
     (license license:asl2.0)))
 
-(define-public python2-requests-mock
-  (package (inherit (package-with-python2
-                     (strip-python2-variant python-requests-mock)))
-           (arguments
-            `(#:python ,python-2
-              ;; FIXME: 'subunit.run discover: error: no such option: --list'
-              #:tests? #f))))
-
 (define-public python-requests-toolbelt
   (package
     (name "python-requests-toolbelt")
@@ -2659,22 +2749,22 @@ authenticated session objects providing things like keep-alive.")
 
 (define-public python2-rauth
   (let ((base (package-with-python2 (strip-python2-variant python-rauth))))
-    (package
-      (inherit base)
+    (package/inherit base
       (native-inputs `(("python2-unittest2" ,python2-unittest2)
                        ,@(package-native-inputs base))))))
 
 (define-public python-urllib3
   (package
     (name "python-urllib3")
-    (version "1.25.9")
+    (version "1.26.2")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "urllib3" version))
         (sha256
          (base32
-          "09rmjqm5syhhc8fx3v06h3yv6cqy0b1081jg8wm5grpwpr72j61h"))))
+          "024yldjwjavps39yb77sc422z8fa9bn20wcqrcncjwrqjab8y60r"))))
+    (replacement python-urllib3/fixed)
     (build-system python-build-system)
     (arguments `(#:tests? #f))
     (propagated-inputs
@@ -2693,6 +2783,17 @@ supports url redirection and retries, and also gzip and deflate decoding.")
     (properties `((python2-variant . ,(delay python2-urllib3))))
     (license license:expat)))
 
+(define python-urllib3/fixed
+  (package/inherit python-urllib3
+    (version "1.26.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "urllib3" version))
+       (sha256
+        (base32
+         "0dw9w9bs3hmr5dp3r3h43jyzzb1g1046ag7lj8pqf58i4kvj3c77"))))))
+
 ;; Some software requires an older version of urllib3, notably Docker.
 (define-public python-urllib3-1.24
   (package (inherit python-urllib3)
@@ -2717,14 +2818,14 @@ supports url redirection and retries, and also gzip and deflate decoding.")
   (package
     ;; Note: updating awscli typically requires updating botocore as well.
     (name "awscli")
-    (version "1.18.183")
+    (version "1.18.203")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri name version))
        (sha256
         (base32
-         "0n1pmdl33r1v8qnrcg08ihvri9zm4fvsp14605vwmlkxvs8nb7s5"))))
+         "128zg24961j8nmnq2dxqg6a7zwh3qgv87cmvclsdqwwih9nigxv9"))))
     (build-system python-build-system)
     (arguments
      ;; FIXME: The 'pypi' release does not contain tests.
@@ -2815,14 +2916,13 @@ file.")
 (define-public python-webtest
   (package
     (name "python-webtest")
-    (version "2.0.33")
+    (version "2.0.35")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "WebTest" version))
        (sha256
-        (base32
-         "1l3z0cwqslsf4rcrhi2gr8kdfh74wn2dw76376i4g9i38gz8wd21"))))
+        (base32 "11xhgdj251zkvz5w30fvspii08ki2vrpr1im9sph1wmlnasnihda"))))
     (build-system python-build-system)
     (arguments
      ;; Tests require python-pyquery, which creates a circular dependency.
@@ -2875,9 +2975,6 @@ and Jinja2 template engine.  It is called a micro framework because it does not
 presume or force a developer to use a particular tool or library.")
     (license license:bsd-3)))
 
-(define-public python2-flask
-  (package-with-python2 python-flask))
-
 (define-public python-flask-wtf
   (package
     (name "python-flask-wtf")
@@ -2910,9 +3007,6 @@ presume or force a developer to use a particular tool or library.")
 upload, and reCAPTCHA.")
     (license license:bsd-3)))
 
-(define-public python2-flask-wtf
-  (package-with-python2 python-flask-wtf))
-
 (define-public python-flask-multistatic
   (package
     (name "python-flask-multistatic")
@@ -2933,9 +3027,6 @@ upload, and reCAPTCHA.")
 for overriding static files.")
     (license license:gpl3+)))
 
-(define-public python2-flask-multistatic
-  (package-with-python2 python-flask-multistatic))
-
 (define-public python-cookies
   (package
     (name "python-cookies")
@@ -3037,28 +3128,32 @@ for the basic TCP/IP protocols.")
 (define-public python-geventhttpclient
   (package
     (name "python-geventhttpclient")
-    (version "1.3.1")
+    (version "1.4.4")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "geventhttpclient" version))
               (sha256
                (base32
-                "07d0q3wzmml75227r6y6mrl5a0zpf4v9gj0ni5rhbyzmaj4az1xx"))
+                "1hy4qm9d3r69n5199i7qjji1v7718n7cxbj8ggi0njify99m37pm"))
               (modules '((guix build utils)))
               (snippet
                '(begin
                   ;; Delete pre-compiled files.
                   (for-each delete-file (find-files "src/geventhttpclient"
-                                                    ".*\\.pyc"))
-                  #t))))
+                                                    ".*\\.pyc"))))))
     (build-system python-build-system)
     (arguments
      '(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'delete-network-tests
            (lambda _
-             (delete-file "src/geventhttpclient/tests/test_client.py")
-             #t))
+             (delete-file "src/geventhttpclient/tests/test_client.py")))
+         (add-after 'unpack 'fix-compatibility-issue
+           ;; See: https://github.com/gwik/geventhttpclient/issues/137.
+           (lambda _
+             (substitute* "src/geventhttpclient/tests/test_ssl.py"
+               ((".*sock.last_seen_sni = None.*")
+                ""))))
          (replace 'check
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (add-installed-pythonpath inputs outputs)
@@ -3066,12 +3161,12 @@ for the basic TCP/IP protocols.")
                      ;; Append the test modules to sys.path to avoid
                      ;; namespace conflict which breaks SSL tests.
                      "--import-mode=append"
-                     ;; XXX: Disable test fails with Python 3.8:
+                     ;; XXX: This test fails with Python 3.8:
                      ;; https://github.com/gwik/geventhttpclient/issues/119
-                     "-k" (string-append "not test_cookielib_compatibility"))
-             #t)))))
+                     "-k" "not test_cookielib_compatibility"))))))
     (native-inputs
-     `(("python-pytest" ,python-pytest)))
+     `(("python-dpkt" ,python-dpkt)
+       ("python-pytest" ,python-pytest)))
     (propagated-inputs
      `(("python-certifi" ,python-certifi)
        ("python-gevent" ,python-gevent)
@@ -3082,9 +3177,6 @@ for the basic TCP/IP protocols.")
 concurrent HTTP client library for python using @code{gevent}.")
     (license license:expat)))
 
-(define-public python2-geventhttpclient
-  (package-with-python2 python-geventhttpclient))
-
 (define-public python-requests-oauthlib
   (package
     (name "python-requests-oauthlib")
@@ -3121,9 +3213,6 @@ concurrent HTTP client library for python using @code{gevent}.")
 provide an easy-to-use Python interface for building OAuth1 and OAuth2 clients.")
     (license license:isc)))
 
-(define-public python2-requests-oauthlib
-  (package-with-python2 python-requests-oauthlib))
-
 (define-public python-url
   (package
     (name "python-url")
@@ -3150,7 +3239,7 @@ provide an easy-to-use Python interface for building OAuth1 and OAuth2 clients."
 
 (define-public python2-url
   (let ((base (package-with-python2 (strip-python2-variant python-url))))
-    (package (inherit base)
+    (package/inherit base
       (propagated-inputs
        `(("python2-publicsuffix" ,python2-publicsuffix))))))
 
@@ -3184,9 +3273,6 @@ provide an easy-to-use Python interface for building OAuth1 and OAuth2 clients."
 @code{httplib2} for use with @code{requests} session objects.")
     (license license:asl2.0)))
 
-(define-public python2-cachecontrol
-  (package-with-python2 python-cachecontrol))
-
 (define-public python-cachecontrol-0.11
   (package
     (inherit python-cachecontrol)
@@ -3250,6 +3336,26 @@ Betamax.")
 (define-public python2-betamax-matchers
   (package-with-python2 python-betamax-matchers))
 
+(define-public python-betamax-serializers
+  (package
+    (name "python-betamax-serializers")
+    (version "0.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "betamax-serializers" version))
+       (sha256
+        (base32 "0ja9isbjmzzhxdj69s0kdsvw8nkp073w6an6a4liy5vk3fdl2p1l"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-betamax" ,python-betamax)
+       ("python-pyyaml" ,python-pyyaml)))
+    (synopsis "Set of third-party serializers for Betamax")
+    (description "Betamax-Serializers are an experimental set of Serializers for
+Betamax that may possibly end up in the main package.")
+    (home-page "https://gitlab.com/betamax/serializers")
+    (license license:asl2.0)))
+
 (define-public python-s3transfer
   (package
     (name "python-s3transfer")
@@ -3295,8 +3401,7 @@ transfers.")
 
 (define-public python2-s3transfer
   (let ((base (package-with-python2 (strip-python2-variant python-s3transfer))))
-    (package
-      (inherit base)
+    (package/inherit base
       (native-inputs
        `(("python2-futures" ,python2-futures)
          ,@(package-native-inputs base))))))
@@ -3492,9 +3597,6 @@ documentation builder.")
 specs from your Flask-Restful projects.")
     (license license:expat)))
 
-(define-public python2-flask-restful-swagger
-  (package-with-python2 python-flask-restful-swagger))
-
 (define-public python-htmlmin
   (package
     (name "python-htmlmin")
@@ -3539,9 +3641,6 @@ It comes with safe defaults and easily configurable options.")
      "Minify @code{text/html} MIME type responses when using @code{Flask}.")
     (license license:bsd-3)))
 
-(define-public python2-flask-htmlmin
-  (package-with-python2 python-flask-htmlmin))
-
 (define-public python-jsmin
   (package
     (name "python-jsmin")
@@ -3595,9 +3694,6 @@ handles the common tasks of logging in, logging out, and remembering your
 users' sessions over extended periods of time.")
     (license license:expat)))
 
-(define-public python2-flask-login
-  (package-with-python2 python-flask-login))
-
 (define-public python-oauth2client
   (package
     (name "python-oauth2client")
@@ -3743,6 +3839,29 @@ this it tries to be opinion-free and very extendable.")
 (define-public python2-elasticsearch
   (package-with-python2 python-elasticsearch))
 
+(define-public python-engineio
+  (package
+    (name "python-engineio")
+    (version "4.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-engineio" version))
+       (sha256
+        (base32
+         "0xqkjjxbxakz9fd7v94rkr2r5r9nrkap2c3gf3abbd0j6ld5qmxv"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-aiohttp" ,python-aiohttp)
+       ("python-requests" ,python-requests)
+       ("python-websocket-client" ,python-websocket-client)))
+    (arguments '(#:tests? #f))        ; Tests not included in release tarball.
+    (home-page "https://github.com/miguelgrinberg/python-engineio/")
+    (synopsis "Engine.IO server")
+    (description "Python implementation of the Engine.IO realtime client and
+server.")
+    (license license:expat)))
+
 (define-public python-flask-script
   (package
   (name "python-flask-script")
@@ -3779,9 +3898,6 @@ and other command-line tasks that belong outside the web application
 itself.")
   (license license:bsd-3)))
 
-(define-public python2-flask-script
-  (package-with-python2 python-flask-script))
-
 (define-public python-flask-migrate
   (package
   (name "python-flask-migrate")
@@ -3855,9 +3971,6 @@ Flask.  It supports managing both authentication and authorization data in a
 thread-local variable.")
     (license license:expat)))
 
-(define-public python2-flask-principal
-  (package-with-python2 python-flask-principal))
-
 (define-public python-flask-httpauth
   (package
     (name "python-flask-httpauth")
@@ -3878,9 +3991,6 @@ thread-local variable.")
 authentication for Flask routes.")
     (license license:expat)))
 
-(define-public python2-flask-httpauth
-  (package-with-python2 python-flask-httpauth))
-
 (define-public python-uritemplate
   (package
     (name "python-uritemplate")
@@ -3959,14 +4069,14 @@ List.  Forked from and using the same API as the publicsuffix package.")
 (define-public python-werkzeug
   (package
     (name "python-werkzeug")
-    (version "1.0.0")
+    (version "1.0.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Werkzeug" version))
        (sha256
         (base32
-         "15kh0z61klp62mrc1prka13xsshxn0rsp1j1s2964iw86yisi6qn"))))
+         "0z74sa1xw5h20yin9faj0vvdbq713cgbj84klc72jr9nmpjv303c"))))
     (build-system python-build-system)
     (arguments
      '(#:phases
@@ -3981,7 +4091,7 @@ List.  Forked from and using the same API as the publicsuffix package.")
     (native-inputs
      `(("python-pytest" ,python-pytest)
        ("python-pytest-timeout" ,python-pytest-timeout)))
-    (home-page "https://www.palletsprojects.org/p/werkzeug/")
+    (home-page "https://palletsprojects.com/p/werkzeug/")
     (synopsis "Utilities for WSGI applications")
     (description "One of the most advanced WSGI utility modules.  It includes a
 powerful debugger, full-featured request and response objects, HTTP utilities to
@@ -3990,9 +4100,6 @@ uploads, a powerful URL routing system and a bunch of community-contributed
 addon modules.")
     (license license:x11)))
 
-(define-public python2-werkzeug
-  (package-with-python2 python-werkzeug))
-
 (define-public python-bottle
   (package
     (name "python-bottle")
@@ -4455,18 +4562,47 @@ library to create slugs from unicode strings while keeping it DRY.")
     (version "1.1.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "tinycss2" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Kozea/tinycss2")
+             (commit (string-append "v" version))
+             (recursive? #true)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "12p16k8x8ig51gpfcwz3k3kxpxrwwkn41a1avdgvh3nn8hqarp7v"))))
+        (base32 "0zyc48vbmczpqj7f3f0d7zb3bz29fyj50dg0m6bbwbr5i88kq3sq"))))
     (build-system python-build-system)
     (arguments
-     ;; Test data is missing from the PyPI archive, and the build system is
-     ;; based on Flit, which wants an unmaintained and unpackaged
-     ;; python-pytoml dependency.
-     `(#:tests? #f))
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'build
+           (lambda _
+             ;; A ZIP archive should be generated, but it fails with "ZIP does
+             ;; not support timestamps before 1980".  Luckily,
+             ;; SOURCE_DATE_EPOCH is respected, which we set to some time in
+             ;; 1980.
+             (setenv "SOURCE_DATE_EPOCH" "315532800")
+             (invoke "flit" "build")))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each (lambda (wheel)
+                           (format #true wheel)
+                           (invoke "python" "-m" "pip" "install"
+                                   wheel (string-append "--prefix=" out)))
+                         (find-files "dist" "\\.whl$")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv"))))))
     (propagated-inputs
      `(("python-webencodings" ,python-webencodings)))
+    (native-inputs
+     `(("python-flit" ,python-flit)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-flake8" ,python-pytest-flake8)
+       ("python-pytest-isort" ,python-pytest-isort)))
     (home-page "https://tinycss2.readthedocs.io/")
     (synopsis "Low-level CSS parser for Python")
     (description "@code{tinycss2} can parse strings, return Python objects
@@ -5415,6 +5551,27 @@ decorators and tools to describe your API and expose its documentation properly
 Swagger.")
     (license license:bsd-3)))
 
+(define-public python-flask-socketio
+  (package
+    (name "python-flask-socketio")
+    (version "5.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "Flask-SocketIO" version))
+       (sha256
+        (base32
+         "09r2gpj2nbn72v2zaf6xsvlazln77pgqzp2pg2021nja47sijhsw"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-flask" ,python-flask)
+       ("python-socketio" ,python-socketio)))
+    (arguments '(#:tests? #f))        ; Tests not included in release tarball.
+    (home-page "https://github.com/miguelgrinberg/Flask-SocketIO/")
+    (synopsis "Socket.IO integration for Flask applications")
+    (description "Socket.IO integration for Flask applications")
+    (license license:expat)))
+
 (define-public python-manuel
   (package
     (name "python-manuel")
@@ -5612,15 +5769,25 @@ Encoding for HTTP.")
                      '("captcha/2captcha.py"
                        "captcha/9kw.py"
                        "captcha/anticaptcha.py"
-                       "captcha/deathbycaptcha.py"
-                       "interpreters/js2py.py"
-                       "interpreters/v8.py"))
+                       "captcha/deathbycaptcha.py"))
            (substitute* "__init__.py"
              ;; Perhaps it's a joke, but don't promote proprietary software.
              (("([Th]is feature is not available) in the .*'" _ prefix)
               (string-append prefix ".'")))
            #t))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; XXX: Dependencies, that have not yet been packaged
+         ;;      and cause an import error when included.
+         (add-after 'unpack 'drop-unsupported-sources
+           (lambda _
+             (with-directory-excursion "cloudscraper"
+               (for-each delete-file
+                         '("interpreters/js2py.py"
+                           "interpreters/v8.py")))
+             #t)))))
     (propagated-inputs
      `(("python-requests" ,python-requests)
        ("python-requests-toolbelt" ,python-requests-toolbelt-0.9.1)
@@ -5685,14 +5852,14 @@ as a Python package.")
 (define-public python-sanic
   (package
     (name "python-sanic")
-    (version "20.9.1")
+    (version "20.12.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "sanic" version))
        (sha256
         (base32
-         "06p0lsxqbfbka2yaqlpp0bg5pf7ma44zi6kq7qbb6hhry48dp1w6"))))
+         "1c02gdp1j18xny9jd33fp0w57qqi7g66zwmaykv2dhcks96f5mxr"))))
     (build-system python-build-system)
     (arguments
      '(#:phases
@@ -5701,9 +5868,8 @@ as a Python package.")
            ;; Allow using recent dependencies.
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "setup.py"
-               (("httpcore==0.3.0") "httpcore")
                (("pytest==5.2.1") "pytest")
-               (("multidict==5.0.0") "multidict")
+               (("multidict>=5.0,<6.0") "multidict")
                (("httpx==0\\.15\\.4") "httpx"))
              #t))
          (replace 'check
@@ -5729,15 +5895,77 @@ as a Python package.")
        ("python-pytest-benchmark" ,python-pytest-benchmark)
        ("python-pytest-sanic" ,python-pytest-sanic)
        ("python-pytest-sugar" ,python-pytest-sugar)
+       ("python-pytest-asyncio" ,python-pytest-asyncio)
        ("python-urllib3" ,python-urllib3)
        ("python-uvicorn" ,python-uvicorn)))
     (home-page
-     "https://github.com/huge-success/sanic/")
+     "https://github.com/sanic-org/sanic/")
     (synopsis
-     "Async Python 3.6+ web server/framework")
+     "Async Python web server/framework")
     (description
-     "Sanic is a Python 3.6+ web server and web framework
+     "Sanic is a Python web server and web framework
 that's written to go fast.  It allows the usage of the
 @code{async/await} syntax added in Python 3.5, which makes
 your code non-blocking and speedy.")
     (license license:expat)))
+
+(define-public python-socketio
+  (package
+    (name "python-socketio")
+    (version "5.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-socketio" version))
+       (sha256
+        (base32
+         "14vhpxdn54lz54mhcqlgcks0ssbws9gd1y7ii16a2g3gpfdc531k"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-aiohttp" ,python-aiohttp)
+       ("python-bidict" ,python-bidict)
+       ("python-engineio" ,python-engineio)
+       ("python-requests" ,python-requests)
+       ("python-websocket-client" ,python-websocket-client)
+       ("python-websockets" ,python-websockets)))
+    (arguments '(#:tests? #f))        ; Tests not included in release tarball.
+    (home-page "https://github.com/miguelgrinberg/python-socketio/")
+    (synopsis "Python Socket.IO server")
+    (description
+     "Python implementation of the Socket.IO realtime client and server.")
+    (license license:expat)))
+
+(define-public python-socks
+  (package
+    (name "python-socks")
+    (version "1.1.2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "python-socks" version))
+        (sha256
+         (base32
+          "06mgv3icsyglv50w3sb71x6cpbskza20pqd93l5xk59x574i6xgs"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f  ; tests not included
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "pytest" "tests/" "-s"))
+             #t)))))
+    (propagated-inputs
+     `(("python-async-timeout" ,python-async-timeout)
+       ("python-curio" ,python-curio)
+       ("python-trio" ,python-trio)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/romis2012/python-socks")
+    (synopsis
+     "Core proxy (SOCKS4, SOCKS5, HTTP tunneling) functionality for Python")
+    (description
+     "Socks is a library providing core proxy (SOCKS4, SOCKS5, HTTP tunneling)
+ functionality.")
+    (license license:asl2.0)))