From ad0bbc3e3021d12a47b20616c56b10d012867f19173bc3ae3bae5aa946cdce62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 8 Nov 2019 07:33:58 +0000 Subject: [PATCH] - Add patches to fix build with current pytests (From upstream PRs): * pytest4.patch * pytest5.patch - Tweak the deps to stay resolvable - Fix unit tests - Use better way to handle tornado version compatibility. - Don't allow python-tornado >= 5 - update to 3.4.0 * Allow passing xsd.Nil to sequences * Add support for passing custom digest and signature methods during WSSE signing * Fix path resolving during XSD imports OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zeep?expand=0&rev=2 --- pytest4.patch | 23 +++++++++++++++++++++++ pytest5.patch | 45 +++++++++++++++++++++++++++++++++++++++++++++ python-zeep.changes | 28 ++++++++++++++++++++++++++++ python-zeep.spec | 8 ++++++-- zeep-3.3.1.tar.gz | 3 --- zeep-3.4.0.tar.gz | 3 +++ 6 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 pytest4.patch create mode 100644 pytest5.patch delete mode 100644 zeep-3.3.1.tar.gz create mode 100644 zeep-3.4.0.tar.gz diff --git a/pytest4.patch b/pytest4.patch new file mode 100644 index 0000000..11b17ba --- /dev/null +++ b/pytest4.patch @@ -0,0 +1,23 @@ +From d8b162ec931246e4d4b2a6aadf036b444fa00dbb Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Sat, 9 Mar 2019 14:45:55 +0800 +Subject: [PATCH] Update test requirements + +Tests pass here with the updated versions. +--- + tests/conftest.py | 2 +- + 2 files changed, 8 insertions(+), 8 deletions(-) + +Index: zeep-3.4.0/tests/conftest.py +=================================================================== +--- zeep-3.4.0.orig/tests/conftest.py ++++ zeep-3.4.0/tests/conftest.py +@@ -11,7 +11,7 @@ pytest.register_assert_rewrite("tests.ut + + @pytest.fixture(autouse=True) + def no_requests(request, monkeypatch): +- if request.node.get_marker("requests"): ++ if request.node.get_closest_marker('requests'): + return + + def func(*args, **kwargs): diff --git a/pytest5.patch b/pytest5.patch new file mode 100644 index 0000000..cc0119f --- /dev/null +++ b/pytest5.patch @@ -0,0 +1,45 @@ +From ba7edd6bf2b31023b31e8f17c161e1d6d5af3d29 Mon Sep 17 00:00:00 2001 +From: Jonathan Ringer +Date: Fri, 13 Sep 2019 08:49:34 -0700 +Subject: [PATCH] Make tests compatible with pytest5 + +--- + tests/test_xsd_parse.py | 2 +- + tests/test_xsd_validation.py | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_xsd_parse.py b/tests/test_xsd_parse.py +index 08285342..5478ede7 100644 +--- a/tests/test_xsd_parse.py ++++ b/tests/test_xsd_parse.py +@@ -587,7 +587,7 @@ def test_xsd_choice_with_references(): + + with pytest.raises(exceptions.XMLParseError) as exc: + result = elm.parse(xml, schema) +- assert "BAD_ELEMENT" in str(exc) ++ assert "BAD_ELEMENT" in str(exc.value) + + xml = load_xml( + b""" +diff --git a/tests/test_xsd_validation.py b/tests/test_xsd_validation.py +index 60c4bc1c..85a95720 100644 +--- a/tests/test_xsd_validation.py ++++ b/tests/test_xsd_validation.py +@@ -39,7 +39,7 @@ def test_validate_element_value(): + + with pytest.raises(exceptions.ValidationError) as exc: + result = render_node(container_elm, obj) +- assert "Missing element item (container.item)" in str(exc) ++ assert "Missing element item (container.item)" in str(exc.value) + + obj.item = "bar" + result = render_node(container_elm, obj) +@@ -82,7 +82,7 @@ def test_validate_required_attribute(): + with pytest.raises(exceptions.ValidationError) as exc: + result = render_node(container_elm, obj) + assert "The attribute item is not valid: Value is required (container.item)" in str( +- exc ++ exc.value + ) + + obj.item = "bar" diff --git a/python-zeep.changes b/python-zeep.changes index 2c6c4d6..4b0d336 100644 --- a/python-zeep.changes +++ b/python-zeep.changes @@ -1,3 +1,31 @@ +------------------------------------------------------------------- +Fri Nov 8 07:33:19 UTC 2019 - Tomáš Chvátal + +- Add patches to fix build with current pytests (From upstream PRs): + * pytest4.patch + * pytest5.patch +- Tweak the deps to stay resolvable + +------------------------------------------------------------------- +Mon Aug 26 16:57:00 UTC 2019 - Todd R + +- Fix unit tests +- Use better way to handle tornado version compatibility. + +------------------------------------------------------------------- +Mon Jul 29 17:21:09 UTC 2019 - Todd R + +- Don't allow python-tornado >= 5 + +------------------------------------------------------------------- +Fri Jun 14 08:54:20 UTC 2019 - Marketa Calabkova + +- update to 3.4.0 + * Allow passing xsd.Nil to sequences + * Add support for passing custom digest and signature methods during WSSE + signing + * Fix path resolving during XSD imports + ------------------------------------------------------------------- Mon Mar 25 11:43:38 UTC 2019 - pgajdos@suse.com diff --git a/python-zeep.spec b/python-zeep.spec index 606d269..07b4981 100644 --- a/python-zeep.spec +++ b/python-zeep.spec @@ -18,13 +18,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-zeep -Version: 3.3.1 +Version: 3.4.0 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: pytest4.patch +Patch2: pytest5.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -53,6 +55,7 @@ BuildRequires: %{python_module mock >= 2.0.0} BuildRequires: %{python_module pretend >= 1.0.8} BuildRequires: %{python_module pytest >= 3.1.3} BuildRequires: %{python_module pytest-tornado >= 0.4.5} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytz} BuildRequires: %{python_module requests >= 2.7.0} BuildRequires: %{python_module requests-mock >= 0.7.0} @@ -73,6 +76,7 @@ Python SOAP client based on python-lxml and python-requests %prep %setup -q -n zeep-%{version} +%autopatch -p1 # disable broken tests rm tests/test_wsse_signature.py rm tests/test_wsse_username.py @@ -88,7 +92,7 @@ rm tests/test_wsse_utils.py %check export LANG=en_US.UTF-8 export PYTHONDONTWRITEBYTECODE=1 -%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} tests/ +%pytest tests/ %files %{python_files} %doc CHANGES README.rst diff --git a/zeep-3.3.1.tar.gz b/zeep-3.3.1.tar.gz deleted file mode 100644 index d025a14..0000000 --- a/zeep-3.3.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f58328e36264a2fda2484dd20bb1695f4102a9cc918178d60c4d7cf8339c65d0 -size 161684 diff --git a/zeep-3.4.0.tar.gz b/zeep-3.4.0.tar.gz new file mode 100644 index 0000000..f2e2130 --- /dev/null +++ b/zeep-3.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e98669cfeb60756231ae185498f9ae21b30b2681786b8de58ed34c3b93e41dd +size 163748