Subject: Re: [bug#55104] [PATCH 000/232] Update IPython to latest, fix texlive-polyglossia, add more

From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 13:50:41 +0200

Hi Maxim,

> OK, thanks!
see patches attached.

Cheers,
Lars

>From 7f4cef6d4446284af90965515bd5a89fa2829c25 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 09:44:34 +0200
Subject: [PATCH 1/6] gnu: python-pytest-sanic: Update to 1.9.1.

* gnu/packages/python-check.scm (python-pytest-sanic): Update to 1.9.1.
---
 gnu/packages/python-check.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 5fec85b1ba..ef70d9c3d8 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -1984,13 +1984,13 @@ (define-public python-stestr
 (define-public python-pytest-sanic
   (package
     (name "python-pytest-sanic")
-    (version "1.7.0")
+    (version "1.9.1")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "pytest-sanic" version))
               (sha256
                 (base32
-                  "0hm7im77dgqfk8k34qbbfhimg8hifl4zwpa2s3mgbknrjvyw5qpx"))))
+                  "0shq1bqnydj0l3ipb73j1qh5kqcjvzkps30zk8grq3dwmh3wmnkr"))))
     (build-system python-build-system)
     (arguments
      ;; Tests depend on python-sanic.
-- 
2.35.1

>From eefa6b2658122bf320de610b911fcbdfa6bf835d Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 09:51:09 +0200
Subject: [PATCH 6/6] gnu: python-sanic: Update to 21.12.1.

* gnu/packages/python-web.scm (python-sanic): Update to 21.12.1.
[arguments]<#:phases>: Remove 'use-recent-pytest, update skipped tests in
'check.
[propagated-inputs]: Remove python-httpx, replace python-multidict with
python-multidict-5, add python-sanic-routing.
[native-inputs]: Add python-bandit, python-chardet, python-isort and
python-sanic-testing. Remove python-hstspreload, python-httpcore,
python-pytest-cov and python-urllib3.
---
 gnu/packages/python-web.scm | 53 ++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index b2769306be..0d6118ed0d 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -86,6 +86,7 @@ (define-module (gnu packages python-web)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages node)
+  #:use-module (gnu packages openstack)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -6386,53 +6387,55 @@ (define-public python-sanic-testing
 (define-public python-sanic
   (package
     (name "python-sanic")
-    (version "20.12.4")
+    ;; We provide the latest LTS version of python-sanic.
+    (version "21.12.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "sanic" version))
        (sha256
         (base32
-         "0axfc151s7nrykzypzciyvkxxrs5ayx8kxv4r620hjb9w3jjhfnp"))))
+         "0b8mcd1q9qkwcv2qz8nlyaacs0bp7a1l31sdq2m8hhkxykzfq5bg"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'use-recent-pytest
-           ;; Allow using recent dependencies.
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "setup.py"
-               (("pytest==5.2.1") "pytest")
-               (("multidict>=5.0,<6.0") "multidict")
-               (("httpx==0\\.15\\.4") "httpx"))
-             #t))
-         (replace 'check
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (add-installed-pythonpath inputs outputs)
-             (invoke "pytest" "-vv" "./tests" "-k"
-                     (string-append "not test_zero_downtime "
-                                    "and not test_gunicorn_worker "
-                                    "and not test_logo_")))))))
+      (list
+       #:phases
+         #~(modify-phases %standard-phases
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (invoke "pytest" "-vv" "./tests" "-k"
+                         (string-append
+                           ;; PyPi sources lack examples module.
+                           "not test_gunicorn_"
+                           ;; Does not expect brotli and reordered headers.
+                           " and not test_raw_headers"
+                           ;; These look like buggy testcases.
+                           " and not test_zero_downtime"
+                           " and not test_non_default_uvloop_config_raises_warning"
+                           " and not test_listeners_triggered"
+                           " and not test_keep_alive_connection_context"
+                           " and not test_keep_alive_client_timeout"))))))))
     (propagated-inputs
      (list python-aiofiles
            python-httptools
-           python-httpx
-           python-multidict
+           python-multidict-5
+           python-sanic-routing
            python-ujson
            python-uvloop
            python-websockets))
     (native-inputs
      (list gunicorn
+           python-bandit
            python-beautifulsoup4
-           python-hstspreload
-           python-httpcore
+           python-chardet
+           python-isort
            python-pytest
-           python-pytest-cov
            python-pytest-benchmark
            python-pytest-sanic
            python-pytest-sugar
            python-pytest-asyncio
-           python-urllib3
+           python-sanic-testing
            python-uvicorn))
     (home-page
      "https://github.com/sanic-org/sanic/")
-- 
2.35.1

>From b8373146955fca9fb6925af10bd2541f5745f795 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 09:50:22 +0200
Subject: [PATCH 5/6] gnu: Add python-sanic-testing.

* gnu/packages/python-web.scm (python-sanic-testing): New variable.
---
 gnu/packages/python-web.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 83be0176f4..b2769306be 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6361,6 +6361,28 @@ (define-public python-sanic-routing
 the @code{BasicRouter}.")
     (license license:expat)))
 
+(define-public python-sanic-testing
+  (package
+    (name "python-sanic-testing")
+    (version "22.3.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "sanic-testing" version))
+        (sha256
+          (base32 "1vkgi9d3xyik507j4jy9s74mkl81hgx3c2d5y3aa1av9h6wjjivp"))))
+    (build-system python-build-system)
+    (arguments
+      ;; PyPi sources does not contain tests, recursive dependency on python-sanic.
+      (list #:tests? #f))
+    (propagated-inputs (list python-httpx python-sanic-bootstrap python-websockets))
+    (home-page "https://github.com/sanic-org/sanic-testing/")
+    (synopsis "Test clients for Sanic")
+    (description "Internal package for @code{python-sanic}, which is
+meant to be the core testing utility and clients for testing Sanic
+applications.")
+    (license license:expat)))
+
 (define-public python-sanic
   (package
     (name "python-sanic")
-- 
2.35.1

>From 47997c9f641e8ab85a39167e91810243106dab30 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 09:48:24 +0200
Subject: [PATCH 3/6] gnu: Add python-sanic-routing.

* gnu/packages/python-web.scm (python-sanic-routing): New variable.
---
 gnu/packages/python-web.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index bf31b9dc74..6ffec0d91b 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6341,6 +6341,26 @@ (define-public python-hstspreload
 as a Python package.")
     (license license:bsd-3)))
 
+(define-public python-sanic-routing
+  (package
+    (name "python-sanic-routing")
+    (version "0.7.2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "sanic-routing" version))
+        (sha256
+          (base32 "0k9paln0jd4sc2bklp977c82n29pk12wiv726siplkh57y5yi70k"))))
+    (build-system python-build-system)
+    (arguments
+      ;; PyPi sources does not contain tests, recursive dependency on python-sanic.
+      (list #:tests? #f))
+    (home-page "https://github.com/sanic-org/sanic-routing/")
+    (synopsis "Routing component for Sanic")
+    (description "Internal package for @code{python-sanic}, which provides
+the @code{BasicRouter}.")
+    (license license:expat)))
+
 (define-public python-sanic
   (package
     (name "python-sanic")
-- 
2.35.1

>From 0d8a6d6405217af07a7ca28e8a7c8aea1e3d08dc Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 09:45:48 +0200
Subject: [PATCH 2/6] gnu: Add python-multidict-5.

Incompatible with version 4.

* gnu/packages/python-xyz.scm (python-multidict-5): New variable.
---
 gnu/packages/python-xyz.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2898b0da6e..a79cc7ea1d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7068,6 +7068,18 @@ (define-public python-multidict
 where key might be occurred more than once in the container.")
     (license license:asl2.0)))
 
+(define-public python-multidict-5
+  (package
+    (inherit python-multidict)
+    (version "5.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "multidict" version))
+       (sha256
+        (base32
+         "1kjrxav572j45xvr1iy60zb2g8zqvrinzdkl4ax36js4vczckl8d"))))))
+
 (define-public python-orderedmultidict
   (package
     (name "python-orderedmultidict")
-- 
2.35.1

>From 51b618907c0ed986dfcd396c52c949b0b6f89d20 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Wed, 27 Apr 2022 09:49:13 +0200
Subject: [PATCH 4/6] gnu: Add python-sanic-bootstrap.

* gnu/packages/python-web.scm (python-sanic-bootstrap): New variable.
---
 gnu/packages/python-web.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 6ffec0d91b..83be0176f4 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -6423,6 +6423,13 @@ (define-public python-sanic
 your code non-blocking and speedy.")
     (license license:expat)))
 
+(define-public python-sanic-bootstrap
+  (package
+     (inherit python-sanic)
+     (name "python-sanic-bootstrap")
+     (arguments (list #:tests? #f))
+     (native-inputs '())))
+
 (define-public python-socketio
   (package
     (name "python-socketio")
-- 
2.35.1