[bug#78322] gnu: Add python-aiohttp-cors.

Message ID 5b001b17eaa706002a5c251f6eecd47bd40b4a33.1746722426.git.sergio.pastorperez@gmail.com
State New
Headers
Series [bug#78322] gnu: Add python-aiohttp-cors. |

Commit Message

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

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

Patch

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index c0c9e244f8..909b65b023 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1123,6 +1123,48 @@  (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-pytest-cov
+                         python-pytest-pylint
+                         python-pytest-runner
+                         python-selenium
+                         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 Cross Origin Resource Sharing (CORS)
+support for aiohttp asyncio-powered asynchronous HTTP server.")
+    (license license:asl2.0)))
+
 (define-public python-aiohttp-socks
   (package
     (name "python-aiohttp-socks")