- Update to 2.1.0:
- [Bug] #910: Add more rigor around subprocess/runner shutdown to avoid spurious exceptions & also fix downstream issues in libraries like Fabric. Reported by Orlando Rodríguez. - [Bug] #934: The importlib upgrade in 2.1 had a corner case bug (regarding from . import <submodule> functionality within package-like task trees) which in turn exposed a false-pass in our test suite. Both have now been fixed. Thanks to Greg Meyer and Robert J. Berger for the bug reports. - [Bug] #910: Add more rigor around subprocess/runner shutdown to avoid spurious exceptions & also fix downstream issues in libraries like Fabric. Reported by Orlando Rodríguez. - [Support] #901: (via #903) Tweak test suite setup methods to be named setup_method so pytest stops whining about it. Patch via Jesse P. Johnson. - [Bug] #376: Resolve equality comparison bug for non-collections. Patch via Jesse P. Johnson - [Support] #901: (via #903) Tweak test suite setup methods to be named setup_method so pytest stops whining about it. Patch via Jesse P. Johnson. - [Support] #906: Implement type hints and type checking tests with mypy to reduce errors and impove code documentation. Patches by Jesse P. Johnson and review by Sam Bull. - [Support] #675: Implement importlib and deprecate imp module. Patches provided by Jesse P. Johnson - [Support]: Task.argspec has changed its return value; it now returns an inspect.Signature derived from that of the task’s body callable. - Warning OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invoke?expand=0&rev=37
This commit is contained in:
parent
0bce10276a
commit
83b558bd2a
@ -1,92 +0,0 @@
|
|||||||
From 4cd025415f0ef2c1d72bf4832051971c1e7eef8b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Athmane Madjoudj <athmane@fedoraproject.org>
|
|
||||||
Date: Fri, 11 May 2018 19:47:18 +0100
|
|
||||||
Subject: [PATCH] Make test fallback to system modules when vendorized one are
|
|
||||||
not available
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/_util.py | 5 ++++-
|
|
||||||
tests/concurrency.py | 5 ++++-
|
|
||||||
tests/conftest.py | 6 +++++-
|
|
||||||
tests/executor.py | 5 ++++-
|
|
||||||
tests/runners.py | 5 ++++-
|
|
||||||
tests/watchers.py | 5 ++++-
|
|
||||||
6 files changed, 25 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
Index: invoke-1.7.0/tests/_util.py
|
|
||||||
===================================================================
|
|
||||||
--- invoke-1.7.0.orig/tests/_util.py
|
|
||||||
+++ invoke-1.7.0/tests/_util.py
|
|
||||||
@@ -8,7 +8,10 @@ except ImportError:
|
|
||||||
termios = None
|
|
||||||
from contextlib import contextmanager
|
|
||||||
|
|
||||||
-from invoke.vendor.six import BytesIO, b, wraps
|
|
||||||
+try:
|
|
||||||
+ from invoke.vendor.six import BytesIO, b, wraps
|
|
||||||
+except ImportError:
|
|
||||||
+ from six import BytesIO, b, wraps
|
|
||||||
|
|
||||||
from mock import patch, Mock
|
|
||||||
from pytest import skip
|
|
||||||
Index: invoke-1.7.0/tests/concurrency.py
|
|
||||||
===================================================================
|
|
||||||
--- invoke-1.7.0.orig/tests/concurrency.py
|
|
||||||
+++ invoke-1.7.0/tests/concurrency.py
|
|
||||||
@@ -1,4 +1,7 @@
|
|
||||||
-from invoke.vendor.six.moves.queue import Queue
|
|
||||||
+try:
|
|
||||||
+ from invoke.vendor.six.moves.queue import Queue
|
|
||||||
+except ImportError:
|
|
||||||
+ from six.moves.queue import Queue
|
|
||||||
|
|
||||||
from invoke.util import ExceptionWrapper, ExceptionHandlingThread as EHThread
|
|
||||||
|
|
||||||
Index: invoke-1.7.0/tests/conftest.py
|
|
||||||
===================================================================
|
|
||||||
--- invoke-1.7.0.orig/tests/conftest.py
|
|
||||||
+++ invoke-1.7.0/tests/conftest.py
|
|
||||||
@@ -3,7 +3,11 @@ import os
|
|
||||||
import sys
|
|
||||||
import termios
|
|
||||||
|
|
||||||
-from invoke.vendor.six import iteritems
|
|
||||||
+try:
|
|
||||||
+ from invoke.vendor.six import iteritems
|
|
||||||
+except ImportError:
|
|
||||||
+ from six import iteritems
|
|
||||||
+
|
|
||||||
import pytest
|
|
||||||
from mock import patch
|
|
||||||
|
|
||||||
Index: invoke-1.7.0/tests/runners.py
|
|
||||||
===================================================================
|
|
||||||
--- invoke-1.7.0.orig/tests/runners.py
|
|
||||||
+++ invoke-1.7.0/tests/runners.py
|
|
||||||
@@ -9,7 +9,10 @@ import types
|
|
||||||
from io import BytesIO
|
|
||||||
from itertools import chain, repeat
|
|
||||||
|
|
||||||
-from invoke.vendor.six import StringIO, b, PY2, iteritems
|
|
||||||
+try:
|
|
||||||
+ from invoke.vendor.six import StringIO, b, PY2, iteritems
|
|
||||||
+except ImportError:
|
|
||||||
+ from six import StringIO, b, PY2, iteritems
|
|
||||||
|
|
||||||
from pytest import raises, skip
|
|
||||||
from pytest_relaxed import trap
|
|
||||||
Index: invoke-1.7.0/tests/watchers.py
|
|
||||||
===================================================================
|
|
||||||
--- invoke-1.7.0.orig/tests/watchers.py
|
|
||||||
+++ invoke-1.7.0/tests/watchers.py
|
|
||||||
@@ -1,6 +1,9 @@
|
|
||||||
from threading import Thread, Event
|
|
||||||
|
|
||||||
-from invoke.vendor.six.moves.queue import Queue, Empty
|
|
||||||
+try:
|
|
||||||
+ from invoke.vendor.six.moves.queue import Queue, Empty
|
|
||||||
+except:
|
|
||||||
+ from six.moves.queue import Queue, Empty
|
|
||||||
|
|
||||||
from invoke import Responder, FailingResponder, ResponseNotAccepted
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:41b428342d466a82135d5ab37119685a989713742be46e42a3a399d685579314
|
|
||||||
size 374306
|
|
3
invoke-2.1.0.tar.gz
Normal file
3
invoke-2.1.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:277894c57fa2b77f22ed3c7726fb8689773301e4497ccb2a59f19bc7bbbe5b4a
|
||||||
|
size 296954
|
@ -1,42 +0,0 @@
|
|||||||
From 84f296062a48d30a6c1497e523c21ef3fd9ab534 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marcus Crane <marcus@utf9k.net>
|
|
||||||
Date: Fri, 26 Oct 2018 10:52:19 +1300
|
|
||||||
Subject: [PATCH 1/3] Updated inspect method
|
|
||||||
|
|
||||||
---
|
|
||||||
invoke/tasks.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
Index: invoke-1.3.0/invoke/tasks.py
|
|
||||||
===================================================================
|
|
||||||
--- invoke-1.3.0.orig/invoke/tasks.py
|
|
||||||
+++ invoke-1.3.0/invoke/tasks.py
|
|
||||||
@@ -4,7 +4,6 @@ generate new tasks.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from copy import deepcopy
|
|
||||||
-import inspect
|
|
||||||
import types
|
|
||||||
|
|
||||||
from .context import Context
|
|
||||||
@@ -16,6 +15,11 @@ if six.PY3:
|
|
||||||
else:
|
|
||||||
from itertools import izip_longest as zip_longest
|
|
||||||
|
|
||||||
+try:
|
|
||||||
+ from inspect import getfullargspec as getargspec
|
|
||||||
+except ImportError:
|
|
||||||
+ from inspect import getargspec
|
|
||||||
+
|
|
||||||
|
|
||||||
#: Sentinel object representing a truly blank value (vs ``None``).
|
|
||||||
NO_DEFAULT = object()
|
|
||||||
@@ -150,7 +154,7 @@ class Task(object):
|
|
||||||
# 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 = getargspec(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))
|
|
@ -1,3 +1,65 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 11 06:22:55 UTC 2023 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Update to 2.1.0:
|
||||||
|
- [Bug] #910: Add more rigor around subprocess/runner shutdown
|
||||||
|
to avoid spurious exceptions & also fix downstream issues in
|
||||||
|
libraries like Fabric. Reported by Orlando Rodríguez.
|
||||||
|
- [Bug] #934: The importlib upgrade in 2.1 had a corner case
|
||||||
|
bug (regarding from . import <submodule> functionality within
|
||||||
|
package-like task trees) which in turn exposed a false-pass
|
||||||
|
in our test suite. Both have now been fixed. Thanks to Greg
|
||||||
|
Meyer and Robert J. Berger for the bug reports.
|
||||||
|
- [Bug] #910: Add more rigor around subprocess/runner shutdown
|
||||||
|
to avoid spurious exceptions & also fix downstream issues in
|
||||||
|
libraries like Fabric. Reported by Orlando Rodríguez.
|
||||||
|
- [Support] #901: (via #903) Tweak test suite setup methods to
|
||||||
|
be named setup_method so pytest stops whining about it. Patch
|
||||||
|
via Jesse P. Johnson.
|
||||||
|
- [Bug] #376: Resolve equality comparison bug for
|
||||||
|
non-collections. Patch via Jesse P. Johnson
|
||||||
|
- [Support] #901: (via #903) Tweak test suite setup methods to
|
||||||
|
be named setup_method so pytest stops whining about it. Patch
|
||||||
|
via Jesse P. Johnson.
|
||||||
|
- [Support] #906: Implement type hints and type checking
|
||||||
|
tests with mypy to reduce errors and impove code
|
||||||
|
documentation. Patches by Jesse P. Johnson and review by Sam
|
||||||
|
Bull.
|
||||||
|
- [Support] #675: Implement importlib and deprecate imp
|
||||||
|
module. Patches provided by Jesse P. Johnson
|
||||||
|
- [Support]: Task.argspec has changed its return value; it now
|
||||||
|
returns an inspect.Signature derived from that of the task’s
|
||||||
|
body callable.
|
||||||
|
- Warning
|
||||||
|
This change is backwards incompatible if you were using this
|
||||||
|
method directly.
|
||||||
|
[Support]: Remove support for, and imports related to,
|
||||||
|
all Python versions less than 3.6 - including Python
|
||||||
|
2. This also includes updates to vendored packages, such
|
||||||
|
as removing six and upgrading lexicon to the latest
|
||||||
|
version; and also treatment of things like Mock use within
|
||||||
|
invoke.context.MockContext (which now expects stdlib’s
|
||||||
|
unittest.mock instead of hunting for the old standalone mock
|
||||||
|
library).
|
||||||
|
This change is backwards incompatible in the following scenarios:
|
||||||
|
- You use Python <3.6. Shouldn’t be an issue as we now
|
||||||
|
specify python_requires in packaging metadata.
|
||||||
|
- You call invoke.util.encode_output manually for some
|
||||||
|
reason. (This became a noop under Python 3, so just…remove
|
||||||
|
it!)
|
||||||
|
- You use invoke.context.MockContext; its repeat init kwarg
|
||||||
|
changed its default value from False to True. This probably
|
||||||
|
won’t bite you, but we mention it just in case you somehow
|
||||||
|
relied upon the legacy behavior.
|
||||||
|
- You subclass invoke.runners.Runner and/or have had to
|
||||||
|
interact with its stop or stop_timer methods. The latter
|
||||||
|
has been merged into the former, and if you are overriding
|
||||||
|
stop, you’ll want to make sure you now call super()
|
||||||
|
somewhere if you were not already.
|
||||||
|
- Add remove-icecream.patch to remove unnecessary dependence on
|
||||||
|
icecream module.
|
||||||
|
- Skip temporarily failing tests (gh#pyinvoke/invoke#705).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:27:03 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:27:03 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -17,41 +17,33 @@
|
|||||||
|
|
||||||
|
|
||||||
# broken with pytest-relaxed (same author -- all of this is unmaintained)
|
# broken with pytest-relaxed (same author -- all of this is unmaintained)
|
||||||
%bcond_with test
|
%bcond_without test
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-invoke
|
Name: python-invoke
|
||||||
Version: 1.7.3
|
Version: 2.1.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Pythonic Task Execution
|
Summary: Pythonic Task Execution
|
||||||
License: BSD-2-Clause
|
License: BSD-2-Clause
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://www.pyinvoke.org
|
URL: https://www.pyinvoke.org
|
||||||
Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz
|
||||||
Patch0: 0001-Make-test-fallback-to-system-modules-when-vendorized.patch
|
# PATCH-FIX-OPENSUSE remove-icecream.patch mcepl@suse.com
|
||||||
Patch1: pytest4.patch
|
# We don’t need icecream as yet another complication.
|
||||||
BuildRequires: %{python_module setuptools}
|
Patch0: remove-icecream.patch
|
||||||
|
BuildRequires: %{python_module invocations >= 3.0.1}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module setuptools > 56}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-PyYAML
|
|
||||||
Requires: python-fluidity-sm
|
|
||||||
Requires: python-lexicon
|
|
||||||
Requires: python-pexpect
|
|
||||||
Requires: python-six
|
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun):update-alternatives
|
Requires(postun):update-alternatives
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
BuildRequires: %{python_module PyYAML}
|
|
||||||
BuildRequires: %{python_module fluidity-sm}
|
|
||||||
BuildRequires: %{python_module lexicon}
|
|
||||||
BuildRequires: %{python_module pexpect}
|
|
||||||
# pytest < 6.1 to resolve pytest-relaxed constraint
|
|
||||||
# https://github.com/bitprophet/pytest-relaxed/issues/12
|
|
||||||
BuildRequires: %{python_module pytest < 6.1}
|
|
||||||
BuildRequires: %{python_module pytest-relaxed}
|
BuildRequires: %{python_module pytest-relaxed}
|
||||||
BuildRequires: %{python_module six}
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: zsh
|
||||||
%endif
|
%endif
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@ -65,10 +57,10 @@ inspiration from various sources to arrive at a powerful & clean feature set.
|
|||||||
rm -fr invoke/vendor/*
|
rm -fr invoke/vendor/*
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%python_clone -a %{buildroot}%{_bindir}/inv
|
%python_clone -a %{buildroot}%{_bindir}/inv
|
||||||
@ -76,7 +68,17 @@ rm -fr invoke/vendor/*
|
|||||||
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
%check
|
%check
|
||||||
%pytest -s
|
# gh#pyinvoke/invoke#705
|
||||||
|
skiptests="setcbreak_called_on_tty_stdins or setcbreak_not_called_if_process_not_foregrounded"
|
||||||
|
skiptests+=" or tty_stdins_have_settings_restored_by_default or tty_stdins_have_settings_restored_on_KeyboardInterrupt"
|
||||||
|
skiptests+=" or when_pty_True_we_use_pty_fork_and_os_exec or pty_uses_WEXITSTATUS_if_WIFEXITED"
|
||||||
|
skiptests+=" or pty_uses_WTERMSIG_if_WIFSIGNALED or WTERMSIG_result_turned_negative_to_match_subprocess"
|
||||||
|
skiptests+=" or pty_is_set_to_controlling_terminal_size or spurious_OSErrors_handled_gracefully"
|
||||||
|
skiptests+=" or other_spurious_OSErrors_handled_gracefully or non_spurious_OSErrors_bubble_up"
|
||||||
|
skiptests+=" or can_be_overridden_by_kwarg or can_be_overridden_by_config"
|
||||||
|
skiptests+=" or overridden_fallback_affects_result_pty_value or defaults_to_bash_or_cmdexe_when_pty_True"
|
||||||
|
skiptests+=" or may_be_overridden_when_pty_True or uses_execve_for_pty_True or stop_mutes_errors_on_pty_close"
|
||||||
|
%pytest -s -k "not ($skiptests)" tests
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -90,7 +92,7 @@ rm -fr invoke/vendor/*
|
|||||||
%doc README.rst
|
%doc README.rst
|
||||||
%python_alternative %{_bindir}/inv
|
%python_alternative %{_bindir}/inv
|
||||||
%python_alternative %{_bindir}/invoke
|
%python_alternative %{_bindir}/invoke
|
||||||
%{python_sitelib}/invoke/
|
%{python_sitelib}/invoke
|
||||||
%{python_sitelib}/invoke-%{version}-py*
|
%{python_sitelib}/invoke-%{version}*-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
45
remove-icecream.patch
Normal file
45
remove-icecream.patch
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
dev-requirements.txt | 2 --
|
||||||
|
pyproject.toml | 4 ----
|
||||||
|
tests/conftest.py | 6 ------
|
||||||
|
3 files changed, 12 deletions(-)
|
||||||
|
|
||||||
|
--- a/dev-requirements.txt
|
||||||
|
+++ b/dev-requirements.txt
|
||||||
|
@@ -16,8 +16,6 @@ flake8>=4,<5
|
||||||
|
black>=22.8,<22.9
|
||||||
|
# Packaging
|
||||||
|
setuptools>56
|
||||||
|
-# Debuggery
|
||||||
|
-icecream>=2.1
|
||||||
|
# typing
|
||||||
|
mypy==0.971
|
||||||
|
types-PyYAML==6.0.12.4
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -40,10 +40,6 @@ module = "alabaster"
|
||||||
|
ignore_missing_imports = true
|
||||||
|
|
||||||
|
[[tool.mypy.overrides]]
|
||||||
|
-module = "icecream"
|
||||||
|
-ignore_missing_imports = true
|
||||||
|
-
|
||||||
|
-[[tool.mypy.overrides]]
|
||||||
|
module = "invocations"
|
||||||
|
ignore_missing_imports = true
|
||||||
|
|
||||||
|
--- a/tests/conftest.py
|
||||||
|
+++ b/tests/conftest.py
|
||||||
|
@@ -8,12 +8,6 @@ from unittest.mock import patch
|
||||||
|
|
||||||
|
from _util import support
|
||||||
|
|
||||||
|
-# Set up icecream globally for convenience.
|
||||||
|
-from icecream import install
|
||||||
|
-
|
||||||
|
-install()
|
||||||
|
-
|
||||||
|
-
|
||||||
|
# pytest seems to tweak logging such that Invoke's debug logs go to stderr,
|
||||||
|
# which is then hella spammy if one is using --capture=no (which one must in
|
||||||
|
# order to test low level terminal IO stuff, as we do!)
|
Loading…
x
Reference in New Issue
Block a user