Subject: [bug#78322] [PATCH v2 2/3] gnu: Add python-aiohttp-cors.

From: Sergio Pastor Pérez <[email-masked]>
Date: Fri, 9 May 2025 21:29:04 +0200

* gnu/packages/python-web.scm (python-aiohttp-cors): New variable.

Change-Id: Ic94d0b06d787564e20fbe39196d5843af4e9f3a2
---
 gnu/packages/python-web.scm | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index c0c9e244f8..b5a5a30add 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1123,6 +1123,44 @@ (define-public python-aiohttp
 @end itemize")
     (license license:asl2.0)))
 
+(define-public python-aiohttp-cors
+  (package
+    (name "python-aiohttp-cors")
+    (version "0.8.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "aiohttp_cors" version))
+       (sha256
+        (base32 "00qlzc2y65bkl1a5f5v83mmjlrhzmx3a2ngq2pm3jjdnhk5zkb6c"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-aiohttp))
+    (native-inputs (list python-setuptools
+                         python-tox
+                         python-wheel))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'remove-network-dep
+           (lambda _
+             ;; Tests try to install from network even if its available
+             ;; locally.
+             (substitute* "setup.py"
+               (("\"aiohttp>=3.9\",") ""))))
+         ;; Tests run with `py.test' require a GUI browser window.
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+                 (invoke "tox")
+                 (format #t "test suite not run~%"))
+             #t)))))
+    (home-page "https://github.com/aio-libs/aiohttp-cors")
+    (synopsis "CORS support for aiohttp")
+    (description
+     "This library implements @acronym{CORS, Cross Origin Resource Sharing}
+support for aiohttp asyncio-powered asynchronous HTTP server.")
+    (license license:asl2.0)))
+
 (define-public python-aiohttp-socks
   (package
     (name "python-aiohttp-socks")
-- 
2.49.0