From b87c7383f7431d1085a764019ad7122c4b512c02f06831c65b692bbf165eed7a Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 22 Sep 2021 04:42:51 +0000 Subject: [PATCH] - Add patch support-py39.patch: * Deal with Python 3.9.x changes in argparse. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argh?expand=0&rev=27 --- python-argh.changes | 6 ++++++ python-argh.spec | 3 ++- support-py39.patch | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 support-py39.patch diff --git a/python-argh.changes b/python-argh.changes index 54a0a50..e639cc2 100644 --- a/python-argh.changes +++ b/python-argh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 22 04:41:45 UTC 2021 - Steve Kowalik + +- Add patch support-py39.patch: + * Deal with Python 3.9.x changes in argparse. + ------------------------------------------------------------------- Mon May 17 11:16:59 UTC 2021 - pgajdos@suse.com diff --git a/python-argh.spec b/python-argh.spec index c1e6945..3944b84 100644 --- a/python-argh.spec +++ b/python-argh.spec @@ -22,9 +22,9 @@ Version: 0.26.2 Release: 0 Summary: An argparse wrapper License: LGPL-3.0-or-later -Group: Development/Languages/Python URL: https://github.com/neithere/argh/ Source: https://files.pythonhosted.org/packages/source/a/argh/argh-%{version}.tar.gz +Patch0: support-py39.patch BuildRequires: %{python_module iocapture} BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} @@ -56,6 +56,7 @@ work that a custom dispatcher may not do. %prep %setup -q -n argh-%{version} +%autopatch -p1 %build %python_build diff --git a/support-py39.patch b/support-py39.patch new file mode 100644 index 0000000..bcc72d2 --- /dev/null +++ b/support-py39.patch @@ -0,0 +1,31 @@ +Index: argh-0.26.2/test/test_integration.py +=================================================================== +--- argh-0.26.2.orig/test/test_integration.py ++++ argh-0.26.2/test/test_integration.py +@@ -377,7 +377,7 @@ def test_invalid_choice(): + p = DebugArghParser() + p.add_commands([cmd]) + +- assert run(p, 'bar', exit=True).startswith('invalid choice') ++ assert 'invalid choice' in run(p, 'bar', exit=True) + + if sys.version_info < (3,3): + # Python before 3.3 exits with a less informative error +@@ -391,7 +391,7 @@ def test_invalid_choice(): + p = DebugArghParser() + p.add_commands([cmd], namespace='nest') + +- assert run(p, 'nest bar', exit=True).startswith('invalid choice') ++ assert 'invalid choice' in run(p, 'nest bar', exit=True) + + if sys.version_info < (3,3): + # Python before 3.3 exits with a less informative error +@@ -511,7 +511,7 @@ def test_explicit_cmd_name(): + + p = DebugArghParser() + p.add_commands([orig_name]) +- assert run(p, 'orig-name', exit=True).startswith('invalid choice') ++ assert 'invalid choice' in run(p, 'orig-name', exit=True) + assert run(p, 'new-name').out == 'ok\n' + +