From dcffd773c91acfbeff1f07308ca48657507c11e777521295049f2f8cadaca871 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 11 Aug 2021 10:58:24 +0000 Subject: [PATCH] =?UTF-8?q?-=20Add=20compatibility-click-8.patch=20to=20fi?= =?UTF-8?q?x=20compatiblity=20with=20=20=20click=C2=A08=20(gh#click-contri?= =?UTF-8?q?b/click-default-group#18).?= 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-click-default-group?expand=0&rev=3 --- compatibility-click-8.patch | 23 +++++++++++++++++++++++ python-click-default-group.changes | 6 ++++++ python-click-default-group.spec | 14 +++++++++----- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 compatibility-click-8.patch diff --git a/compatibility-click-8.patch b/compatibility-click-8.patch new file mode 100644 index 0000000..4b2a969 --- /dev/null +++ b/compatibility-click-8.patch @@ -0,0 +1,23 @@ +From 9415c77d05cf7d16876e7d70a49a41a6189983b4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= +Date: Sun, 20 Jun 2021 16:11:42 +0200 +Subject: [PATCH] make tests compatible with click 8 + +It now outputs "No such option". +--- + test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test.py b/test.py +index c464620..f90b80d 100644 +--- a/test.py ++++ b/test.py +@@ -30,7 +30,7 @@ def bar(): + + def test_default_command_with_arguments(): + assert r.invoke(cli, ['--foo', 'foooo']).output == 'foooo\n' +- assert 'no such option' in r.invoke(cli, ['-x']).output ++ assert 'no such option' in r.invoke(cli, ['-x']).output.lower() + + + def test_group_arguments(): diff --git a/python-click-default-group.changes b/python-click-default-group.changes index 825b894..a9c8012 100644 --- a/python-click-default-group.changes +++ b/python-click-default-group.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 11 10:57:36 UTC 2021 - Matej Cepl + +- Add compatibility-click-8.patch to fix compatiblity with + click 8 (gh#click-contrib/click-default-group#18). + ------------------------------------------------------------------- Sun Aug 23 17:02:56 UTC 2020 - John Vandenberg diff --git a/python-click-default-group.spec b/python-click-default-group.spec index b2050b8..87fe023 100644 --- a/python-click-default-group.spec +++ b/python-click-default-group.spec @@ -1,7 +1,7 @@ # # spec file for package python-click-default-group # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,8 @@ # 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/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} @@ -21,11 +22,14 @@ Version: 1.2.2 Release: 0 License: BSD-3-Clause Summary: Extends clickGroup to invoke a command without explicit subcommand name -Url: https://github.com/sublee/click-default-group/ +URL: https://github.com/sublee/click-default-group/ Group: Development/Languages/Python Source: https://github.com/click-contrib/click-default-group/archive/v%{version}.tar.gz#/click-default-group-%{version}.tar.gz -BuildRequires: python-rpm-macros +# PATCH-FIX-UPSTREAM compatibility-click-8.patch gh#click-contrib/click-default-group#18 mcepl@suse.com +# Make tests compatible with click 8 +Patch0: compatibility-click-8.patch BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module click} BuildRequires: %{python_module pytest} @@ -40,7 +44,7 @@ BuildArch: noarch Extends click.Group to invoke a command without explicit subcommand name. %prep -%setup -q -n click-default-group-%{version} +%autosetup -p1 -n click-default-group-%{version} %build %python_build