From 2ac81f482a4d6d5b9fb41655818f01ffd3166f6f Mon Sep 17 00:00:00 2001 From: Arun Isaac <arunisaac@systemreboot.net> Date: Tue, 14 Jun 2022 16:41:34 +0530 Subject: gnu: python-httpcore: Update to 0.15.0. * gnu/packages/python-web.scm (python-httpcore): Update to 0.15.0. [arguments]: Override asyncio_mode when invoking pytest in check phase. --- gnu/packages/python-web.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gnu/packages/python-web.scm') diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 0182679acd..f94061ebe6 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -44,7 +44,7 @@ ;;; Copyright © 2021 Greg Hogan <code@greghogan.com> ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> ;;; Copyright © 2021 Pradana Aumars <paumars@courrier.dev> -;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2021, 2022 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2021 jgart <jgart@dismail.de> ;;; Copyright © 2021 Alice Brenon <alice.brenon@ens-lyon.fr> ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com> @@ -5295,7 +5295,7 @@ (define-public python-vf-1 (define-public python-httpcore (package (name "python-httpcore") - (version "0.14.7") + (version "0.15.0") (source (origin ;; PyPI tarball does not contain tests. @@ -5305,7 +5305,7 @@ (define-public python-httpcore (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0wdr28vf03l6yxhk8nrvhh7y7x18rqdcfzv1sb6jgzk9zmycrvc7")))) + (base32 "0skj8f85l52gl6x449wzaixcwsyayvn59iwn0df4b7ixlz6xhp8l")))) (build-system python-build-system) (arguments `(#:phases @@ -5313,7 +5313,8 @@ (define-public python-httpcore (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? - (invoke "pytest" "-vv" "tests"))))))) + (invoke "pytest" "-vv" "tests" + "--override-ini=asyncio_mode=auto"))))))) (native-inputs (list python-pytest python-pytest-asyncio -- cgit v1.2.3 From 6f75565b4ec3b8a7247699c327a3b3196c787f76 Mon Sep 17 00:00:00 2001 From: Arun Isaac <arunisaac@systemreboot.net> Date: Tue, 14 Jun 2022 16:45:11 +0530 Subject: gnu: python-httpx: Update to 0.23.0. * gnu/packages/python-web.scm (python-httpx): Update to 0.23.0. --- gnu/packages/python-web.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/python-web.scm') diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index f94061ebe6..30c461f247 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -5361,7 +5361,7 @@ (define-public python-httpcore-bootstrap (define-public python-httpx (package (name "python-httpx") - (version "0.22.0") + (version "0.23.0") (source (origin ;; PyPI tarball does not contain tests. @@ -5371,7 +5371,7 @@ (define-public python-httpx (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1awr56488b66zyl3cx1f03lq2n07xdg5kb4l46vnsm59s6hr02c5")))) + (base32 "0bihm7ylq9ajxz8qyba0xp9qkwm7n06hk01ywkq2vpz65ix5hpdk")))) (build-system python-build-system) (arguments `(#:phases -- cgit v1.2.3 From 5d28f089efba5eb1491f4cd3fd4fb0d4deb19d12 Mon Sep 17 00:00:00 2001 From: Vinicius Monego <monego@posteo.net> Date: Tue, 11 Jan 2022 16:25:18 +0000 Subject: gnu: Add python-zeep. * gnu/packages/python-web.scm (python-zeep): New variable. * gnu/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Co-authored-by: Hartmut Goebel <h.goebel@crazy-compilers.com> --- gnu/local.mk | 1 + .../python-zeep-Fix-pytest_httpx-test-cases.patch | 73 ++++++++++++++++++++++ gnu/packages/python-web.scm | 57 +++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 gnu/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch (limited to 'gnu/packages/python-web.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 5a9edc16bb..fa315537ce 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1720,6 +1720,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-werkzeug-tests.patch \ %D%/packages/patches/python-mypy-12332.patch \ %D%/packages/patches/python-mypy-use-sys-path.patch \ + %D%/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch \ %D%/packages/patches/qemu-build-info-manual.patch \ %D%/packages/patches/qemu-glibc-2.27.patch \ %D%/packages/patches/qemu-glibc-2.30.patch \ diff --git a/gnu/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch b/gnu/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch new file mode 100644 index 0000000000..7f022b4e46 --- /dev/null +++ b/gnu/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch @@ -0,0 +1,73 @@ +From 2907848185adcb4e6d8c093db6c617c64cb8c8bf Mon Sep 17 00:00:00 2001 +From: Georg Sauthoff <mail@gms.tf> +Date: Sat, 5 Feb 2022 14:42:10 +0100 +Subject: [PATCH] Use current pytest_httpx add_response keyword + +The new text keyword was introduced in pytest_httpx 0.14, deprecated +in 0.14 and 0.17 and removed in 0.18. + +Thus, an appropriate constraint to that dependency is added. + +FWIW, this fixes the test cases on the upcoming Fedora 36 release. + +See also: +- https://github.com/Colin-b/pytest_httpx/blob/develop/CHANGELOG.md#0180---2022-01-17 +- https://github.com/Colin-b/pytest_httpx/blob/develop/CHANGELOG.md#0140---2021-10-22 +--- + setup.py | 2 +- + tests/test_async_transport.py | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/setup.py b/setup.py +index 4cf9073b..58a5c24f 100755 +--- a/setup.py ++++ b/setup.py +@@ -29,7 +29,7 @@ + "freezegun==0.3.15", + "pretend==1.0.9", + "pytest-cov==2.8.1", +- "pytest-httpx", ++ "pytest-httpx>=0.14", + "pytest-asyncio", + "pytest==6.2.5", + "requests_mock>=0.7.0", +diff --git a/tests/test_async_transport.py b/tests/test_async_transport.py +index f5e8d1b0..ee215265 100644 +--- a/tests/test_async_transport.py ++++ b/tests/test_async_transport.py +@@ -19,7 +19,7 @@ def test_load(httpx_mock): + cache = stub(get=lambda url: None, add=lambda url, content: None) + transport = AsyncTransport(cache=cache) + +- httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x") ++ httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", text="x") + result = transport.load("http://tests.python-zeep.org/test.xml") + assert result == b"x" + +@@ -30,7 +30,7 @@ def test_load_cache(httpx_mock): + cache = InMemoryCache() + transport = AsyncTransport(cache=cache) + +- httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x") ++ httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", text="x") + result = transport.load("http://tests.python-zeep.org/test.xml") + assert result == b"x" + +@@ -45,7 +45,7 @@ async def test_post(httpx_mock: HTTPXMock): + + envelope = etree.Element("Envelope") + +- httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x") ++ httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", text="x") + result = await transport.post_xml( + "http://tests.python-zeep.org/test.xml", envelope=envelope, headers={} + ) +@@ -67,7 +67,7 @@ async def test_http_error(httpx_mock: HTTPXMock): + transport = AsyncTransport() + + httpx_mock.add_response( +- url="http://tests.python-zeep.org/test.xml", data="x", status_code=500 ++ url="http://tests.python-zeep.org/test.xml", text="x", status_code=500 + ) + with pytest.raises(exceptions.TransportError) as exc: + transport.load("http://tests.python-zeep.org/test.xml") diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 30c461f247..b4500c6d2f 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -7478,3 +7478,60 @@ (define-public python-wadllib (description "The @code{wadllib} Python library allows navigating HTTP resources using Web Application Description Language (WADL) files as guides.") (license license:lgpl3))) + +(define-public python-zeep + (package + (name "python-zeep") + (version "4.1.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "zeep" version)) + (patches + (search-patches "python-zeep-Fix-pytest_httpx-test-cases.patch")) + (sha256 + (base32 "1ranr4hkjd2kbbhxa3is1qlgkankj3sml5gla6bqs0kbvpmg4rsq")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "HOME" (getcwd)) ; one test requires write access + (invoke "pytest" "-vv"))))))) + (propagated-inputs + (list python-attrs + python-cached-property + python-isodate + python-lxml + python-platformdirs + python-pytz + python-requests + python-requests-file + python-requests-toolbelt)) + (native-inputs + (list python-aiohttp + python-aioresponses + python-freezegun + python-mock + python-pretend + python-pytest + python-pytest-asyncio + python-pytest-cov + python-pytest-httpx + python-requests-mock)) + (home-page "https://docs.python-zeep.org/en/stable/") + (synopsis "Python SOAP client based on lxml / requests") + (description "Zeep is a Python SOAP client. Highlights: + +@itemize +@item Build on top of @code{lxml} and @code{requests}. +@item Support for Soap 1.1, Soap 1.2 and HTTP bindings. +@item Support for WS-Addressing headers. +@item Support for WSSE (UserNameToken / x.509 signing). +@item Support for @code{asyncio} via @code{httpx}. +@item Experimental support for XOP messages. +@end itemize") + (license license:expat))) + -- cgit v1.2.3