Hello community, here is the log from the commit of package python-pywbem for openSUSE:Factory checked in at 2019-12-23 22:34:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pywbem (Old) and /work/SRC/openSUSE:Factory/.python-pywbem.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pywbem" Mon Dec 23 22:34:56 2019 rev:10 rq:755472 version:0.15.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pywbem/python-pywbem.changes 2019-12-07 15:14:14.847805535 +0100 +++ /work/SRC/openSUSE:Factory/.python-pywbem.new.6675/python-pywbem.changes 2019-12-23 22:36:15.993789667 +0100 @@ -1,0 +2,27 @@ +Mon Dec 9 12:00:51 CET 2019 - Matej Cepl <[email protected]> + +- Add replace-yamlordereddictloader-w-yamlloader.patch which can + allow us to kick off deprecated yamlordereddictloader module + from Factory again. gh#pywbem/pywbem#2022 + +------------------------------------------------------------------- +Sat Dec 7 13:29:24 CET 2019 - Matej Cepl <[email protected]> + +- Add silenced_MOFCompiler.patch so we can unexclude some more + tests. + +------------------------------------------------------------------- +Fri Dec 6 14:22:55 CET 2019 - Matej Cepl <[email protected]> + +- Update to 0.15.0: + - This release deprecates the wbemcli command. Pywbem 1.0.0 + will remove the wbemcli command. The recommended replacement + is the pywbemcli command from the pywbemtools package on + Pypi: https://pypi.org/project/pywbemtools/ + - Further changes are presented on + https://pywbem.readthedocs.io/en/stable_0.15/changes.html#pywbem-0-15-0 + - Depends on the acceptance of bdo#754686 + - Many many tests need to be switched off (gh#pywbem/pywbem#2004) +- fix unit tests (unittest2-just-say-no.patch) + +------------------------------------------------------------------- Old: ---- pywbem-0.14.6.tar.gz New: ---- pywbem-0.15.0.tar.gz replace-yamlordereddictloader-w-yamlloader.patch silenced_MOFCompiler.patch unittest2-just-say-no.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pywbem.spec ++++++ --- /var/tmp/diff_new_pack.R2CrAC/_old 2019-12-23 22:36:18.397790710 +0100 +++ /var/tmp/diff_new_pack.R2CrAC/_new 2019-12-23 22:36:18.405790713 +0100 @@ -15,29 +15,48 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # - %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%global pkgname pywbem +%define skip_python2 1 +%global modname pywbem Name: python-pywbem -Version: 0.14.6 +Version: 0.15.0 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: pywbem-%{version}.tar.gz +Source0: https://github.com/pywbem/%{modname}/archive/%{version}.tar.gz#/%{modname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM unittest2-just-say-no.patch gh#pywbem/pywbem#2003 [email protected] +# Don't use unittest2, ever +Patch0: unittest2-just-say-no.patch +# PATCH-FIX-UPSTREAM silenced_MOFCompiler.patch gh#pywbem/pywbem#2004 [email protected] +# fix some failing tests +Patch1: silenced_MOFCompiler.patch +# PATCH-FIX-UPSTREAM replace-yamlordereddictloader-w-yamlloader.patch gh#pywbem/pywbem#2022 [email protected] +# we can kick off deprecated yamlordereddictloader module from Factory again +Patch2: replace-yamlordereddictloader-w-yamlloader.patch +BuildRequires: %{python_module FormEncode} BuildRequires: %{python_module M2Crypto} BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module base} BuildRequires: %{python_module devel} +BuildRequires: %{python_module httpretty} +BuildRequires: %{python_module lxml} BuildRequires: %{python_module mock} BuildRequires: %{python_module pbr} BuildRequires: %{python_module pip} BuildRequires: %{python_module ply} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module pytest-cov} +BuildRequires: %{python_module requests} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} +BuildRequires: %{python_module testfixtures} +BuildRequires: %{python_module yamlloader} BuildRequires: fdupes BuildRequires: python-rpm-macros +# For xmllint +BuildRequires: libxml2-tools Requires: python Requires: python-M2Crypto Requires: python-PyYAML @@ -57,7 +76,8 @@ protocol to query and update managed objects. %prep -%setup -q -n %{pkgname}-%{version} +%setup -q -n %{modname}-%{version} +%autopatch -p1 %build %python_build @@ -72,6 +92,16 @@ %python_clone -a %{buildroot}%{_bindir}/wbemcli.py %python_clone -a %{buildroot}%{_bindir}/mof_compiler +%check +# gh#pywbem/pywbem#2004 for -k +%{python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitelib} \ +py.test-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v \ + --cov pywbem --cov pywbem_mock --cov-config coveragerc \ + -W default -W ignore::PendingDeprecationWarning -W ignore::ResourceWarning \ + -k 'not test_wbemcli' \ + tests/unittest tests/functiontest -s +} + %post %python_install_alternative pywbemcli %python_install_alternative wbemcli.py ++++++ pywbem-0.14.6.tar.gz -> pywbem-0.15.0.tar.gz ++++++ ++++ 51412 lines of diff (skipped) ++++++ replace-yamlordereddictloader-w-yamlloader.patch ++++++ >From a4b5157715a58c49a22d46ca7962df0708916199 Mon Sep 17 00:00:00 2001 From: Andreas Maier <[email protected]> Date: Mon, 9 Dec 2019 04:57:28 +0100 Subject: [PATCH] Replaced yamlordereddictloader package with yamlloader Details: * The yamlordereddictloader package is deprecated and points to yamlloader as a replacement. Yamlloader was first released in 2018 as 0.5.0 and is now at 0.5.5, supporting Python 2.7, and 3.4 and higher. This change replaces the yamlordereddictloader package with yamlloader with a minimum version of 0.5.5, but only for Python 2.7 and higher. For Python 2.6, we are still using yamlordereddictloader. * The invalidresponseerror.yaml testcase contains illegal Unicode sequences (in order to test pywbem behavior against them), which gets rejected by the yaml parser that is used when using the CLoader of yamlloader. Using the Loader class uses a different yamnl parser that tolerates them. Therefore, the functiontest/conftest.py class uses yamlloader.ordereddict.Loader. The server_definitionfile.py file uses yamlloader.ordereddict.CSafeLoader which seems to be the best default choice. * Signed-off-by: Andreas Maier <[email protected]> --- dev-requirements.txt | 3 ++- docs/changes.rst | 6 ++++++ minimum-constraints.txt | 3 ++- .../utils/server_definition_file.py | 18 +++++++++++++----- tests/functiontest/conftest.py | 14 ++++++++++++-- 5 files changed, 35 insertions(+), 9 deletions(-) --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -38,7 +38,8 @@ lxml>=4.4.1; python_version >= '3.8' requests>=2.19.1; python_version == '2.6' requests>=2.20.1; python_version > '2.6' decorator>=4.0.11 -yamlordereddictloader>=0.4.0 +yamlordereddictloader>=0.4.0; python_version == '2.6' +yamlloader>=0.5.5; python_version > '2.6' funcsigs>=1.0.2 # Indirect dependencies that are needed due to version pinning --- a/docs/changes.rst +++ b/docs/changes.rst @@ -149,6 +149,10 @@ Released: 2019-12-01 native Python types int, long, float. These types cannot occur in this function, so no tests could be written that test that code. +* For Python 2.7 and higher, replaced the yamlordereddictloader + package with yamlloader, as it was deprecated. For Python 2.6, + still using yamlordereddictloader. (See issue #2008) + pywbem 0.14.6 ------------- --- a/minimum-constraints.txt +++ b/minimum-constraints.txt @@ -85,7 +85,8 @@ lxml==4.4.1; python_version >= '3.8' requests==2.19.1; python_version == '2.6' requests==2.20.1; python_version > '2.6' decorator==4.0.11 -yamlordereddictloader==0.4.0 +yamlordereddictloader==0.4.0; python_version == '2.6' +yamlloader==0.5.5; python_version > '2.6' funcsigs==1.0.2 FormEncode==1.3.1 --- a/tests/end2endtest/utils/server_definition_file.py +++ b/tests/end2endtest/utils/server_definition_file.py @@ -5,6 +5,7 @@ end2end tests. from __future__ import absolute_import +import sys import os try: from collections import OrderedDict @@ -12,7 +13,13 @@ except ImportError: from ordereddict import OrderedDict import errno import yaml -import yamlordereddictloader + +if sys.version_info[0:2] > (2, 6): + import yamlloader # noqa: E402 + yaml_loader = yamlloader.ordereddict.CSafeLoader +else: + import yamlordereddictloader # noqa: E402 + yaml_loader = yamlordereddictloader.Loader SDF_DIR = os.path.join('tests', 'server_definitions') @@ -44,7 +51,7 @@ class ServerDefinitionFile(object): try: with open(self._filepath) as fp: try: - data = yaml.load(fp, Loader=yamlordereddictloader.Loader) + data = yaml.load(fp, Loader=yaml_loader) except (yaml.parser.ParserError, yaml.scanner.ScannerError) as exc: raise ServerDefinitionFileError( @@ -65,7 +72,8 @@ class ServerDefinitionFile(object): raise ServerDefinitionFileError( "The WBEM server definition file {0!r} is empty". format(self._filepath)) - if not isinstance(data, OrderedDict): + if not isinstance(data, (dict, OrderedDict)): + # Starting with py38, this is a standard dict raise ServerDefinitionFileError( "The WBEM server definition file {0!r} must contain a " "dictionary at the top level, but contains {1}". @@ -77,7 +85,7 @@ class ServerDefinitionFile(object): "'servers' item, but items: {1}". format(self._filepath, data.keys())) servers = data.get('servers') - if not isinstance(servers, OrderedDict): + if not isinstance(servers, (dict, OrderedDict)): raise ServerDefinitionFileError( "'servers' in WBEM server definition file {0!r} " "must be a dictionary, but is a {1}". @@ -85,7 +93,7 @@ class ServerDefinitionFile(object): self._servers.update(servers) server_groups = data.get('server_groups', OrderedDict()) - if not isinstance(server_groups, OrderedDict): + if not isinstance(server_groups, (dict, OrderedDict)): raise ServerDefinitionFileError( "'server_groups' in WBEM server definition file {0!r} " "must be a dictionary, but is a {1}". --- a/tests/functiontest/conftest.py +++ b/tests/functiontest/conftest.py @@ -126,6 +126,7 @@ Syntax elements: from __future__ import absolute_import, print_function +import sys import doctest import socket import re @@ -137,7 +138,6 @@ try: except ImportError: from ordereddict import OrderedDict import yaml -import yamlordereddictloader import pytest import httpretty from httpretty.core import HTTPrettyRequestEmpty, fakesock @@ -150,6 +150,13 @@ pywbem = import_installed('pywbem') # n from pywbem._utils import _ensure_unicode from pywbem._nocasedict import NocaseDict +if sys.version_info[0:2] > (2, 6): + import yamlloader # noqa: E402 + yaml_loader = yamlloader.ordereddict.Loader +else: + import yamlordereddictloader # noqa: E402 + yaml_loader = yamlordereddictloader.Loader + class ExcThread(threading.Thread): """ @@ -231,7 +238,10 @@ class YamlFile(pytest.File): def collect(self): with self.fspath.open(encoding='utf-8') as fp: filepath = self.fspath.relto(self.parent.fspath) - testcases = yaml.load(fp, Loader=yamlordereddictloader.Loader) + # We need to be able to load illegal Unicode sequences for testing, + # so we use the non-C loader. This causes the yaml parser to + # tolerate these sequences. The C loader rejects them. + testcases = yaml.load(fp, Loader=yaml_loader) for i, testcase in enumerate(testcases): try: tc_name = testcase['name'] ++++++ silenced_MOFCompiler.patch ++++++ >From 3e81df0040a3679b3488e39ce9e92dec297e71c9 Mon Sep 17 00:00:00 2001 From: Andreas Maier <[email protected]> Date: Sat, 7 Dec 2019 11:38:35 +0100 Subject: [PATCH] Silenced MOFCompiler for verbose=False; Fixed moftab version check Details: * Silenced the MOFCompiler class for verbose=False. So far, it still printed messages for generating the YACC parser table, causing one test to fail, and others to issue useless prints. (Issue #2004) * Test: Fixed an error in testing the PLY table version in testcases that caused the LEX/YACC parser table files to be written to the pywbem installation when using TEST_INSTALLED. (Related to issue #2004) Signed-off-by: Andreas Maier <[email protected]> --- docs/changes.rst | 8 ++++++++ pywbem/mof_compiler.py | 8 +++++--- tests/unittest/pywbem/test_mof_compiler.py | 8 ++++---- tests/utils.py | 21 ++++++++++----------- 4 files changed, 27 insertions(+), 18 deletions(-) --- a/docs/changes.rst +++ b/docs/changes.rst @@ -78,6 +78,14 @@ Released: 2019-12-01 * Fixed several install issues with the lxml, flake8, pywin32, pip, setuptools, and wheel packages on Python 3.8 on Windows. (See issues #1975, #1980). +* Silenced the MOFCompiler class for verbose=False. So far, it still printed + messages for generating the YACC parser table, causing one test to fail, + and others to issue useless prints. (Issue #2004) + +* Test: Fixed an error in testing the PLY table version in testcases that caused + the LEX/YACC parser table files to be written to the pywbem installation + when using TEST_INSTALLED. (Related to issue #2004) + **Enhancements:** * Removed the use of the 'pbr' package because it caused too many undesirable --- a/pywbem/mof_compiler.py +++ b/pywbem/mof_compiler.py @@ -2639,9 +2639,10 @@ def _yacc(verbose=False, out_dir=None): tabmodule=_tabmodule, outputdir=out_dir, write_tables=write_tables, - debug=True, + debug=verbose, debuglog=yacc.NullLogger(), - errorlog=yacc.PlyLogger(sys.stdout)) + errorlog=yacc.PlyLogger(sys.stdout) if verbose + else yacc.NullLogger()) def _lex(verbose=False, out_dir=None): @@ -2675,4 +2676,5 @@ def _lex(verbose=False, out_dir=None): outputdir=out_dir, debug=False, # debuglog = lex.PlyLogger(sys.stdout), - errorlog=lex.PlyLogger(sys.stdout)) + errorlog=yacc.PlyLogger(sys.stdout) if verbose + else yacc.NullLogger()) --- a/tests/unittest/pywbem/test_mof_compiler.py +++ b/tests/unittest/pywbem/test_mof_compiler.py @@ -77,7 +77,7 @@ class MOFTest(unittest.TestCase): self.mofcomp = MOFCompiler( MOFWBEMConnection(), search_paths=[TEST_DMTF_CIMSCHEMA_MOF_DIR], - verbose=True, + verbose=False, log_func=moflog) self.partial_schema_file = None @@ -621,7 +621,7 @@ class TestSchemaSearch(MOFTest): mofcomp = MOFCompiler( MOFWBEMConnection(), search_paths=TEST_DMTF_CIMSCHEMA_MOF_DIR, - verbose=True, + verbose=False, log_func=moflog) mofcomp.compile_file(os.path.join(TEST_DMTF_CIMSCHEMA_MOF_DIR, 'System', @@ -646,7 +646,7 @@ class TestSchemaSearch(MOFTest): open(moflog_file, 'w') mofcomp = MOFCompiler( MOFWBEMConnection(), - verbose=True, + verbose=False, log_func=moflog) try: mofcomp.compile_file(os.path.join(TEST_DMTF_CIMSCHEMA_MOF_DIR, @@ -2585,7 +2585,7 @@ class Test_CreateInstanceWithDups(unitte self.mofcomp = MOFCompiler( MOFWBEMConnectionInstDups(), search_paths=[TEST_DMTF_CIMSCHEMA_MOF_DIR], - verbose=True, + verbose=False, log_func=moflog) self.partial_schema_file = None --- a/tests/utils.py +++ b/tests/utils.py @@ -8,7 +8,7 @@ import sys import os from packaging import version import pytest -import ply +from ply import yacc, lex def skip_if_moftab_regenerated(): @@ -60,22 +60,22 @@ def skip_if_moftab_regenerated(): pywbem_not_tolerant = version.parse(pywbem.__version__) <= \ version.parse('0.14.4') # This causes 0.14.5.devN to be tolerant mofparsetab_mismatch = version.parse(mofparsetab._tabversion) != \ - version.parse(ply.__version__) + version.parse(yacc.__tabversion__) moflextab_mismatch = version.parse(moflextab._tabversion) != \ - version.parse(ply.__version__) + version.parse(lex.__tabversion__) if test_installed and pywbem_not_tolerant and \ (mofparsetab_mismatch or moflextab_mismatch): pytest.skip("Cannot run this MOF testcase against an installed " "pywbem (version {0}, installed at {1}) because that " - "pywbem version does not tolerate version mismatches " - "between the current ply version and the ply version that " - "was used to create the pywbem mof*tab files: " - "current ply: {2}, ply in mofparsetab.py: {3}, " - "ply in moflextab.py: {4}". + "pywbem version does not tolerate table version mismatches " + "between the current ply package and the generated pywbem " + "mof*tab files: yacc table version: current ply: {2}, " + "mofparsetab.py: {3}, lex table version: current ply: {4}, " + "moflextab.py: {5}". format(pywbem.__version__, pywbem.__file__, - ply.__version__, - mofparsetab._tabversion, moflextab._tabversion)) + yacc.__tabversion__, mofparsetab._tabversion, + lex.__tabversion__, moflextab._tabversion)) def import_installed(module_name): ++++++ unittest2-just-say-no.patch ++++++ --- a/tests/unittest/pywbem/test_mof_compiler.py +++ b/tests/unittest/pywbem/test_mof_compiler.py @@ -8,7 +8,7 @@ from __future__ import print_function, absolute_import import os -import unittest2 as unittest # we use assertRaises(exc) introduced in py27 +import unittest # we use assertRaises(exc) introduced in py27 import six from ply import lex try: --- a/tests/unittest/pywbem/test_recorder.py +++ b/tests/unittest/pywbem/test_recorder.py @@ -16,7 +16,7 @@ import logging import logging.handlers from io import open as _open -import unittest2 as unittest # we use @skip introduced in py27 +import unittest # we use @skip introduced in py27 import six from testfixtures import LogCapture, log_capture # Enabled only to display a tree of loggers
