From 5903de865bc5afe358748482e5a1cacae39a6f416fc0babaa8450f778928678a Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 13 Dec 2021 03:46:25 +0000 Subject: [PATCH] - Add patch support-python-310.patch: * Support argparse changes introduced in Python 3.10. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mando?expand=0&rev=12 --- python-310-support.patch | 61 ++++++++++++++++++++++++++++++++++++++++ python-mando.changes | 6 ++++ python-mando.spec | 5 ++-- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 python-310-support.patch diff --git a/python-310-support.patch b/python-310-support.patch new file mode 100644 index 0000000..02b97e3 --- /dev/null +++ b/python-310-support.patch @@ -0,0 +1,61 @@ +Index: mando-0.7.0/mando/tests/test_numpy.py +=================================================================== +--- mando-0.7.0.orig/mando/tests/test_numpy.py ++++ mando-0.7.0/mando/tests/test_numpy.py +@@ -1,3 +1,4 @@ ++import sys + import pytest + from mando import Program + +@@ -51,6 +52,20 @@ optional arguments: + --arg2 ARG2 Description of `arg2` + '''), + ] ++if sys.version_info[:2] >= (3, 10): ++ NUMPY_DOCSTRING_HELP_CASES = [ ++ ('simple_numpy_docstring --help 2 --arg2=test', '''usage: example.py simple_numpy_docstring [-h] [--arg2 ARG2] arg1 ++ ++Extended description. ++ ++positional arguments: ++ arg1 Description of `arg1` ++ ++options: ++ -h, --help show this help message and exit ++ --arg2 ARG2 Description of `arg2` ++'''), ++ ] + + + @pytest.mark.parametrize('args,result', NUMPY_DOCSTRING_HELP_CASES) +Index: mando-0.7.0/mando/tests/test_google.py +=================================================================== +--- mando-0.7.0.orig/mando/tests/test_google.py ++++ mando-0.7.0/mando/tests/test_google.py +@@ -1,3 +1,4 @@ ++import sys + import pytest + from mando import Program + +@@ -46,6 +47,21 @@ optional arguments: + --arg2 ARG2 Description of `arg2` + '''), + ] ++if sys.version_info[:2] >= (3, 10): ++ GOOGLE_DOCSTRING_HELP_CASES = [ ++ ('simple_google_docstring --help 2 --arg2=test', '''usage: example.py simple_google_docstring [-h] [--arg2 ARG2] arg1 ++ ++Extended description. ++ ++positional arguments: ++ arg1 Description of `arg1` ++ ++options: ++ -h, --help show this help message and exit ++ --arg2 ARG2 Description of `arg2` ++'''), ++ ] ++ + + + @pytest.mark.parametrize('args,result', GOOGLE_DOCSTRING_HELP_CASES) diff --git a/python-mando.changes b/python-mando.changes index 80b46cc..e414cfe 100644 --- a/python-mando.changes +++ b/python-mando.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 13 03:44:10 UTC 2021 - Steve Kowalik + +- Add patch support-python-310.patch: + * Support argparse changes introduced in Python 3.10. + ------------------------------------------------------------------- Wed Apr 1 09:34:37 UTC 2020 - pgajdos@suse.com diff --git a/python-mando.spec b/python-mando.spec index 16b158e..30ae02a 100644 --- a/python-mando.spec +++ b/python-mando.spec @@ -1,7 +1,7 @@ # # spec file for package python-mando # -# Copyright (c) 2020 SUSE LLC +# 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 @@ -22,9 +22,9 @@ Version: 0.7.0 Release: 0 Summary: Python wrapper around argparse, a tool to create CLI apps License: MIT -Group: Development/Languages/Python URL: https://mando.readthedocs.org/ Source: https://files.pythonhosted.org/packages/source/m/mando/mando-%{version}.tar.gz +Patch0: python-310-support.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -43,6 +43,7 @@ applications. %prep %setup -q -n mando-%{version} +%autopatch -p1 sed -i -e '/^#!\//, 1d' mando/tests/*.py %build