forked from pool/python-fire
* Support for custom serializers with fire.Fire(serializer=your_serializer)
* Auto-generated help text now shows short arguments (e.g. -a) when
appropriate
* Default values are now shown in help for kwonly arguments
* Completion script fix where previously completions might not show at all
- Refresh python-fire-no-mock.patch
- Add patch support-python-311.patch:
* Support Python 3.11
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fire?expand=0&rev=23
82 lines
2.0 KiB
Diff
82 lines
2.0 KiB
Diff
Index: fire-0.5.0/fire/core_test.py
|
|
===================================================================
|
|
--- fire-0.5.0.orig/fire/core_test.py
|
|
+++ fire-0.5.0/fire/core_test.py
|
|
@@ -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.5.0/fire/fire_import_test.py
|
|
===================================================================
|
|
--- fire-0.5.0.orig/fire/fire_import_test.py
|
|
+++ fire-0.5.0/fire/fire_import_test.py
|
|
@@ -18,7 +18,10 @@ import sys
|
|
|
|
import fire
|
|
from fire import testutils
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
|
|
class FireImportTest(testutils.BaseTestCase):
|
|
Index: fire-0.5.0/fire/fire_test.py
|
|
===================================================================
|
|
--- fire-0.5.0.orig/fire/fire_test.py
|
|
+++ fire-0.5.0/fire/fire_test.py
|
|
@@ -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.5.0/fire/interact_test.py
|
|
===================================================================
|
|
--- fire-0.5.0.orig/fire/interact_test.py
|
|
+++ fire-0.5.0/fire/interact_test.py
|
|
@@ -21,7 +21,10 @@ from __future__ import print_function
|
|
from fire import interact
|
|
from fire import testutils
|
|
|
|
-import mock
|
|
+try:
|
|
+ from unittest import mock
|
|
+except ImportError:
|
|
+ import mock
|
|
|
|
|
|
try:
|
|
Index: fire-0.5.0/fire/testutils.py
|
|
===================================================================
|
|
--- fire-0.5.0.orig/fire/testutils.py
|
|
+++ fire-0.5.0/fire/testutils.py
|
|
@@ -27,7 +27,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
|
|
|
|
|