From 83b558bd2a8af262f7f54cfff1f9b19e21320a0495ce3a43df7f934263f124e4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 11 May 2023 12:17:11 +0000 Subject: [PATCH] =?UTF-8?q?-=20Update=20to=202.1.0:=20=20=20-=20[Bug]=20#9?= =?UTF-8?q?10:=20Add=20more=20rigor=20around=20subprocess/runner=20shutdow?= =?UTF-8?q?n=20=20=20=20=20to=20avoid=20spurious=20exceptions=20&=20also?= =?UTF-8?q?=20fix=20downstream=20issues=20in=20=20=20=20=20libraries=20lik?= =?UTF-8?q?e=20Fabric.=20Reported=20by=20Orlando=20Rodr=C3=ADguez.=20=20?= =?UTF-8?q?=20-=20[Bug]=20#934:=20The=20importlib=20upgrade=20in=202.1=20h?= =?UTF-8?q?ad=20a=20corner=20case=20=20=20=20=20bug=20(regarding=20from=20?= =?UTF-8?q?.=20import=20=20functionality=20within=20=20=20=20?= =?UTF-8?q?=20package-like=20task=20trees)=20which=20in=20turn=20exposed?= =?UTF-8?q?=20a=20false-pass=20=20=20=20=20in=20our=20test=20suite.=20Both?= =?UTF-8?q?=20have=20now=20been=20fixed.=20Thanks=20to=20Greg=20=20=20=20?= =?UTF-8?q?=20Meyer=20and=20Robert=20J.=20Berger=20for=20the=20bug=20repor?= =?UTF-8?q?ts.=20=20=20-=20[Bug]=20#910:=20Add=20more=20rigor=20around=20s?= =?UTF-8?q?ubprocess/runner=20shutdown=20=20=20=20=20to=20avoid=20spurious?= =?UTF-8?q?=20exceptions=20&=20also=20fix=20downstream=20issues=20in=20=20?= =?UTF-8?q?=20=20=20libraries=20like=20Fabric.=20Reported=20by=20Orlando?= =?UTF-8?q?=20Rodr=C3=ADguez.=20=20=20-=20[Support]=20#901:=20(via=20#903)?= =?UTF-8?q?=20Tweak=20test=20suite=20setup=20methods=20to=20=20=20=20=20be?= =?UTF-8?q?=20named=20setup=5Fmethod=20so=20pytest=20stops=20whining=20abo?= =?UTF-8?q?ut=20it.=20Patch=20=20=20=20=20via=20Jesse=20P.=20Johnson.=20?= =?UTF-8?q?=20=20-=20[Bug]=20#376:=20Resolve=20equality=20comparison=20bug?= =?UTF-8?q?=20for=20=20=20=20=20non-collections.=20Patch=20via=20Jesse=20P?= =?UTF-8?q?.=20Johnson=20=20=20-=20[Support]=20#901:=20(via=20#903)=20Twea?= =?UTF-8?q?k=20test=20suite=20setup=20methods=20to=20=20=20=20=20be=20name?= =?UTF-8?q?d=20setup=5Fmethod=20so=20pytest=20stops=20whining=20about=20it?= =?UTF-8?q?.=20Patch=20=20=20=20=20via=20Jesse=20P.=20Johnson.=20=20=20-?= =?UTF-8?q?=20[Support]=20#906:=20Implement=20type=20hints=20and=20type=20?= =?UTF-8?q?checking=20=20=20=20=20tests=20with=20mypy=20to=20reduce=20erro?= =?UTF-8?q?rs=20and=20impove=20code=20=20=20=20=20documentation.=20Patches?= =?UTF-8?q?=20by=20Jesse=20P.=20Johnson=20and=20review=20by=20Sam=20=20=20?= =?UTF-8?q?=20=20Bull.=20=20=20-=20[Support]=20#675:=20Implement=20importl?= =?UTF-8?q?ib=20and=20deprecate=20imp=20=20=20=20=20module.=20Patches=20pr?= =?UTF-8?q?ovided=20by=20Jesse=20P.=20Johnson=20=20=20-=20[Support]:=20Tas?= =?UTF-8?q?k.argspec=20has=20changed=20its=20return=20value;=20it=20now=20?= =?UTF-8?q?=20=20=20=20returns=20an=20inspect.Signature=20derived=20from?= =?UTF-8?q?=20that=20of=20the=20task=E2=80=99s=20=20=20=20=20body=20callab?= =?UTF-8?q?le.=20=20=20-=20Warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invoke?expand=0&rev=37 --- ...ck-to-system-modules-when-vendorized.patch | 92 ------------------- invoke-1.7.3.tar.gz | 3 - invoke-2.1.0.tar.gz | 3 + pytest4.patch | 42 --------- python-invoke.changes | 62 +++++++++++++ python-invoke.spec | 50 +++++----- remove-icecream.patch | 45 +++++++++ 7 files changed, 136 insertions(+), 161 deletions(-) delete mode 100644 0001-Make-test-fallback-to-system-modules-when-vendorized.patch delete mode 100644 invoke-1.7.3.tar.gz create mode 100644 invoke-2.1.0.tar.gz delete mode 100644 pytest4.patch create mode 100644 remove-icecream.patch diff --git a/0001-Make-test-fallback-to-system-modules-when-vendorized.patch b/0001-Make-test-fallback-to-system-modules-when-vendorized.patch deleted file mode 100644 index 124a683..0000000 --- a/0001-Make-test-fallback-to-system-modules-when-vendorized.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 4cd025415f0ef2c1d72bf4832051971c1e7eef8b Mon Sep 17 00:00:00 2001 -From: Athmane Madjoudj -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 - diff --git a/invoke-1.7.3.tar.gz b/invoke-1.7.3.tar.gz deleted file mode 100644 index e5b1bff..0000000 --- a/invoke-1.7.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41b428342d466a82135d5ab37119685a989713742be46e42a3a399d685579314 -size 374306 diff --git a/invoke-2.1.0.tar.gz b/invoke-2.1.0.tar.gz new file mode 100644 index 0000000..ad194f6 --- /dev/null +++ b/invoke-2.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:277894c57fa2b77f22ed3c7726fb8689773301e4497ccb2a59f19bc7bbbe5b4a +size 296954 diff --git a/pytest4.patch b/pytest4.patch deleted file mode 100644 index 2beb39d..0000000 --- a/pytest4.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 84f296062a48d30a6c1497e523c21ef3fd9ab534 Mon Sep 17 00:00:00 2001 -From: Marcus Crane -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)) diff --git a/python-invoke.changes b/python-invoke.changes index a6c06cf..d8bf6c5 100644 --- a/python-invoke.changes +++ b/python-invoke.changes @@ -1,3 +1,65 @@ +------------------------------------------------------------------- +Thu May 11 06:22:55 UTC 2023 - Matej Cepl + +- 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 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 diff --git a/python-invoke.spec b/python-invoke.spec index c040817..e9b40c0 100644 --- a/python-invoke.spec +++ b/python-invoke.spec @@ -17,41 +17,33 @@ # 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} Name: python-invoke -Version: 1.7.3 +Version: 2.1.0 Release: 0 Summary: Pythonic Task Execution License: BSD-2-Clause Group: Development/Languages/Python URL: https://www.pyinvoke.org Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz -Patch0: 0001-Make-test-fallback-to-system-modules-when-vendorized.patch -Patch1: pytest4.patch -BuildRequires: %{python_module setuptools} +# PATCH-FIX-OPENSUSE remove-icecream.patch mcepl@suse.com +# We don’t need icecream as yet another complication. +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: python-rpm-macros -Requires: python-PyYAML -Requires: python-fluidity-sm -Requires: python-lexicon -Requires: python-pexpect -Requires: python-six Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch %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 six} +BuildRequires: %{python_module pytest} +BuildRequires: zsh %endif %python_subpackages @@ -65,10 +57,10 @@ inspiration from various sources to arrive at a powerful & clean feature set. rm -fr invoke/vendor/* %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/inv @@ -76,7 +68,17 @@ rm -fr invoke/vendor/* %if %{with test} %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 %post @@ -90,7 +92,7 @@ rm -fr invoke/vendor/* %doc README.rst %python_alternative %{_bindir}/inv %python_alternative %{_bindir}/invoke -%{python_sitelib}/invoke/ -%{python_sitelib}/invoke-%{version}-py* +%{python_sitelib}/invoke +%{python_sitelib}/invoke-%{version}*-info %changelog diff --git a/remove-icecream.patch b/remove-icecream.patch new file mode 100644 index 0000000..938f935 --- /dev/null +++ b/remove-icecream.patch @@ -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!)