Accepting request 731477 from devel:languages:python
- Update patch pytest4.patch to make it really work with new pytests OBS-URL: https://build.opensuse.org/request/show/731477 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-invoke?expand=0&rev=9
This commit is contained in:
commit
ec854182c9
@ -7,34 +7,11 @@ Subject: [PATCH 1/3] Updated inspect method
|
|||||||
invoke/tasks.py | 2 +-
|
invoke/tasks.py | 2 +-
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/invoke/tasks.py b/invoke/tasks.py
|
Index: invoke-1.3.0/invoke/tasks.py
|
||||||
index ed838c31..18cf0afd 100644
|
===================================================================
|
||||||
--- a/invoke/tasks.py
|
--- invoke-1.3.0.orig/invoke/tasks.py
|
||||||
+++ b/invoke/tasks.py
|
+++ invoke-1.3.0/invoke/tasks.py
|
||||||
@@ -151,7 +151,7 @@ def argspec(self, body):
|
@@ -4,7 +4,6 @@ generate new tasks.
|
||||||
# TODO: __call__ exhibits the 'self' arg; do we manually nix 1st result
|
|
||||||
# in argspec, or is there a way to get the "really callable" spec?
|
|
||||||
func = body if isinstance(body, types.FunctionType) else body.__call__
|
|
||||||
- spec = inspect.getargspec(func)
|
|
||||||
+ spec = inspect.getfullargspec(func)
|
|
||||||
arg_names = spec.args[:]
|
|
||||||
matched_args = [reversed(x) for x in [spec.args, spec.defaults or []]]
|
|
||||||
spec_dict = dict(zip_longest(*matched_args, fillvalue=NO_DEFAULT))
|
|
||||||
|
|
||||||
From db6596d63c76239a91a898ee1557084456e480f7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marcus Crane <marcus@utf9k.net>
|
|
||||||
Date: Fri, 26 Oct 2018 11:49:41 +1300
|
|
||||||
Subject: [PATCH 2/3] Update inspect import to be conditional based on 2.7 or 3
|
|
||||||
|
|
||||||
---
|
|
||||||
invoke/tasks.py | 8 ++++++--
|
|
||||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/invoke/tasks.py b/invoke/tasks.py
|
|
||||||
index 18cf0afd..cbe106b9 100644
|
|
||||||
--- a/invoke/tasks.py
|
|
||||||
+++ b/invoke/tasks.py
|
|
||||||
@@ -4,7 +4,6 @@
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
@ -42,48 +19,24 @@ index 18cf0afd..cbe106b9 100644
|
|||||||
import types
|
import types
|
||||||
|
|
||||||
from .context import Context
|
from .context import Context
|
||||||
@@ -15,6 +15,11 @@ if six.PY3:
|
@@ -16,6 +15,11 @@ if six.PY3:
|
||||||
else:
|
else:
|
||||||
from itertools import izip_longest as zip_longest
|
from itertools import izip_longest as zip_longest
|
||||||
|
|
||||||
+try:
|
+try:
|
||||||
+ from inspect import getfullargspec as getargspec
|
+ from inspect import getfullargspec as getargspec
|
||||||
+except AttributeError:
|
+except ImportError:
|
||||||
+ from inspect import getargspec
|
+ from inspect import getargspec
|
||||||
+
|
+
|
||||||
|
|
||||||
#: Sentinel object representing a truly blank value (vs ``None``).
|
#: Sentinel object representing a truly blank value (vs ``None``).
|
||||||
NO_DEFAULT = object()
|
NO_DEFAULT = object()
|
||||||
|
@@ -150,7 +154,7 @@ class Task(object):
|
||||||
@@ -151,7 +155,7 @@ def argspec(self, body):
|
|
||||||
# TODO: __call__ exhibits the 'self' arg; do we manually nix 1st result
|
# TODO: __call__ exhibits the 'self' arg; do we manually nix 1st result
|
||||||
# in argspec, or is there a way to get the "really callable" spec?
|
# in argspec, or is there a way to get the "really callable" spec?
|
||||||
func = body if isinstance(body, types.FunctionType) else body.__call__
|
func = body if isinstance(body, types.FunctionType) else body.__call__
|
||||||
- spec = inspect.getfullargspec(func)
|
- spec = inspect.getargspec(func)
|
||||||
+ spec = getargspec(func)
|
+ spec = getargspec(func)
|
||||||
arg_names = spec.args[:]
|
arg_names = spec.args[:]
|
||||||
matched_args = [reversed(x) for x in [spec.args, spec.defaults or []]]
|
matched_args = [reversed(x) for x in [spec.args, spec.defaults or []]]
|
||||||
spec_dict = dict(zip_longest(*matched_args, fillvalue=NO_DEFAULT))
|
spec_dict = dict(zip_longest(*matched_args, fillvalue=NO_DEFAULT))
|
||||||
|
|
||||||
From de3f339f4d699c0a641074ad437802307d0050ba Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marcus Crane <marcus@utf9k.net>
|
|
||||||
Date: Fri, 26 Oct 2018 12:10:43 +1300
|
|
||||||
Subject: [PATCH 3/3] Ooops, checked AttributeError instead of ImportError
|
|
||||||
|
|
||||||
---
|
|
||||||
invoke/tasks.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/invoke/tasks.py b/invoke/tasks.py
|
|
||||||
index cbe106b9..ad08c893 100644
|
|
||||||
--- a/invoke/tasks.py
|
|
||||||
+++ b/invoke/tasks.py
|
|
||||||
@@ -15,7 +15,7 @@
|
|
||||||
|
|
||||||
try:
|
|
||||||
from inspect import getfullargspec as getargspec
|
|
||||||
-except AttributeError:
|
|
||||||
+except ImportError:
|
|
||||||
from inspect import getargspec
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 17 10:08:41 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Update patch pytest4.patch to make it really work with new pytests
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Aug 12 11:36:59 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>
|
Mon Aug 12 11:36:59 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user