From 9b1979738f1c2e1f1e85e5ead25e4e86f5172d9e5e512ecd8c85f9c1aa364c3c Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 8 Apr 2022 20:46:03 +0000 Subject: [PATCH] Accepting request 967738 from home:pgajdos:python - do not require python-mock for build - added patches fix https://github.com/andrew-d/python-multipart/commit/8cff1aac7479fbb69087e355f66315b21640bab0 + python-python-multipart-no-mock.patch OBS-URL: https://build.opensuse.org/request/show/967738 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-multipart?expand=0&rev=4 --- python-python-multipart-no-mock.patch | 17 +++++++++++++++++ python-python-multipart.changes | 8 ++++++++ python-python-multipart.spec | 4 +++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 python-python-multipart-no-mock.patch diff --git a/python-python-multipart-no-mock.patch b/python-python-multipart-no-mock.patch new file mode 100644 index 0000000..4c13730 --- /dev/null +++ b/python-python-multipart-no-mock.patch @@ -0,0 +1,17 @@ +diff --git a/multipart/tests/test_multipart.py b/multipart/tests/test_multipart.py +index 5769905..7913cd2 100644 +--- a/multipart/tests/test_multipart.py ++++ b/multipart/tests/test_multipart.py +@@ -16,7 +16,10 @@ + from io import BytesIO + from six import binary_type, text_type + +-from mock import MagicMock, Mock, patch ++try: ++ from unittest.mock import MagicMock, Mock, patch ++except ImportError: ++ from mock import MagicMock, Mock, patch + + from ..multipart import * + + diff --git a/python-python-multipart.changes b/python-python-multipart.changes index 1c37b71..4701959 100644 --- a/python-python-multipart.changes +++ b/python-python-multipart.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Apr 8 09:51:38 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/andrew-d/python-multipart/commit/8cff1aac7479fbb69087e355f66315b21640bab0 + + python-python-multipart-no-mock.patch + ------------------------------------------------------------------- Fri Feb 4 00:43:33 UTC 2022 - Steve Kowalik diff --git a/python-python-multipart.spec b/python-python-multipart.spec index 737efc3..207e1e1 100644 --- a/python-python-multipart.spec +++ b/python-python-multipart.spec @@ -17,6 +17,7 @@ %{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 Name: python-python-multipart Version: 0.0.5 Release: 0 @@ -25,12 +26,13 @@ Summary: Python streaming multipart parser URL: http://github.com/andrew-d/python-multipart Source: https://files.pythonhosted.org/packages/source/p/python-multipart/python-multipart-%{version}.tar.gz Patch0: support-pyyaml-6.patch +# https://github.com/andrew-d/python-multipart/commit/8cff1aac7479fbb69087e355f66315b21640bab0 +Patch1: python-python-multipart-no-mock.patch BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module six >= 1.4.0} BuildRequires: %{python_module PyYAML} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} # /SECTION BuildRequires: fdupes