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

Message ID f126669480a46e4f6f2b42aa076dacbe974dcd02.1746818945.git.sergio.pastorperez@gmail.com
State New
Headers
Series [bug#78322,v2,1/3] gnu: Add python-pytest-pylint. |

Commit Message

Sergio Pastor Pérez May 9, 2025, 7:29 p.m. UTC
  * gnu/packages/python-web.scm (python-aiohttp-cors): New variable.

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

Patch

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")