15
0
forked from pool/python-fire

Accepting request 962274 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/962274
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-fire?expand=0&rev=11
This commit is contained in:
2022-03-17 16:01:30 +00:00
committed by Git OBS Bridge
3 changed files with 95 additions and 2 deletions

83
python-fire-no-mock.patch Normal file
View File

@@ -0,0 +1,83 @@
Index: fire-0.4.0/fire/core_test.py
===================================================================
--- fire-0.4.0.orig/fire/core_test.py 2020-04-03 19:14:51.000000000 +0200
+++ fire-0.4.0/fire/core_test.py 2022-03-16 13:48:27.568077390 +0100
@@ -22,7 +22,11 @@ from fire import core
from fire import test_components as tc
from fire import testutils
from fire import trace
-import mock
+
+try:
+ import mock # python 2.x
+except ModuleNotFoundError:
+ from unittest import mock # python 3.x
import six
Index: fire-0.4.0/fire/fire_import_test.py
===================================================================
--- fire-0.4.0.orig/fire/fire_import_test.py 2022-03-16 13:48:27.568077390 +0100
+++ fire-0.4.0/fire/fire_import_test.py 2022-03-16 13:51:27.561140579 +0100
@@ -18,7 +18,11 @@ import sys
import fire
from fire import testutils
-import mock
+
+try:
+ import mock # python 2.x
+except ModuleNotFoundError:
+ from unittest import mock # python 3.x
class FireImportTest(testutils.BaseTestCase):
Index: fire-0.4.0/fire/fire_test.py
===================================================================
--- fire-0.4.0.orig/fire/fire_test.py 2020-12-17 01:20:39.000000000 +0100
+++ fire-0.4.0/fire/fire_test.py 2022-03-16 13:48:27.568077390 +0100
@@ -25,7 +25,10 @@ import fire
from fire import test_components as tc
from fire import testutils
-import mock
+try:
+ import mock # python 2.x
+except ModuleNotFoundError:
+ from unittest import mock # python 3.x
import six
Index: fire-0.4.0/fire/interact_test.py
===================================================================
--- fire-0.4.0.orig/fire/interact_test.py 2022-03-16 13:48:27.568077390 +0100
+++ fire-0.4.0/fire/interact_test.py 2022-03-16 13:50:36.080836493 +0100
@@ -21,8 +21,10 @@ from __future__ import print_function
from fire import interact
from fire import testutils
-import mock
-
+try:
+ import mock # python 2.x
+except ModuleNotFoundError:
+ from unittest import mock # python 3.x
try:
import IPython # pylint: disable=unused-import, g-import-not-at-top
Index: fire-0.4.0/fire/testutils.py
===================================================================
--- fire-0.4.0.orig/fire/testutils.py 2020-12-17 01:20:39.000000000 +0100
+++ fire-0.4.0/fire/testutils.py 2022-03-16 13:48:27.568077390 +0100
@@ -28,7 +28,10 @@ import unittest
from fire import core
from fire import trace
-import mock
+try:
+ import mock # python 2.x
+except ModuleNotFoundError:
+ from unittest import mock # python 3.x
import six

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 16 12:52:10 UTC 2022 - pgajdos@suse.com
- do not require python-mock for build
- added patches
fix https://github.com/google/python-fire/pull/265/files
+ python-fire-no-mock.patch
-------------------------------------------------------------------
Fri Mar 12 04:41:30 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-fire
#
# 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
@@ -17,6 +17,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-fire
Version: 0.4.0
Release: 0
@@ -24,6 +25,8 @@ Summary: A library for automatically generating command line interfaces
License: Apache-2.0
URL: https://github.com/google/python-fire
Source: https://files.pythonhosted.org/packages/source/f/fire/fire-%{version}.tar.gz
# https://github.com/google/python-fire/pull/265/files
Patch0: python-fire-no-mock.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -33,7 +36,6 @@ BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Levenshtein}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module six}
BuildRequires: %{python_module termcolor}