From 16867574eec76d448f4f3d43bde52b0c261a05c468c4b25d5e4d4410c9351bd4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 4 May 2022 17:47:50 +0000 Subject: [PATCH] Accepting request 974912 from home:pgajdos:python - do not require python-mock for build - added patches fix https://github.com/pyinvoke/invocations/issues/31 + python-invocations-no-mock.patch OBS-URL: https://build.opensuse.org/request/show/974912 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invocations?expand=0&rev=23 --- python-invocations-no-mock.patch | 57 ++++++++++++++++++++++++++++++++ python-invocations.changes | 8 +++++ python-invocations.spec | 7 ++-- 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 python-invocations-no-mock.patch diff --git a/python-invocations-no-mock.patch b/python-invocations-no-mock.patch new file mode 100644 index 0000000..55ef858 --- /dev/null +++ b/python-invocations-no-mock.patch @@ -0,0 +1,57 @@ +diff -upr invocations-2.3.0.orig/tests/autodoc/base.py invocations-2.3.0/tests/autodoc/base.py +--- invocations-2.3.0.orig/tests/autodoc/base.py 2022-05-04 14:22:40.135321552 +0200 ++++ invocations-2.3.0/tests/autodoc/base.py 2022-05-04 14:22:40.143321605 +0200 +@@ -3,7 +3,7 @@ import codecs + import re + import shutil + +-from mock import Mock, patch ++from unittest.mock import Mock, patch + + from invoke import Context + from invocations.autodoc import setup, TaskDocumenter +diff -upr invocations-2.3.0.orig/tests/console.py invocations-2.3.0/tests/console.py +--- invocations-2.3.0.orig/tests/console.py 2022-05-04 14:22:40.135321552 +0200 ++++ invocations-2.3.0/tests/console.py 2022-05-04 14:22:40.143321605 +0200 +@@ -2,7 +2,7 @@ from __future__ import unicode_literals + + import sys + +-from mock import patch ++from unittest.mock import patch + from pytest_relaxed import trap + + from invocations.console import confirm +diff -upr invocations-2.3.0.orig/tests/environment.py invocations-2.3.0/tests/environment.py +--- invocations-2.3.0.orig/tests/environment.py 2022-05-04 14:22:40.135321552 +0200 ++++ invocations-2.3.0/tests/environment.py 2022-05-04 14:22:40.143321605 +0200 +@@ -1,4 +1,4 @@ +-from mock import patch ++from unittest.mock import patch + from pytest import mark + + from invocations.environment import in_ci +diff -upr invocations-2.3.0.orig/tests/packaging/release.py invocations-2.3.0/tests/packaging/release.py +--- invocations-2.3.0.orig/tests/packaging/release.py 2022-05-04 14:22:40.135321552 +0200 ++++ invocations-2.3.0/tests/packaging/release.py 2022-05-04 14:22:40.143321605 +0200 +@@ -13,7 +13,7 @@ except ImportError: + from lexicon import Lexicon + from invoke import MockContext, Result, Config, Exit + from docutils.utils import Reporter +-from mock import Mock, patch, call ++from unittest.mock import Mock, patch, call + import pytest + from pytest import skip + from pytest_relaxed import trap, raises +diff -upr invocations-2.3.0.orig/tests/pytest_.py invocations-2.3.0/tests/pytest_.py +--- invocations-2.3.0.orig/tests/pytest_.py 2022-05-04 14:22:40.135321552 +0200 ++++ invocations-2.3.0/tests/pytest_.py 2022-05-04 14:22:40.143321605 +0200 +@@ -2,7 +2,7 @@ from contextlib import contextmanager + + from invoke import MockContext + from invocations.pytest import test, coverage +-from mock import Mock, call ++from unittest.mock import Mock, call + + + @contextmanager diff --git a/python-invocations.changes b/python-invocations.changes index 398c980..e24752b 100644 --- a/python-invocations.changes +++ b/python-invocations.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 4 12:25:51 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/pyinvoke/invocations/issues/31 + + python-invocations-no-mock.patch + ------------------------------------------------------------------- Thu Mar 10 06:25:34 UTC 2022 - Steve Kowalik diff --git a/python-invocations.spec b/python-invocations.spec index df31738..17d2b14 100644 --- a/python-invocations.spec +++ b/python-invocations.spec @@ -27,10 +27,11 @@ URL: https://github.com/pyinvoke/invocations Source: https://github.com/pyinvoke/invocations/archive/%{version}.tar.gz#/invocations-%{version}.tar.gz Patch0: invocations-no-bundled.patch Patch1: invocations-py3.patch +# https://github.com/pyinvoke/invocations/issues/31 +Patch2: python-invocations-no-mock.patch BuildRequires: %{python_module blessings >= 1.6} BuildRequires: %{python_module invoke >= 1.6} BuildRequires: %{python_module lexicon} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest-relaxed} BuildRequires: %{python_module releases >= 1.2} BuildRequires: %{python_module semantic_version >= 2.4} @@ -73,9 +74,7 @@ Invocations is currently in pre-alpha status and is unsupported. Please follow the Invoke project's communication channels for updates. Thanks! %prep -%setup -q -n invocations-%{version} -%patch0 -p1 -%patch1 -p1 +%autosetup -p1 -n invocations-%{version} %build %python_build