commit bdaa3051e54e7b14e88ad9e2210ccd2bdc0860ab5bbbd0194be7d602d30aa6eb Author: Steve Kowalik Date: Thu Aug 29 04:06:32 2024 +0000 - drop python 2 support, do not require six - added patches fix https://github.com/rubik/mando/pull/57 + python-mando-no-python2.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mando?expand=0&rev=17 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/mando-0.7.1.tar.gz b/mando-0.7.1.tar.gz new file mode 100644 index 0000000..8ad35db --- /dev/null +++ b/mando-0.7.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18baa999b4b613faefb00eac4efadcf14f510b59b924b66e08289aa1de8c3500 +size 37868 diff --git a/python-mando-no-python2.patch b/python-mando-no-python2.patch new file mode 100644 index 0000000..67cc9e6 --- /dev/null +++ b/python-mando-no-python2.patch @@ -0,0 +1,310 @@ +Index: mando-0.7.1/docs/conf.py +=================================================================== +--- mando-0.7.1.orig/docs/conf.py ++++ mando-0.7.1/docs/conf.py +@@ -46,8 +46,8 @@ source_suffix = '.rst' + master_doc = 'index' + + # General information about the project. +-project = u'mando' +-copyright = u'2013, Michele Lacchia' ++project = 'mando' ++copyright = '2013, Michele Lacchia' + + # The version info for the project you're documenting, acts as replacement for + # |version| and |release|, also used in various other places throughout the +@@ -199,8 +199,8 @@ latex_elements = { + # (source start file, target name, title, + # author, documentclass [howto, manual, or own class]). + latex_documents = [ +- ('index', 'mando.tex', u'mando Documentation', +- u'Michele Lacchia', 'manual'), ++ ('index', 'mando.tex', 'mando Documentation', ++ 'Michele Lacchia', 'manual'), + ] + + # The name of an image file (relative to this directory) to place at the top of +@@ -229,8 +229,8 @@ latex_documents = [ + # One entry per manual page. List of tuples + # (source start file, name, description, authors, manual section). + man_pages = [ +- ('index', 'mando', u'mando Documentation', +- [u'Michele Lacchia'], 1) ++ ('index', 'mando', 'mando Documentation', ++ ['Michele Lacchia'], 1) + ] + + # If true, show URL addresses after external links. +@@ -243,8 +243,8 @@ man_pages = [ + # (source start file, target name, title, author, + # dir menu entry, description, category) + texinfo_documents = [ +- ('index', 'mando', u'mando Documentation', +- u'Michele Lacchia', 'mando', 'One line description of project.', ++ ('index', 'mando', 'mando Documentation', ++ 'Michele Lacchia', 'mando', 'One line description of project.', + 'Miscellaneous'), + ] + +Index: mando-0.7.1/mando/__init__.py +=================================================================== +--- mando-0.7.1.orig/mando/__init__.py ++++ mando-0.7.1/mando/__init__.py +@@ -1,11 +1,6 @@ + __version__ = '0.7.1' + +-try: +- from mando.core import Program +-except ImportError as e: # pragma: no cover +- # unfortunately the only workaround for Python2.6, argparse and setup.py +- e.version = __version__ +- raise e ++from mando.core import Program + + main = Program() + command = main.command +Index: mando-0.7.1/mando/core.py +=================================================================== +--- mando-0.7.1.orig/mando/core.py ++++ mando-0.7.1/mando/core.py +@@ -5,22 +5,19 @@ ordinary Python functions into commands + import argparse + import inspect + import sys ++from inspect import signature + + from mando.napoleon import Config, GoogleDocstring, NumpyDocstring + + from mando.utils import (purify_doc, action_by_type, find_param_docs, + split_doc, ensure_dashes, purify_kwargs) +-try: +- from inspect import signature +-except ImportError: +- from funcsigs import signature + + + _POSITIONAL = type('_positional', (object,), {}) + _DISPATCH_TO = '_dispatch_to' + + +-class SubProgram(object): ++class SubProgram: + def __init__(self, parser, signatures): + self.parser = parser + self._subparsers = self.parser.add_subparsers() +Index: mando-0.7.1/mando/napoleon/__init__.py +=================================================================== +--- mando-0.7.1.orig/mando/napoleon/__init__.py ++++ mando-0.7.1/mando/napoleon/__init__.py +@@ -9,12 +9,10 @@ + :license: BSD, see LICENSE for details. + """ + +-from six import iteritems +- + from mando.napoleon.docstring import GoogleDocstring, NumpyDocstring + + +-class Config(object): ++class Config: + """Sphinx napoleon extension settings in `conf.py`. + + Listed below are all the settings used by napoleon and their default +@@ -252,7 +250,7 @@ class Config(object): + + def __init__(self, **settings): + # type: (Any) -> None +- for name, (default, rebuild) in iteritems(self._config_values): ++ for name, (default, rebuild) in self._config_values.items(): + setattr(self, name, default) +- for name, value in iteritems(settings): ++ for name, value in settings.items(): + setattr(self, name, value) +Index: mando-0.7.1/mando/napoleon/docstring.py +=================================================================== +--- mando-0.7.1.orig/mando/napoleon/docstring.py ++++ mando-0.7.1/mando/napoleon/docstring.py +@@ -11,16 +11,10 @@ + :license: BSD, see LICENSE for details. + """ + +-try: +- from collections.abc import Callable +-except ImportError: +- from collections import Callable ++from collections.abc import Callable + import inspect + import re + +-from six import string_types, u +-from six.moves import range +- + from mando.napoleon.iterators import modify_iter + from mando.napoleon.pycompat import UnicodeMixin + +@@ -124,7 +118,7 @@ class GoogleDocstring(UnicodeMixin): + self._name = name + self._obj = obj + self._opt = options +- if isinstance(docstring, string_types): ++ if isinstance(docstring, str): + docstring = docstring.splitlines() + self._lines = docstring + self._line_iter = modify_iter(docstring, modifier=lambda s: s.rstrip()) +@@ -171,7 +165,7 @@ class GoogleDocstring(UnicodeMixin): + Unicode version of the docstring. + + """ +- return u('\n').join(self.lines()) ++ return (u'\n').join(self.lines()) + + def lines(self): + # type: () -> List[unicode] +@@ -323,13 +317,13 @@ class GoogleDocstring(UnicodeMixin): + def _fix_field_desc(self, desc): + # type: (List[unicode]) -> List[unicode] + if self._is_list(desc): +- desc = [u''] + desc ++ desc = [''] + desc + elif desc[0].endswith('::'): + desc_block = desc[1:] + indent = self._get_indent(desc[0]) + block_indent = self._get_initial_indent(desc_block) + if block_indent > indent: +- desc = [u''] + desc ++ desc = [''] + desc + else: + desc = ['', desc[0]] + self._indent(desc_block, 4) + return desc +@@ -341,9 +335,9 @@ class GoogleDocstring(UnicodeMixin): + return ['.. %s:: %s' % (admonition, lines[0].strip()), ''] + elif lines: + lines = self._indent(self._dedent(lines), 3) +- return [u'.. %s::' % admonition, u''] + lines + [u''] ++ return ['.. %s::' % admonition, ''] + lines + [''] + else: +- return [u'.. %s::' % admonition, u''] ++ return ['.. %s::' % admonition, ''] + + def _format_block(self, prefix, lines, padding=None): + # type: (unicode, List[unicode], unicode) -> List[unicode] +@@ -614,7 +608,7 @@ class GoogleDocstring(UnicodeMixin): + for _name, _, _desc in self._consume_fields(parse_type=False): + lines.append('.. method:: %s' % _name) + if _desc: +- lines.extend([u''] + self._indent(_desc, 3)) ++ lines.extend([''] + self._indent(_desc, 3)) + lines.append('') + return lines + +@@ -924,7 +918,7 @@ class NumpyDocstring(GoogleDocstring): + # type: () -> bool + section, underline = self._line_iter.peek(2) + section = section.lower() +- if section in self._sections and isinstance(underline, string_types): ++ if section in self._sections and isinstance(underline, str): + return bool(_numpy_section_regex.match(underline)) # type: ignore + elif self._directive_sections: + if _directive_regex.match(section): +Index: mando-0.7.1/mando/napoleon/iterators.py +=================================================================== +--- mando-0.7.1.orig/mando/napoleon/iterators.py ++++ mando-0.7.1/mando/napoleon/iterators.py +@@ -14,7 +14,7 @@ + import collections + + +-class peek_iter(object): ++class peek_iter: + """An iterator object that supports peeking ahead. + + Parameters +Index: mando-0.7.1/mando/napoleon/pycompat.py +=================================================================== +--- mando-0.7.1.orig/mando/napoleon/pycompat.py ++++ mando-0.7.1/mando/napoleon/pycompat.py +@@ -1,18 +1,6 @@ +-from six import PY3 ++class UnicodeMixin: ++ """Mixin class to handle defining the proper __str__/__unicode__ ++ methods in Python 2 or 3.""" + +- +-# UnicodeMixin +-if PY3: +- class UnicodeMixin(object): +- """Mixin class to handle defining the proper __str__/__unicode__ +- methods in Python 2 or 3.""" +- +- def __str__(self): +- return self.__unicode__() +-else: +- class UnicodeMixin(object): +- """Mixin class to handle defining the proper __str__/__unicode__ +- methods in Python 2 or 3.""" +- +- def __str__(self): +- return self.__unicode__().encode('utf8') ++ def __str__(self): ++ return self.__unicode__() +Index: mando-0.7.1/mando/tests/capture.py +=================================================================== +--- mando-0.7.1.orig/mando/tests/capture.py ++++ mando-0.7.1/mando/tests/capture.py +@@ -7,12 +7,7 @@ Capture function + + import sys + from contextlib import contextmanager +- +-try: +- from cStringIO import StringIO +-except ImportError: +- from io import StringIO +- ++from io import StringIO + + @contextmanager + def capture_sys_output(): +Index: mando-0.7.1/mando/tests/test_unicode_docstring_on_py2.py +=================================================================== +--- mando-0.7.1.orig/mando/tests/test_unicode_docstring_on_py2.py ++++ mando-0.7.1/mando/tests/test_unicode_docstring_on_py2.py +@@ -1,6 +1,3 @@ +-# This is important: it will make all literals unicode under 2.x +-from __future__ import unicode_literals +- + import unittest + + from mando import Program +Index: mando-0.7.1/setup.py +=================================================================== +--- mando-0.7.1.orig/setup.py ++++ mando-0.7.1/setup.py +@@ -9,16 +9,15 @@ except ImportError as e: + else: + version = mando.__version__ + +-deps = ["six"] ++deps = [] + extras = {"restructuredText": ["rst2ansi"]} + + + sversion = tuple(setuptools.__version__.split(".")) + + if sversion > ("36", "2"): +- deps += ['argparse ; python_version<="2.6"', 'funcsigs ; python_version<="3.2"'] ++ deps += ['funcsigs ; python_version<="3.2"'] + elif sversion > ("18", "0"): +- extras[':python_version<="2.6"'] = ["argparse"] + extras[':python_version<="3.2"'] = ["funcsigs"] + + +@@ -51,8 +50,6 @@ setuptools.setup( + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", +- "Programming Language :: Python :: 2", +- "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.1", + "Programming Language :: Python :: 3.2", diff --git a/python-mando.changes b/python-mando.changes new file mode 100644 index 0000000..5a94661 --- /dev/null +++ b/python-mando.changes @@ -0,0 +1,60 @@ +------------------------------------------------------------------- +Wed Aug 28 09:19:47 UTC 2024 - pgajdos@suse.com + +- drop python 2 support, do not require six +- added patches + fix https://github.com/rubik/mando/pull/57 + + python-mando-no-python2.patch + +------------------------------------------------------------------- +Tue Jun 13 09:10:40 UTC 2023 - ecsos + +- Addd %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Thu Feb 24 09:37:25 UTC 2022 - Steve Kowalik + +- Update to 0.7.1: + * - Add support for Python 3.10 (@s-t-e-v-e-n-k): #54 +- Drop patch python-310-support.patch, merged upstream. + +------------------------------------------------------------------- +Mon Dec 13 05:41:16 UTC 2021 - Steve Kowalik + +- Add patch python-310-support.patch: + * Support argparse changes introduced in Python 3.10. + +------------------------------------------------------------------- +Wed Apr 1 09:34:37 UTC 2020 - pgajdos@suse.com + +- version update to 0.7.0 + * no upstream changelog found + +------------------------------------------------------------------- +Wed Dec 19 00:14:24 UTC 2018 - Jan Engelhardt + +- Trim rhetorics from descriptions. + +------------------------------------------------------------------- +Tue Dec 4 12:50:15 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Mon Nov 6 17:16:46 UTC 2017 - toddrme2178@gmail.com + +- Spec file cleanups +- rpmlint fixes + +------------------------------------------------------------------- +Tue Oct 24 20:13:04 UTC 2017 - aloisio@gmx.com + +- Update to version 0.6.4 + +- Converted to single-spec + +------------------------------------------------------------------- +Fri Oct 14 19:21:27 UTC 2016 - toddrme2178@gmail.com + +- Initial version + diff --git a/python-mando.spec b/python-mando.spec new file mode 100644 index 0000000..0563731 --- /dev/null +++ b/python-mando.spec @@ -0,0 +1,63 @@ +# +# spec file for package python-mando +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-mando +Version: 0.7.1 +Release: 0 +Summary: Python wrapper around argparse, a tool to create CLI apps +License: MIT +URL: https://mando.readthedocs.org/ +Source: https://files.pythonhosted.org/packages/source/m/mando/mando-%{version}.tar.gz +# https://github.com/rubik/mando/pull/57 +Patch0: python-mando-no-python2.patch +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Suggests: python-rst2ansi +BuildArch: noarch +# SECTION teset requirements +BuildRequires: %{python_module pytest} +# /SECTION +%python_subpackages + +%description +Mando is a wrapper around argparse, and allows writing CLI +applications. + +%prep +%autosetup -p1 -n mando-%{version} +sed -i -e '/^#!\//, 1d' mando/tests/*.py + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%doc README.rst +%{python_sitelib}/mando +%{python_sitelib}/mando-*-info + +%changelog