- Add patch support-new-testfixtures.patch:

* Support testfixtures >= 8.3.0.

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:wbem/python-pywbem?expand=0&rev=126
This commit is contained in:
2024-09-27 07:52:35 +00:00
committed by Git OBS Bridge
commit 63f850daa9
6 changed files with 1834 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

1639
python-pywbem.changes Normal file

File diff suppressed because it is too large Load Diff

113
python-pywbem.spec Normal file
View File

@@ -0,0 +1,113 @@
#
# spec file for package python-pywbem
#
# 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
# 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/
#
# cythonized pywbem produces yacc parser errors
%bcond_with cythonize
Name: python-pywbem
Version: 1.7.2
Release: 0
Summary: Python module for making CIM operation calls using the WBEM protocol
License: LGPL-2.1-or-later
Group: System/Management
URL: https://pywbem.github.io/
Source0: https://github.com/pywbem/pywbem/archive/%{version}.tar.gz#/pywbem-%{version}.tar.gz
# PATCH-FIX-UPSTREAM Based on gh#pywbem/pywbem#3217
Patch0: support-new-testfixtures.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 38.4.1}
BuildRequires: %{python_module wheel}
%if %{with cythonize}
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
%endif
BuildRequires: %{python_module FormEncode >= 2.0.0}
BuildRequires: %{python_module PyYAML > 5.3.1}
BuildRequires: %{python_module certifi >= 2019.11.28}
BuildRequires: %{python_module httpretty}
BuildRequires: %{python_module lxml >= 4.6.4}
BuildRequires: %{python_module ply >= 3.10}
BuildRequires: %{python_module pytest >= 6.2.5}
BuildRequires: %{python_module pytz}
BuildRequires: %{python_module requests >= 2.25.0}
BuildRequires: %{python_module requests-mock}
BuildRequires: %{python_module six >= 1.16.0}
BuildRequires: %{python_module testfixtures}
BuildRequires: %{python_module urllib3 >= 1.26.5}
BuildRequires: %{python_module yamlloader >= 0.5.5}
BuildRequires: fdupes
BuildRequires: libxml2-tools
BuildRequires: python-rpm-macros
Requires: python-PyYAML >= 5.3.1
Requires: python-certifi >= 2019.11.28
Requires: python-ply >= 3.10
Requires: python-requests >= 2.25.0
Requires: python-six >= 1.16.0
Requires: python-urllib3 >= 1.26.5
Requires: python-yamlloader >= 0.5.5
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-pywebmtools
%if ! %{with cythonize}
BuildArch: noarch
%endif
%python_subpackages
%description
PyWBEM is a Python module for making CIM operation calls using the WBEM
protocol to query and update managed objects.
%prep
%autosetup -p1 -n pywbem-%{version}
%build
%pyproject_wheel %{?_with_cythonize:--config-settings "--build-option=--cythonized" .}
%install
%pyproject_install
%fdupes %{buildroot}
rm %{buildroot}%{_bindir}/*.bat
%python_clone -a %{buildroot}%{_bindir}/mof_compiler
%check
%if %{with cythonize}
%pytest_arch -k "not (skipnothingbydefault ${$python_donttest})" tests/unittest tests/functiontest
%else
%pytest -k "not (skipnothingbydefault ${$python_donttest})" tests/unittest tests/functiontest
%endif
%post
%python_install_alternative mof_compiler
%postun
%python_uninstall_alternative mof_compiler
%files %{python_files}
%doc README.md
%license LICENSE.txt
%python_alternative %{_bindir}/mof_compiler
%if %{with cythonize}
%{python_sitearch}/pywbem
%{python_sitearch}/pywbem_mock
%{python_sitearch}/pywbem-%{version}.dist-info
%else
%{python_sitelib}/pywbem
%{python_sitelib}/pywbem_mock
%{python_sitelib}/pywbem-%{version}.dist-info
%endif
%changelog

BIN
pywbem-1.7.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,55 @@
From f6acfc45af0c8b5b592890a3ff222708902f2ae7 Mon Sep 17 00:00:00 2001
From: Andreas Maier <andreas.r.maier@gmx.de>
Date: Mon, 19 Aug 2024 18:29:10 +0200
Subject: [PATCH] Test: In test_recorder.py avoid a new AssertionError by
testfixtures 8.3.0
Details:
* The setup_method() in BaseLogOperationRecorderTests had called
logging.shutdown() which triggered a new AssertionError raised by
testfixtures 8.3.0 that complains about LogCapture handlers being closed
but still installed.
Uninstalling the LogCapture handlers via LogCapture.uninstall_all()
introduced the new problem that logging was not performed correctly
anymore.
The solution seems to be to not call logging.shutdown() in setup_method(),
which is also understandable given that it is only supposed to be used
before exiting the program.
Note that we still call it in teardown_method().
Fixed steps to start new version; removed types from _version.py
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
---
docs/changes.rst | 4 ++--
test-requirements.txt | 7 +------
tests/unittest/pywbem/test_recorder.py | 9 ++++-----
3 files changed, 7 insertions(+), 13 deletions(-)
ddiff --git a/tests/unittest/pywbem/test_recorder.py b/tests/unittest/pywbem/test_recorder.py
index be618fe15..f7eb1797a 100755
--- a/tests/unittest/pywbem/test_recorder.py
+++ b/tests/unittest/pywbem/test_recorder.py
@@ -1620,14 +1620,13 @@ def setup_method(self):
"""
Setup that is run before each test method.
"""
- # Shut down any existing logger and reset WBEMConnection and
- # reset WBEMConnection class attributes
- # pylint: disable=protected-access
- WBEMConnection._reset_logging_config()
- logging.shutdown()
+ # Reset WBEMConnection logging.
# NOTE We do not clean up handlers or logger names already defined.
# That should not affect the tests.
+ # pylint: disable=protected-access
+ WBEMConnection._reset_logging_config()
+
def recorder_setup(self, detail_level=None):
"""
Setup the recorder for a defined max output size