From 155bebfe90fbf8922e77976621e205de7a2418366917473e4e79cc1a8515e645 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 15 Dec 2023 06:37:51 +0000 Subject: [PATCH] - Update to 4.2.1: * Fix error regarding closing session in async transport (#1347) * Drop support for Python 3.6 * Allow embedding CDATA elements in simple types (#1339) * Allow to pass in a pre parsed Document (#1330) * Fix httpx DeprecationWarning for post data (#1326) * Add BinaryMemorySignature (#1300) * Fix IndexError when empty body response (#1287) * Add support for context manager on Client (#1166) * Allow Ws Addressing plugin to use a different URL (#1328) * Accept strings for xsd base64Binary (#1072) - Drop patches httpx-test.patch, python-zeep-no-mock.patch: * Included upstream. - Add patch xfail-network-tests.patch: * XFAIL, rather than FAIL tests that require a network connection. - Switch to autosetup and pyproject macros. - BuildRequire xmlsec unilaterally and install the openssl library. - No longer ignore some test files OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zeep?expand=0&rev=18 --- httpx-test.patch | 40 --------------------------------------- python-zeep-no-mock.patch | 39 -------------------------------------- python-zeep.changes | 22 +++++++++++++++++++++ python-zeep.spec | 31 +++++++++++++----------------- xfail-network-tests.patch | 13 +++++++++++++ zeep-4.1.0.tar.gz | 3 --- zeep-4.2.1.tar.gz | 3 +++ 7 files changed, 51 insertions(+), 100 deletions(-) delete mode 100644 httpx-test.patch delete mode 100644 python-zeep-no-mock.patch create mode 100644 xfail-network-tests.patch delete mode 100644 zeep-4.1.0.tar.gz create mode 100644 zeep-4.2.1.tar.gz diff --git a/httpx-test.patch b/httpx-test.patch deleted file mode 100644 index f968304..0000000 --- a/httpx-test.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/tests/test_async_transport.py b/tests/test_async_transport.py -index 940b48a..7cce440 100644 ---- a/tests/test_async_transport.py -+++ b/tests/test_async_transport.py -@@ -21,7 +21,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" - -@@ -32,7 +32,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" - -@@ -47,7 +47,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={} - ) -@@ -69,7 +69,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/python-zeep-no-mock.patch b/python-zeep-no-mock.patch deleted file mode 100644 index 4764a8e..0000000 --- a/python-zeep-no-mock.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/setup.py b/setup.py -index dfa79a58..4cf9073b 100755 ---- a/setup.py -+++ b/setup.py -@@ -27,7 +27,6 @@ - tests_require = [ - "coverage[toml]==5.2.1", - "freezegun==0.3.15", -- "mock==2.0.0", - "pretend==1.0.9", - "pytest-cov==2.8.1", - "pytest-httpx", -diff --git a/tests/conftest.py b/tests/conftest.py -index 64c9bf95..4bd41de0 100644 ---- a/tests/conftest.py -+++ b/tests/conftest.py -@@ -2,10 +2,6 @@ - - import pytest - --# Don't try to test asyncio since it is py3 only syntax --if sys.version_info < (3, 5): -- collect_ignore = ["test_asyncio_transport.py"] -- - pytest.register_assert_rewrite("tests.utils") - - -diff --git a/tests/test_main.py b/tests/test_main.py -index bffc7230..f4504820 100644 ---- a/tests/test_main.py -+++ b/tests/test_main.py -@@ -1,4 +1,5 @@ --from mock import patch -+from unittest.mock import patch -+ - from pretend import stub - - from zeep import __main__, client - diff --git a/python-zeep.changes b/python-zeep.changes index 48f1c9f..7abb0d7 100644 --- a/python-zeep.changes +++ b/python-zeep.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Fri Dec 15 06:34:59 UTC 2023 - Steve Kowalik + +- Update to 4.2.1: + * Fix error regarding closing session in async transport (#1347) + * Drop support for Python 3.6 + * Allow embedding CDATA elements in simple types (#1339) + * Allow to pass in a pre parsed Document (#1330) + * Fix httpx DeprecationWarning for post data (#1326) + * Add BinaryMemorySignature (#1300) + * Fix IndexError when empty body response (#1287) + * Add support for context manager on Client (#1166) + * Allow Ws Addressing plugin to use a different URL (#1328) + * Accept strings for xsd base64Binary (#1072) +- Drop patches httpx-test.patch, python-zeep-no-mock.patch: + * Included upstream. +- Add patch xfail-network-tests.patch: + * XFAIL, rather than FAIL tests that require a network connection. +- Switch to autosetup and pyproject macros. +- BuildRequire xmlsec unilaterally and install the openssl library. +- No longer ignore some test files + ------------------------------------------------------------------- Wed Jun 8 21:55:35 UTC 2022 - Ben Greiner diff --git a/python-zeep.spec b/python-zeep.spec index 551fdc3..2956b66 100644 --- a/python-zeep.spec +++ b/python-zeep.spec @@ -1,7 +1,7 @@ # # spec file for package python-zeep # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,17 +18,17 @@ %define skip_python2 1 Name: python-zeep -Version: 4.1.0 +Version: 4.2.1 Release: 0 Summary: A Python SOAP client based on lxml/requests License: MIT -Group: Development/Languages/Python URL: http://docs.python-zeep.org Source: https://files.pythonhosted.org/packages/source/z/zeep/zeep-%{version}.tar.gz -Patch1: httpx-test.patch -# https://github.com/mvantellingen/python-zeep/commit/1ddd118956870f9c68a24c9494207dc17441b416 -Patch2: python-zeep-no-mock.patch +# PATCH-FIX-OPENSUSE xfail tests that require network access +Patch0: xfail-network-tests.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-attrs >= 17.2.0 @@ -60,8 +60,8 @@ BuildRequires: %{python_module requests >= 2.7.0} BuildRequires: %{python_module requests-file >= 1.5.1} BuildRequires: %{python_module requests-mock >= 0.7.0} BuildRequires: %{python_module requests-toolbelt >= 0.7.1} -# gh#mehcode/python-xmlsec#204 -BuildRequires: %{python_module xmlsec >= 0.6.1 if %python-base < 3.10} +BuildRequires: %{python_module xmlsec >= 0.6.1} +BuildRequires: libxmlsec1-openssl1 # /SECTION %python_subpackages @@ -69,28 +69,23 @@ BuildRequires: %{python_module xmlsec >= 0.6.1 if %python-base < 3.10} Python SOAP client based on python-lxml and python-requests %prep -%setup -q -n zeep-%{version} -%autopatch -p1 +%autosetup -p1 -n zeep-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export LANG=en_US.UTF-8 -# broken tests -ignorefiles="--ignore tests/test_wsse_signature.py \ - --ignore tests/test_wsse_username.py \ - --ignore tests/test_wsse_utils.py" -%pytest tests/ ${$python_ignore} $ignorefiles +%pytest tests %files %{python_files} %doc CHANGES README.rst %license LICENSE %{python_sitelib}/zeep -%{python_sitelib}/zeep-%{version}*-info +%{python_sitelib}/zeep-%{version}.dist-info %changelog diff --git a/xfail-network-tests.patch b/xfail-network-tests.patch new file mode 100644 index 0000000..e228c8f --- /dev/null +++ b/xfail-network-tests.patch @@ -0,0 +1,13 @@ +Index: zeep-4.2.1/tests/conftest.py +=================================================================== +--- zeep-4.2.1.orig/tests/conftest.py ++++ zeep-4.2.1/tests/conftest.py +@@ -11,7 +11,7 @@ def no_requests(request, monkeypatch): + return + + def func(*args, **kwargs): +- pytest.fail("External connections not allowed during tests.") ++ pytest.xfail("External connections not allowed during tests.") + + monkeypatch.setattr("socket.socket", func) + diff --git a/zeep-4.1.0.tar.gz b/zeep-4.1.0.tar.gz deleted file mode 100644 index a36e4dd..0000000 --- a/zeep-4.1.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5867f2eadd6b028d9751f4155af590d3aaf9280e3a0ed5e15a53343921c956e5 -size 160333 diff --git a/zeep-4.2.1.tar.gz b/zeep-4.2.1.tar.gz new file mode 100644 index 0000000..5219f90 --- /dev/null +++ b/zeep-4.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72093acfdb1d8360ed400869b73fbf1882b95c4287f798084c42ee0c1ff0e425 +size 161072