From e57aa6f37a8fd96ec1160a0b889c95ae3b937e734b909092729243e8a725d242 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 4 May 2022 10:19:06 +0000 Subject: [PATCH] Accepting request 974884 from home:pgajdos:python - do not require python-mock for build - added patches fix https://github.com/OpenKMIP/PyKMIP/issues/668 + python-PyKMIP-no-mock.patch OBS-URL: https://build.opensuse.org/request/show/974884 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyKMIP?expand=0&rev=12 --- python-PyKMIP-no-mock.patch | 158 ++++++++++++++++++++++++++++++++++++ python-PyKMIP.changes | 8 ++ python-PyKMIP.spec | 5 +- 3 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 python-PyKMIP-no-mock.patch diff --git a/python-PyKMIP-no-mock.patch b/python-PyKMIP-no-mock.patch new file mode 100644 index 0000000..9e2b66f --- /dev/null +++ b/python-PyKMIP-no-mock.patch @@ -0,0 +1,158 @@ +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/core/objects/test_credentials.py PyKMIP-0.10.0/kmip/tests/unit/core/objects/test_credentials.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/core/objects/test_credentials.py 2022-05-04 11:45:14.586835230 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/core/objects/test_credentials.py 2022-05-04 11:45:14.642835575 +0200 +@@ -14,7 +14,7 @@ + # under the License. + + import enum +-import mock ++from unittest import mock + import testtools + + from kmip import enums +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/core/test_config_helper.py PyKMIP-0.10.0/kmip/tests/unit/core/test_config_helper.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/core/test_config_helper.py 2022-05-04 11:45:14.586835230 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/core/test_config_helper.py 2022-05-04 11:45:14.622835452 +0200 +@@ -19,8 +19,8 @@ except ImportError: + import ConfigParser as configparser + + from testtools import TestCase +-from mock import MagicMock +-from mock import Mock ++from unittest.mock import MagicMock ++from unittest.mock import Mock + + from kmip.core.config_helper import ConfigHelper + +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/pie/test_client.py PyKMIP-0.10.0/kmip/tests/unit/pie/test_client.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/pie/test_client.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/pie/test_client.py 2022-05-04 11:45:14.614835402 +0200 +@@ -13,7 +13,7 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import mock ++from unittest import mock + import six + import ssl + import testtools +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/auth/test_slugs.py PyKMIP-0.10.0/kmip/tests/unit/services/server/auth/test_slugs.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/auth/test_slugs.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/auth/test_slugs.py 2022-05-04 11:45:14.618835427 +0200 +@@ -13,7 +13,7 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import mock ++from unittest import mock + import requests + import testtools + +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/auth/test_utils.py PyKMIP-0.10.0/kmip/tests/unit/services/server/auth/test_utils.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/auth/test_utils.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/auth/test_utils.py 2022-05-04 11:45:14.618835427 +0200 +@@ -19,7 +19,7 @@ from cryptography.hazmat.primitives impo + from cryptography.hazmat.primitives.asymmetric import rsa + + import datetime +-import mock ++from unittest import mock + import ssl + import testtools + +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/crypto/test_engine.py PyKMIP-0.10.0/kmip/tests/unit/services/server/crypto/test_engine.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/crypto/test_engine.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/crypto/test_engine.py 2022-05-04 11:45:14.618835427 +0200 +@@ -13,7 +13,7 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import mock ++from unittest import mock + import pytest + import testtools + +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_config.py PyKMIP-0.10.0/kmip/tests/unit/services/server/test_config.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_config.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/test_config.py 2022-05-04 11:45:14.618835427 +0200 +@@ -14,7 +14,7 @@ + # under the License. + + import logging +-import mock ++from unittest import mock + + import six + from six.moves import configparser +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_engine.py PyKMIP-0.10.0/kmip/tests/unit/services/server/test_engine.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_engine.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/test_engine.py 2022-05-04 11:45:14.622835452 +0200 +@@ -14,7 +14,7 @@ + # under the License. + + import six +-import mock ++from unittest import mock + import shutil + import sqlalchemy + +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_monitor.py PyKMIP-0.10.0/kmip/tests/unit/services/server/test_monitor.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_monitor.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/test_monitor.py 2022-05-04 11:45:14.618835427 +0200 +@@ -14,7 +14,7 @@ + # under the License. + + import logging +-import mock ++from unittest import mock + import multiprocessing + import os + import shutil +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_server.py PyKMIP-0.10.0/kmip/tests/unit/services/server/test_server.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_server.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/test_server.py 2022-05-04 11:45:14.618835427 +0200 +@@ -18,7 +18,7 @@ import logging + try: + import unittest.mock as mock + except Exception: +- import mock ++ from unittest import mock + + import signal + import socket +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_session.py PyKMIP-0.10.0/kmip/tests/unit/services/server/test_session.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/server/test_session.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/server/test_session.py 2022-05-04 11:45:14.618835427 +0200 +@@ -20,7 +20,7 @@ from cryptography.hazmat.primitives.asym + + + import datetime +-import mock ++from unittest import mock + import socket + import testtools + import time +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/test_kmip_client.py PyKMIP-0.10.0/kmip/tests/unit/services/test_kmip_client.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/test_kmip_client.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/test_kmip_client.py 2022-05-04 11:45:14.614835402 +0200 +@@ -66,7 +66,7 @@ from kmip.services.results import Operat + from kmip.services.results import QueryResult + from kmip.services.results import RekeyKeyPairResult + +-import mock ++from unittest import mock + import os + import socket + import ssl +diff -upr PyKMIP-0.10.0.orig/kmip/tests/unit/services/test_kmip_protocol.py PyKMIP-0.10.0/kmip/tests/unit/services/test_kmip_protocol.py +--- PyKMIP-0.10.0.orig/kmip/tests/unit/services/test_kmip_protocol.py 2022-05-04 11:45:14.582835205 +0200 ++++ PyKMIP-0.10.0/kmip/tests/unit/services/test_kmip_protocol.py 2022-05-04 11:45:14.614835402 +0200 +@@ -13,7 +13,7 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-from mock import call, MagicMock ++from unittest.mock import call, MagicMock + from testtools import TestCase + + import binascii diff --git a/python-PyKMIP.changes b/python-PyKMIP.changes index b245512..11d129b 100644 --- a/python-PyKMIP.changes +++ b/python-PyKMIP.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 4 09:55:17 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/OpenKMIP/PyKMIP/issues/668 + + python-PyKMIP-no-mock.patch + ------------------------------------------------------------------- Fri Sep 24 22:07:08 UTC 2021 - Matej Cepl diff --git a/python-PyKMIP.spec b/python-PyKMIP.spec index 6689603..fb00a1b 100644 --- a/python-PyKMIP.spec +++ b/python-PyKMIP.spec @@ -1,7 +1,7 @@ # # spec file for package python-PyKMIP # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,10 +29,11 @@ Source: https://files.pythonhosted.org/packages/source/P/PyKMIP/PyKMIP-% # PATCH-FIX-UPSTREAM fix-tests-SQLAlchemy-140.patch gh#OpenKMIP/PyKMIP#656 mcepl@suse.com # fix tests to work with SQLAlchemy >= 1.4.0 Patch0: fix-tests-SQLAlchemy-140.patch +# https://github.com/OpenKMIP/PyKMIP/issues/668 +Patch1: python-PyKMIP-no-mock.patch BuildRequires: %{python_module SQLAlchemy} BuildRequires: %{python_module cryptography} BuildRequires: %{python_module devel} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} BuildRequires: %{python_module setuptools}