From 5a021439fad4d9a93fd2f4ea08fdd0d23a521365 Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Wed, 13 Apr 2022 09:10:59 -0500 Subject: [PATCH] Update to 0.17.6 Signed-off-by: Tony Asleson --- .gitignore | 1 + ...2368.patch => 0001-use-unittest-mock.patch | 30 ++++++++++--------- 0002-coverity-deadcode.patch | 15 ++++++++++ 0003-coverity-forward-null.patch | 12 ++++++++ 0004-coverity-identifier-typo.patch | 19 ++++++++++++ pywbem.spec | 13 ++++++-- sources | 2 +- 7 files changed, 74 insertions(+), 18 deletions(-) rename BZ_1922368.patch => 0001-use-unittest-mock.patch (73%) create mode 100644 0002-coverity-deadcode.patch create mode 100644 0003-coverity-forward-null.patch create mode 100644 0004-coverity-identifier-typo.patch diff --git a/.gitignore b/.gitignore index dc99b42..cbf60cf 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /pywbem-0.14.6.tar.gz /pywbem-1.0.1.tar.gz /pywbem-0.15.0.tar.gz +/pywbem-0.17.6.tar.gz diff --git a/BZ_1922368.patch b/0001-use-unittest-mock.patch similarity index 73% rename from BZ_1922368.patch rename to 0001-use-unittest-mock.patch index 067fa11..0945711 100644 --- a/BZ_1922368.patch +++ b/0001-use-unittest-mock.patch @@ -1,8 +1,8 @@ diff --git a/minimum-constraints.txt b/minimum-constraints.txt -index a3ba9471..8dd066ca 100644 +index 570295ab..e771637b 100644 --- a/minimum-constraints.txt +++ b/minimum-constraints.txt -@@ -56,7 +56,6 @@ wheel==0.33.6; python_version >= '3.8' +@@ -92,7 +92,6 @@ wheel==0.33.5; python_version >= '3.8' # Direct dependencies for install (must be consistent with requirements.txt) M2Crypto==0.31.0 @@ -11,7 +11,7 @@ index a3ba9471..8dd066ca 100644 ply==3.10 PyYAML==3.11; python_version == '2.6' diff --git a/pywbem_mock/_wbemconnection_mock.py b/pywbem_mock/_wbemconnection_mock.py -index e5dd0f8d..6ea95119 100644 +index aa27b305..3eedb330 100644 --- a/pywbem_mock/_wbemconnection_mock.py +++ b/pywbem_mock/_wbemconnection_mock.py @@ -40,7 +40,7 @@ try: @@ -22,24 +22,26 @@ index e5dd0f8d..6ea95119 100644 +from unittest.mock import Mock import six - try: + # pylint: disable=ungrouped-imports diff --git a/requirements.txt b/requirements.txt -index 69a01d7c..f1287af2 100644 +index 3ac782d5..1e5cd238 100644 --- a/requirements.txt +++ b/requirements.txt -@@ -11,7 +11,6 @@ +@@ -11,9 +11,6 @@ # On Windows, M2Crypto must be installed via pywbem_os_setup.bat M2Crypto>=0.31.0; python_version < '3.0' and sys_platform != 'win32' --mock>=2.0.0 +-mock>=2.0.0,<3.0.0; python_version == '2.6' +-mock>=2.0.0,<4.0.0; python_version >= '2.7' and python_version <= '3.5' +-mock>=2.0.0; python_version >= '3.6' ordereddict>=1.1; python_version == '2.6' ply>=3.10 - PyYAML>=3.11,<3.12; python_version == '2.6' # yaml package + # PyYAML 5.3 has removed support for Python 3.4; fixes narrow build error diff --git a/tests/unittest/pywbem/test_cim_obj.py b/tests/unittest/pywbem/test_cim_obj.py -index 3d0e3b80..e0d9e39f 100755 +index 2f6b89d2..d3f8a9aa 100755 --- a/tests/unittest/pywbem/test_cim_obj.py +++ b/tests/unittest/pywbem/test_cim_obj.py -@@ -12,7 +12,7 @@ from __future__ import absolute_import, print_function +@@ -9,7 +9,7 @@ from __future__ import absolute_import, print_function import sys import re from datetime import timedelta, datetime @@ -49,7 +51,7 @@ index 3d0e3b80..e0d9e39f 100755 from collections import OrderedDict except ImportError: diff --git a/tests/unittest/pywbem/test_itermethods.py b/tests/unittest/pywbem/test_itermethods.py -index 635bd130..7343f6fe 100644 +index f7d0f8da..c613c3df 100644 --- a/tests/unittest/pywbem/test_itermethods.py +++ b/tests/unittest/pywbem/test_itermethods.py @@ -24,7 +24,7 @@ from __future__ import absolute_import, print_function @@ -59,10 +61,10 @@ index 635bd130..7343f6fe 100644 -from mock import Mock +from unittest.mock import Mock + # pylint: disable=wrong-import-position, wrong-import-order, invalid-name from ...utils import import_installed - pywbem = import_installed('pywbem') # noqa: E402 diff --git a/tests/unittest/pywbem/test_valuemapping.py b/tests/unittest/pywbem/test_valuemapping.py -index 27f86588..db31d3c3 100644 +index bf93b87c..263294a5 100644 --- a/tests/unittest/pywbem/test_valuemapping.py +++ b/tests/unittest/pywbem/test_valuemapping.py @@ -7,7 +7,7 @@ from __future__ import absolute_import @@ -72,5 +74,5 @@ index 27f86588..db31d3c3 100644 -from mock import Mock +from unittest.mock import Mock + # pylint: disable=wrong-import-position, wrong-import-order, invalid-name from ...utils import import_installed - pywbem = import_installed('pywbem') # noqa: E402 diff --git a/0002-coverity-deadcode.patch b/0002-coverity-deadcode.patch new file mode 100644 index 0000000..c5df2c5 --- /dev/null +++ b/0002-coverity-deadcode.patch @@ -0,0 +1,15 @@ +diff --git a/pywbem/_recorder.py b/pywbem/_recorder.py +index f5b2b7d6..70de34fe 100644 +--- a/pywbem/_recorder.py ++++ b/pywbem/_recorder.py +@@ -689,8 +689,8 @@ class LogOperationRecorder(BaseOperationRecorder): + # Format the 'summary' and 'paths' detail_levels + if self.api_detail_level == 'summary': # pylint: disable=R1705 + if isinstance(ret, list): +- if ret: +- ret_type = type(ret[0]).__name__ if ret else "" ++ if len(ret) > 0: ++ ret_type = type(ret[0]).__name__ + return _format("list of {0}; count={1}", + ret_type, len(ret)) + return "Empty" diff --git a/0003-coverity-forward-null.patch b/0003-coverity-forward-null.patch new file mode 100644 index 0000000..acea02c --- /dev/null +++ b/0003-coverity-forward-null.patch @@ -0,0 +1,12 @@ +diff --git a/pywbem/_cim_obj.py b/pywbem/_cim_obj.py +index d91a2cb1..5c9a69a5 100644 +--- a/pywbem/_cim_obj.py ++++ b/pywbem/_cim_obj.py +@@ -1954,6 +1954,7 @@ class CIMInstanceName(_CIMComparisonMixin): + _format("WBEM URI has an invalid format for its keybindings: " + "{0!A}", keybindings_str)) + ++ kb_assigns = [] + if m.group(1): + kb_assigns = [m.group(1)] + diff --git a/0004-coverity-identifier-typo.patch b/0004-coverity-identifier-typo.patch new file mode 100644 index 0000000..f394ea4 --- /dev/null +++ b/0004-coverity-identifier-typo.patch @@ -0,0 +1,19 @@ +diff --git a/pywbem/_cim_xml.py b/pywbem/_cim_xml.py +index 133b070d..c0ad603e 100644 +--- a/pywbem/_cim_xml.py ++++ b/pywbem/_cim_xml.py +@@ -1829,12 +1829,12 @@ class RESPONSEDESTINATION(CIMElement): + + :: + +- ++ + """ + + def __init__(self, data): + # We use call by class name because it is an old-style class. +- CIMElement.__init__(self, 'RESPONSEDESTINATON') ++ CIMElement.__init__(self, 'RESPONSEDESTINATION') + self.appendChild(data) + + diff --git a/pywbem.spec b/pywbem.spec index 6ab0661..fa0f256 100644 --- a/pywbem.spec +++ b/pywbem.spec @@ -1,14 +1,17 @@ %{?python_enable_dependency_generator} Name: pywbem -Version: 0.15.0 +Version: 0.17.6 Epoch: 1 -Release: 7%{?dist} +Release: 1%{?dist} Summary: Python WBEM client interface and related utilities License: LGPLv2 URL: https://github.com/pywbem/pywbem Source0: https://github.com/pywbem/pywbem/archive/v%{version}/%{name}-%{version}.tar.gz -Patch1: BZ_1922368.patch +Patch1: 0001-use-unittest-mock.patch +Patch2: 0002-coverity-deadcode.patch +Patch3: 0003-coverity-forward-null.patch +Patch4: 0004-coverity-identifier-typo.patch BuildRequires: python3-pip python3-PyYAML python3-ply python3-rpm-macros BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -68,6 +71,10 @@ mv -v %{buildroot}/%{_bindir}/wbemcli.py %{buildroot}/%{_bindir}/pywbemcli.py %doc README.rst %changelog +* Tue Apr 12 2022 Tony Asleson - 1:0.17.6-1 +- Update to 0.17.6 which is the latest release that doesn't introduce + dependencies which we don't have available. + * Fri Jan 21 2022 Fedora Release Engineering - 1:0.15.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index e1f7eaa..2e2cd28 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pywbem-0.15.0.tar.gz) = a5d8855cfb0987b89eee104c03f25649dff28b350ce92d822c76d00fea47e162d754dad31f0c1e4d88c137410649f46d79a0e4019e646bc8f58d4ead5fc9bf0c +SHA512 (pywbem-0.17.6.tar.gz) = c5950f912ee5f7050d667808664644b9801941f9bb415682c36d20c4f5683d6627bbd963c748ffb651bf38274a6d57e5343967a36f9b69dd70a47f8290398a26