From 1c94b67aaa8cb7775c04596be321cb396e75a8c8445295d752fb5c57e72bdac0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 3 Dec 2018 11:16:36 +0000 Subject: [PATCH 1/5] Add remove-typing.patch removing requirements for the typing library, which is useless now. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cmd2?expand=0&rev=35 --- python-cmd2.changes | 6 ++++++ python-cmd2.spec | 6 ++++-- remove-typing.patch | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 remove-typing.patch diff --git a/python-cmd2.changes b/python-cmd2.changes index 91bcdf1..b34afa0 100644 --- a/python-cmd2.changes +++ b/python-cmd2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 3 11:13:35 UTC 2018 - Matěj Cepl + +- Add remove-typing.patch removing requirements for the typing library, + which is useless now. + ------------------------------------------------------------------- Thu Sep 20 20:17:41 UTC 2018 - Todd R diff --git a/python-cmd2.spec b/python-cmd2.spec index 652c83a..29b726f 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -26,8 +26,9 @@ License: MIT Group: Development/Languages/Python Url: https://github.com/python-cmd2/cmd2 Source: https://files.pythonhosted.org/packages/source/c/cmd2/cmd2-%{version}.tar.gz -BuildRequires: %{python_module setuptools} +Patch0: remove-typing.patch BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros # SECTION Test requirements @@ -68,6 +69,7 @@ Drop-in replacement adds several features for command-prompt tools: %prep %setup -q -n cmd2-%{version} +%autopatch -p1 # Fix non-executable-script sed -i -e '/^#!\//, 1d' cmd2/cmd2.py # Fix spurious-executable-perm diff --git a/remove-typing.patch b/remove-typing.patch new file mode 100644 index 0000000..e86107d --- /dev/null +++ b/remove-typing.patch @@ -0,0 +1,15 @@ +--- + setup.py | 2 -- + 1 file changed, 2 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -68,8 +68,6 @@ EXTRAS_REQUIRE = { + ":sys_platform=='win32'": ['pyreadline'], + # POSIX OSes also require wcwidth for correctly estimating the displayed width of unicode chars + ":sys_platform!='win32'": ['wcwidth'], +- # Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout +- ":python_version<'3.5'": ['contextlib2', 'typing'], + # development only dependencies + # install with 'pip install -e .[dev]' + 'dev': [ From dbf2aebf86daafbc7e8016932fdda00799c224d110a539c36302f33cbb92b147 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 3 Dec 2018 11:24:42 +0000 Subject: [PATCH 2/5] Don't rely on autopatch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cmd2?expand=0&rev=36 --- python-cmd2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-cmd2.spec b/python-cmd2.spec index 29b726f..29c97f5 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -69,7 +69,7 @@ Drop-in replacement adds several features for command-prompt tools: %prep %setup -q -n cmd2-%{version} -%autopatch -p1 +%patch0 -p1 # Fix non-executable-script sed -i -e '/^#!\//, 1d' cmd2/cmd2.py # Fix spurious-executable-perm From 40f1f218e4e4992cbb0be246d41a217896de4f93c1f2deac460bf529e288e7f8 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 3 Dec 2018 11:36:49 +0000 Subject: [PATCH 3/5] Don't apply the patch on old openSUSE OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cmd2?expand=0&rev=37 --- python-cmd2.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-cmd2.spec b/python-cmd2.spec index 29c97f5..ec5199f 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -69,7 +69,9 @@ Drop-in replacement adds several features for command-prompt tools: %prep %setup -q -n cmd2-%{version} +%if 0%{?sle_version} == 150000 && 0%{?is_opensuse} %patch0 -p1 +%endif # Fix non-executable-script sed -i -e '/^#!\//, 1d' cmd2/cmd2.py # Fix spurious-executable-perm From e90f55c9de99f842b927a0ede9ddf7eeace043b3c74a5073e65ac7cafd6c9517 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 3 Dec 2018 11:42:49 +0000 Subject: [PATCH 4/5] Add also BR OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cmd2?expand=0&rev=38 --- python-cmd2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-cmd2.spec b/python-cmd2.spec index ec5199f..e0b5944 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -39,6 +39,9 @@ BuildRequires: %{python_module pyperclip >= 1.5.27} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wcwidth} +%if 0%{?sle_version} < 150000 && 0%{?is_opensuse} +BuildRequires: %{python_module typing} +%endif # /SECTION Requires: python-attrs Requires: python-colorama @@ -69,7 +72,7 @@ Drop-in replacement adds several features for command-prompt tools: %prep %setup -q -n cmd2-%{version} -%if 0%{?sle_version} == 150000 && 0%{?is_opensuse} +%if 0%{?sle_version} < 150000 && 0%{?is_opensuse} %patch0 -p1 %endif # Fix non-executable-script From 43b1c71d569ef75d0ab2503dd7ace5bd036c39cf210b6b9cffd4d815185ef656 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 3 Dec 2018 11:49:07 +0000 Subject: [PATCH 5/5] Add contextlib2 BR OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cmd2?expand=0&rev=39 --- python-cmd2.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python-cmd2.spec b/python-cmd2.spec index e0b5944..2befa0f 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -40,6 +40,7 @@ BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wcwidth} %if 0%{?sle_version} < 150000 && 0%{?is_opensuse} +BuildRequires: %{python_module contextlib2} BuildRequires: %{python_module typing} %endif # /SECTION