mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-asgi-csrf: Make compatibly with httpx 0.28.0+.
* gnu/packages/python-web.scm (python-asgi-csrf)[arguments]: Add phase 'compatibility. Change-Id: Ifa3604fd63e9045e3f060d6b57eeeab8afd182d3
This commit is contained in:
parent
f3969be43a
commit
b886780eb9
1 changed files with 21 additions and 1 deletions
|
@ -1005,7 +1005,27 @@ WSGI. This package includes libraries for implementing ASGI servers.")
|
||||||
;; https://github.com/simonw/asgi-csrf/issues/24).
|
;; https://github.com/simonw/asgi-csrf/issues/24).
|
||||||
"-k" (string-append
|
"-k" (string-append
|
||||||
"not (test_multipart "
|
"not (test_multipart "
|
||||||
"or test_multipart_failure_wrong_token)"))))
|
"or test_multipart_failure_wrong_token)"))
|
||||||
|
#:phases
|
||||||
|
'(modify-phases %standard-phases
|
||||||
|
(add-after 'unpack 'compatibility
|
||||||
|
(lambda _
|
||||||
|
;; httpx version 0.28.0 removed the "app" shortcut.
|
||||||
|
(substitute* "test_asgi_csrf.py"
|
||||||
|
(("httpx.AsyncClient\\(app=app_csrf\\)")
|
||||||
|
"httpx.AsyncClient(transport=httpx.ASGITransport(app_csrf))")
|
||||||
|
(("httpx.AsyncClient\\(app=hello_world_app\\)")
|
||||||
|
"httpx.AsyncClient(transport=httpx.ASGITransport(hello_world_app))")
|
||||||
|
(("httpx.AsyncClient\\(app=app\\)")
|
||||||
|
"httpx.AsyncClient(transport=httpx.ASGITransport(app))")
|
||||||
|
;; The remaining invocations are harder to patch, so we
|
||||||
|
;; define a wrapper.
|
||||||
|
(("^SECRET =")
|
||||||
|
"def asgi_csrf_transport(*args, **kwargs):
|
||||||
|
return httpx.ASGITransport(asgi_csrf(*args, **kwargs))
|
||||||
|
|
||||||
|
SECRET =")
|
||||||
|
(("app=asgi_csrf") "transport=asgi_csrf_transport")))))))
|
||||||
(propagated-inputs (list python-itsdangerous python-multipart))
|
(propagated-inputs (list python-itsdangerous python-multipart))
|
||||||
(native-inputs (list python-asgi-lifespan
|
(native-inputs (list python-asgi-lifespan
|
||||||
python-httpx
|
python-httpx
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue