commit fb4cfeaa44872742e525dcdaf0bc5c547f385e4b80e7451c26b3337b169d4806 Author: Matej Cepl Date: Thu Nov 14 17:29:02 2024 +0000 Please see the Slack thread first - 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 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-softlayer-zeep?expand=0&rev=12 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-softlayer-zeep.changes b/python-softlayer-zeep.changes new file mode 100644 index 0000000..0cde288 --- /dev/null +++ b/python-softlayer-zeep.changes @@ -0,0 +1,34 @@ +------------------------------------------------------------------- +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 + +- Add {Build,}Requires on legacy-cgi to support Python 3.13. +- Update VCS URL. + +------------------------------------------------------------------- +Tue Dec 19 13:34:00 UTC 2023 - Matej Cepl + +- Add skip-networked-test.patch to fix + gh#mvantellingen/python-zeep#1402 skipping tests requiring + network connection + +------------------------------------------------------------------- +Sat Jul 1 09:08:59 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Fri Jul 8 07:47:52 UTC 2022 - Dirk Müller + +- make it provide/obsolete python-zeep as it is a fork of it + +------------------------------------------------------------------- +Thu Jul 7 10:48:50 UTC 2022 - Dirk Müller + +- Initial package (5.0.0) diff --git a/python-softlayer-zeep.spec b/python-softlayer-zeep.spec new file mode 100644 index 0000000..b8ad4a0 --- /dev/null +++ b/python-softlayer-zeep.spec @@ -0,0 +1,91 @@ +# +# spec file for package python-softlayer-zeep +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-softlayer-zeep +Version: 5.0.0 +Release: 0 +Summary: A modern/fast Python SOAP client based on lxml / requests +License: MIT +#Git-Clone: https://github.com/softlayer/softlayer-zeep +URL: https://docs.python-zeep.org +Source: https://files.pythonhosted.org/packages/source/s/softlayer-zeep/softlayer-zeep-%{version}.tar.gz +# 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 +BuildRequires: python-rpm-macros +Requires: python-attrs >= 17.2.0 +Requires: python-isodate >= 0.5.4 +Requires: python-lxml >= 4.6.0 +Requires: python-platformdirs >= 1.4.0 +Requires: python-pytz +Requires: python-requests >= 2.7.0 +Requires: python-requests-file >= 1.5.1 +Requires: python-requests-toolbelt >= 0.7.1 +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module attrs >= 17.2.0} +BuildRequires: %{python_module freezegun >= 0.3.15} +BuildRequires: %{python_module isodate >= 0.5.4} +BuildRequires: %{python_module isort >= 5.3.2} +BuildRequires: %{python_module legacy-cgi >= 2.6} +BuildRequires: %{python_module lxml >= 4.6.0} +BuildRequires: %{python_module platformdirs >= 1.4.0} +BuildRequires: %{python_module pretend == 1.0.9} +BuildRequires: %{python_module pytest-asyncio} +BuildRequires: %{python_module pytest-httpx} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module pytz} +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} +# /SECTION +%if 0%{?python_version_nodots} >= 313 +Requires: python-legacy-cgi >= 2.6 +%endif +%python_subpackages + +%description +A modern/fast Python SOAP client based on lxml / requests + +%prep +%autosetup -p1 -n softlayer-zeep-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest -k 'not network' + +%files %{python_files} +%doc CHANGES README.rst +%license LICENSE +%{python_sitelib}/zeep +%{python_sitelib}/softlayer_zeep-%{version}.dist-info + +%changelog diff --git a/skip-networked-test.patch b/skip-networked-test.patch new file mode 100644 index 0000000..5acf7a9 --- /dev/null +++ b/skip-networked-test.patch @@ -0,0 +1,76 @@ +--- + pyproject.toml | 3 ++- + tests/test_cache.py | 4 ++++ + tests/test_wsse_username.py | 3 +++ + 3 files changed, 9 insertions(+), 1 deletion(-) + +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -28,5 +28,6 @@ testpaths = [ + ] + markers = [ + # mark a test to allow socket usage +- "requests" ++ "requests", ++ "network: test case requires network connection", + ] +--- a/tests/test_cache.py ++++ b/tests/test_cache.py +@@ -35,6 +35,7 @@ class TestSqliteCache: + result = c.get("http://tests.python-zeep.org/example.wsdl") + assert result is None + ++ @pytest.mark.network + def test_has_expired(self, tmpdir): + c = cache.SqliteCache(path=tmpdir.join("sqlite.cache.db").strpath) + c.add("http://tests.python-zeep.org/example.wsdl", b"content") +@@ -51,6 +52,7 @@ class TestSqliteCache: + assert result == b"content" + + ++@pytest.mark.network + def test_memory_cache_timeout(tmpdir): + c = cache.InMemoryCache() + c.add("http://tests.python-zeep.org/example.wsdl", b"content") +@@ -76,6 +78,7 @@ class TestIsExpired: + def test_timeout_none(self): + assert cache._is_expired(100, None) is False + ++ @pytest.mark.network + def test_has_expired(self): + timeout = 7200 + utcnow = datetime.datetime.utcnow() +@@ -83,6 +86,7 @@ class TestIsExpired: + with freezegun.freeze_time(utcnow): + assert cache._is_expired(value, timeout) is False + ++ @pytest.mark.network + def test_has_not_expired(self): + timeout = 7200 + utcnow = datetime.datetime.utcnow() +--- a/tests/test_wsse_username.py ++++ b/tests/test_wsse_username.py +@@ -85,6 +85,7 @@ def test_password_text(): + assert_nodes_equal(envelope, expected) + + ++@pytest.mark.network + @freeze_time("2016-05-08 12:00:00") + def test_password_digest(monkeypatch): + monkeypatch.setattr(os, "urandom", lambda x: b"mocked-random") +@@ -138,6 +139,7 @@ def test_password_digest(monkeypatch): + assert_nodes_equal(envelope, expected) + + ++@pytest.mark.network + @freeze_time("2016-05-08 12:00:00") + def test_password_digest_custom(monkeypatch): + monkeypatch.setattr(os, "urandom", lambda x: b"mocked-random") +@@ -323,6 +325,7 @@ def test_timestamp_token(): + assert_nodes_equal(envelope, expected) + + ++@pytest.mark.network + @freeze_time("2016-05-08 12:00:00") + def test_bytes_like_password_digest(monkeypatch): + monkeypatch.setattr(os, "urandom", lambda x: b"mocked-random") diff --git a/softlayer-zeep-5.0.0.tar.gz b/softlayer-zeep-5.0.0.tar.gz new file mode 100644 index 0000000..3f5af9c --- /dev/null +++ b/softlayer-zeep-5.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff690c115eecaececa437bfe81430e9fdb49690e6465397c9dc77eb56b681e23 +size 164776 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)