From 2dcf9ec0219555874e1218b26090d439003f9f5dc06f3d966339e67787b5eb44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 10:09:07 +0000 Subject: [PATCH 1/3] - Update to 1.1.1: * Various tweaks for pytest and new py releases support - Switch to multibuild to run tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invoke?expand=0&rev=11 --- _multibuild | 3 ++ invoke-0.22.1.tar.gz | 3 -- invoke-1.1.1.tar.gz | 3 ++ python-invoke.changes | 7 +++++ python-invoke.spec | 70 ++++++++++++++++++++----------------------- 5 files changed, 46 insertions(+), 40 deletions(-) create mode 100644 _multibuild delete mode 100644 invoke-0.22.1.tar.gz create mode 100644 invoke-1.1.1.tar.gz diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/invoke-0.22.1.tar.gz b/invoke-0.22.1.tar.gz deleted file mode 100644 index fa8be30..0000000 --- a/invoke-0.22.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:621181a0efae67b3dadec583cf2c6b5096136635bf6a326c481c73db412b36fc -size 292418 diff --git a/invoke-1.1.1.tar.gz b/invoke-1.1.1.tar.gz new file mode 100644 index 0000000..b770e62 --- /dev/null +++ b/invoke-1.1.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c2cf54c9b9af973ad9704d8ba81b225117cab612568cacbfb3fc42958cc20a9 +size 311831 diff --git a/python-invoke.changes b/python-invoke.changes index d4d475d..a2945c5 100644 --- a/python-invoke.changes +++ b/python-invoke.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Aug 11 10:04:46 UTC 2018 - tchvatal@suse.com + +- Update to 1.1.1: + * Various tweaks for pytest and new py releases support +- Switch to multibuild to run tests + ------------------------------------------------------------------- Sat Apr 28 12:30:16 UTC 2018 - badshah400@gmail.com diff --git a/python-invoke.spec b/python-invoke.spec index 312b6a6..eed0ef1 100644 --- a/python-invoke.spec +++ b/python-invoke.spec @@ -17,54 +17,43 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -# Tests have a dependency loop with python(2|3)-invocations -%bcond_with test -Name: python-invoke -Version: 0.22.1 +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%bcond_without test +%else +%bcond_with test +%endif +Version: 1.1.1 Release: 0 Summary: Pythonic Task Execution License: BSD-2-Clause Group: Development/Languages/Python -Url: http://www.pyinvoke.org +URL: http://www.pyinvoke.org Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz -BuildRequires: %{python_module devel} +%if %{with test} +BuildRequires: %{python_module invocations >= 1.4} +BuildRequires: %{python_module invoke} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest-relaxed} +BuildRequires: %{python_module pytest} +%endif BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -%if %{with test} -BuildRequires: %{python_module invocations} -BuildRequires: %{python_module nose} -BuildRequires: python-mock -%endif +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch -Requires(post): update-alternatives -Requires(postun): update-alternatives +%if %{with test} +Name: python-invoke-%{flavor} +%else +Name: python-invoke +%endif %python_subpackages %description Invoke is a Python (2.7 and 3.4+) task execution tool & library, drawing inspiration from various sources to arrive at a powerful & clean feature set. -* Like Ruby's Rake tool and Invoke's own predecessor Fabric 1.x, it provides a - clean, high level API for running shell commands and defining/organizing - task functions from a ``tasks.py`` file - -* From GNU Make, it inherits an emphasis on minimal boilerplate for common - patterns and the ability to run multiple tasks in a single invocation:: - - $ invoke clean build - -* Following the lead of most Unix CLI applications, it offers a traditional - flag-based style of command-line parsing, deriving flag names and value types - from task signatures (optionally, of course!):: - - $ invoke clean --docs --bytecode build --docs --extra='**/*.pyo' - $ invoke clean -d -b build --docs -e '**/*.pyo' - $ invoke clean -db build -de '**/*.pyo' - -* Like many of its predecessors, it offers advanced features as well -- - namespacing, task aliasing, before/after hooks, parallel execution and more. - %prep %setup -q -n invoke-%{version} @@ -72,31 +61,38 @@ inspiration from various sources to arrive at a powerful & clean feature set. %python_build %install +%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/inv %python_clone -a %{buildroot}%{_bindir}/invoke +%endif %if %{with test} %check -%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} -%{buildroot}%{_bindir}/inv-%{$python_bin_suffix} -l +%{python_expand export PYTHONPATH=%{$python_sitelib} +py.test-%{$python_bin_suffix} +%{_bindir}/inv-%{$python_bin_suffix} -l } %endif +%if !%{with test} %post %{python_install_alternative inv invoke} %postun %python_uninstall_alternative inv +%endif %files %{python_files} -%defattr(-,root,root) -%doc LICENSE README.rst +%license LICENSE +%doc README.rst +%if !%{with test} %python_alternative %{_bindir}/inv %python_alternative %{_bindir}/invoke %{python_sitelib}/invoke/ %{python_sitelib}/invoke-%{version}-py* +%endif %changelog From 16c2cc19bcce60d385c9e11a76f40305b52de260270e3c195fd4faea66c56ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 10:14:16 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invoke?expand=0&rev=12 --- python-invoke.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python-invoke.spec b/python-invoke.spec index eed0ef1..aa27ad7 100644 --- a/python-invoke.spec +++ b/python-invoke.spec @@ -30,13 +30,6 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: http://www.pyinvoke.org Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz -%if %{with test} -BuildRequires: %{python_module invocations >= 1.4} -BuildRequires: %{python_module invoke} -BuildRequires: %{python_module mock} -BuildRequires: %{python_module pytest-relaxed} -BuildRequires: %{python_module pytest} -%endif BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -44,6 +37,13 @@ Requires(post): update-alternatives Requires(postun): update-alternatives BuildArch: noarch %if %{with test} +BuildRequires: %{python_module invocations >= 1.4} +BuildRequires: %{python_module invoke = %{version}} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest-relaxed} +BuildRequires: %{python_module pytest} +%endif +%if %{with test} Name: python-invoke-%{flavor} %else Name: python-invoke From 6bf9836b43c4c1ccd235506f58a5ee29227303ed5d5add6f94337212eacce2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 11 Aug 2018 11:48:44 +0000 Subject: [PATCH 3/3] - Add patch to not use vendored libs: * 0001-Make-test-fallback-to-system-modules-when-vendorized.patch - Remove unneeded deps - Remove the multibuild again as we no longer cycle OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-invoke?expand=0&rev=13 --- ...ck-to-system-modules-when-vendorized.patch | 92 +++++++++++++++++++ _multibuild | 3 - python-invoke.changes | 8 ++ python-invoke.spec | 48 ++++------ 4 files changed, 120 insertions(+), 31 deletions(-) create mode 100644 0001-Make-test-fallback-to-system-modules-when-vendorized.patch delete mode 100644 _multibuild diff --git a/0001-Make-test-fallback-to-system-modules-when-vendorized.patch b/0001-Make-test-fallback-to-system-modules-when-vendorized.patch new file mode 100644 index 0000000..44afc4a --- /dev/null +++ b/0001-Make-test-fallback-to-system-modules-when-vendorized.patch @@ -0,0 +1,92 @@ +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.1.1/tests/_util.py +=================================================================== +--- invoke-1.1.1.orig/tests/_util.py ++++ invoke-1.1.1/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.1.1/tests/concurrency.py +=================================================================== +--- invoke-1.1.1.orig/tests/concurrency.py ++++ invoke-1.1.1/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.1.1/tests/conftest.py +=================================================================== +--- invoke-1.1.1.orig/tests/conftest.py ++++ invoke-1.1.1/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.1.1/tests/runners.py +=================================================================== +--- invoke-1.1.1.orig/tests/runners.py ++++ invoke-1.1.1/tests/runners.py +@@ -6,7 +6,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.1.1/tests/watchers.py +=================================================================== +--- invoke-1.1.1.orig/tests/watchers.py ++++ invoke-1.1.1/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/_multibuild b/_multibuild deleted file mode 100644 index fcc7b97..0000000 --- a/_multibuild +++ /dev/null @@ -1,3 +0,0 @@ - - test - diff --git a/python-invoke.changes b/python-invoke.changes index a2945c5..2ebe1bc 100644 --- a/python-invoke.changes +++ b/python-invoke.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Aug 11 11:42:30 UTC 2018 - tchvatal@suse.com + +- Add patch to not use vendored libs: + * 0001-Make-test-fallback-to-system-modules-when-vendorized.patch +- Remove unneeded deps +- Remove the multibuild again as we no longer cycle + ------------------------------------------------------------------- Sat Aug 11 10:04:46 UTC 2018 - tchvatal@suse.com diff --git a/python-invoke.spec b/python-invoke.spec index aa27ad7..9c6bf58 100644 --- a/python-invoke.spec +++ b/python-invoke.spec @@ -17,12 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%global flavor @BUILD_FLAVOR@%{nil} -%if "%{flavor}" == "test" -%bcond_without test -%else -%bcond_with test -%endif +Name: python-invoke Version: 1.1.1 Release: 0 Summary: Pythonic Task Execution @@ -30,24 +25,26 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: http://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 +BuildRequires: %{python_module PyYAML} +BuildRequires: %{python_module fluidity-sm} +BuildRequires: %{python_module lexicon} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pexpect} +BuildRequires: %{python_module pytest-relaxed} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} 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 invocations >= 1.4} -BuildRequires: %{python_module invoke = %{version}} -BuildRequires: %{python_module mock} -BuildRequires: %{python_module pytest-relaxed} -BuildRequires: %{python_module pytest} -%endif -%if %{with test} -Name: python-invoke-%{flavor} -%else -Name: python-invoke -%endif %python_subpackages %description @@ -56,43 +53,38 @@ inspiration from various sources to arrive at a powerful & clean feature set. %prep %setup -q -n invoke-%{version} +# Remove bundled libs, import will fallback to system provided libs +rm -fr invoke/vendor/* + +%patch0 -p1 %build %python_build %install -%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/inv %python_clone -a %{buildroot}%{_bindir}/invoke -%endif -%if %{with test} %check -%{python_expand export PYTHONPATH=%{$python_sitelib} +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} -%{_bindir}/inv-%{$python_bin_suffix} -l } -%endif -%if !%{with test} %post %{python_install_alternative inv invoke} %postun %python_uninstall_alternative inv -%endif %files %{python_files} %license LICENSE %doc README.rst -%if !%{with test} %python_alternative %{_bindir}/inv %python_alternative %{_bindir}/invoke %{python_sitelib}/invoke/ %{python_sitelib}/invoke-%{version}-py* -%endif %changelog