diff --git a/python-softlayer-zeep.changes b/python-softlayer-zeep.changes index 54ca235..0cde288 100644 --- a/python-softlayer-zeep.changes +++ b/python-softlayer-zeep.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Nov 14 12:18:00 UTC 2024 - Markéta Machová + +- Add xsd-date.patch to fix test failure +- Stop providing/obsoleting python-zeep, as the latter exists in OBS + and is more up-to-date on a lower version + ------------------------------------------------------------------- Tue Oct 29 05:34:42 UTC 2024 - Steve Kowalik diff --git a/python-softlayer-zeep.spec b/python-softlayer-zeep.spec index efba669..b8ad4a0 100644 --- a/python-softlayer-zeep.spec +++ b/python-softlayer-zeep.spec @@ -28,6 +28,8 @@ Source: https://files.pythonhosted.org/packages/source/s/softlayer-zeep/ # PATCH-FIX-UPSTREAM skip-networked-test.patch gh#mvantellingen/python-zeep#1402 mcepl@suse.com # skip tests requiring network connection Patch0: skip-networked-test.patch +# PATCH-FIX-UPSTREAM gh#mvantellingen/python-zeep#d1b0257 Fix regression in parsing xsd:Date with negative timezone +Patch1: xsd-date.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module wheel} BuildRequires: fdupes @@ -40,8 +42,6 @@ Requires: python-pytz Requires: python-requests >= 2.7.0 Requires: python-requests-file >= 1.5.1 Requires: python-requests-toolbelt >= 0.7.1 -Provides: python-zeep = %{version} -Obsoletes: python-zeep < %{version} BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module attrs >= 17.2.0} diff --git a/xsd-date.patch b/xsd-date.patch new file mode 100644 index 0000000..2e57138 --- /dev/null +++ b/xsd-date.patch @@ -0,0 +1,46 @@ +From d1b0257eb7b8f41bc74c0fa178e820c2d739cf30 Mon Sep 17 00:00:00 2001 +From: Michael van Tellingen +Date: Wed, 16 Oct 2024 07:21:21 +0200 +Subject: [PATCH] Fix regression in parsing xsd:Date with negative timezone + +--- + CHANGES | 4 ++++ + src/zeep/xsd/types/builtins.py | 12 +++++------- + tests/test_xsd_builtins.py | 2 ++ + 3 files changed, 11 insertions(+), 7 deletions(-) + +Index: softlayer-zeep-5.0.0/src/zeep/xsd/types/builtins.py +=================================================================== +--- softlayer-zeep-5.0.0.orig/src/zeep/xsd/types/builtins.py ++++ softlayer-zeep-5.0.0/src/zeep/xsd/types/builtins.py +@@ -201,6 +201,7 @@ class Time(BuiltinType): + class Date(BuiltinType): + _default_qname = xsd_ns("date") + accepted_types = [datetime.date, str] ++ _pattern = re.compile(r"(\d{4})-(\d{2})-(\d{2})") + + @check_no_collection + def xmlvalue(self, value): +@@ -210,6 +211,9 @@ class Date(BuiltinType): + + @treat_whitespace("collapse") + def pythonvalue(self, value): ++ m = self._pattern.match(value) ++ if m: ++ return datetime.date(*map(int, m.groups())) + return isodate.parse_date(value) + + +Index: softlayer-zeep-5.0.0/tests/test_xsd_builtins.py +=================================================================== +--- softlayer-zeep-5.0.0.orig/tests/test_xsd_builtins.py ++++ softlayer-zeep-5.0.0/tests/test_xsd_builtins.py +@@ -242,6 +242,8 @@ class TestDate: + instance = builtins.Date() + assert instance.pythonvalue("2016-03-04") == datetime.date(2016, 3, 4) + assert instance.pythonvalue("2001-10-26+02:00") == datetime.date(2001, 10, 26) ++ assert instance.pythonvalue("2001-10-26-02:00") == datetime.date(2001, 10, 26) ++ assert instance.pythonvalue("2024-08-21-10:00") == datetime.date(2024, 8, 21) + assert instance.pythonvalue("2001-10-26Z") == datetime.date(2001, 10, 26) + assert instance.pythonvalue("2001-10-26+00:00") == datetime.date(2001, 10, 26) + assert instance.pythonvalue("\r\n\t 2016-03-04 ") == datetime.date(2016, 3, 4)