Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-cmd2 for openSUSE:Factory checked in at 2022-08-20 20:27:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cmd2 (Old) and /work/SRC/openSUSE:Factory/.python-cmd2.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cmd2" Sat Aug 20 20:27:44 2022 rev:45 rq:998089 version:2.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cmd2/python-cmd2.changes 2022-06-06 11:10:40.447320788 +0200 +++ /work/SRC/openSUSE:Factory/.python-cmd2.new.2083/python-cmd2.changes 2022-08-20 20:27:50.757216686 +0200 @@ -1,0 +2,9 @@ +Thu Aug 18 15:38:40 UTC 2022 - Ben Greiner <c...@bnavigator.de> + +- Update to 2.4.2 + * Updated argparse decorator to remove annotations when the + docstring is used for a command's help text. + * Updated unit test to be Python 3.11 compliant. +- Clean specfile, remove coverage + +------------------------------------------------------------------- Old: ---- cmd2-2.4.1.tar.gz New: ---- cmd2-2.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cmd2.spec ++++++ --- /var/tmp/diff_new_pack.SLTV1s/_old 2022-08-20 20:27:51.329218272 +0200 +++ /var/tmp/diff_new_pack.SLTV1s/_new 2022-08-20 20:27:51.341218305 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-cmd2 -Version: 2.4.1 +Version: 2.4.2 Release: 0 Summary: Extra features for standard library's cmd module License: MIT @@ -36,23 +36,19 @@ Requires: python-pyperclip >= 1.6 Requires: python-wcwidth >= 0.1.7 BuildArch: noarch -%if %{python3_version_nodots} < 35 -Requires: python-contextlib2 -Requires: python-typing +%if 0%{?python_version_nodots} < 38 +Requires: python-importlib_metadata >= 1.6 +Requires: python-typing_extensions %endif # SECTION Test requirements BuildRequires: %{python_module attrs >= 16.3.0} +BuildRequires: %{python_module importlib_metadata >= 1.6 if %python-base < 3.8} BuildRequires: %{python_module pyperclip >= 1.6} -BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module typing_extensions if %python-base < 3.8} BuildRequires: %{python_module wcwidth >= 0.1.7} -# Required by tests. BuildRequires: vim -%if 0%{?suse_version} <= 1315 -BuildRequires: %{python_module contextlib2} -BuildRequires: %{python_module typing} -%endif # /SECTION %python_subpackages @@ -79,6 +75,7 @@ %setup -q -n cmd2-%{version} # Fix spurious-executable-perm chmod a-x README.md +sed -i '/--cov/d' setup.cfg %build %python_build @@ -88,12 +85,13 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -rm -v tests/test_transcript.py tests/test_parsing.py tests/test_cmd2.py -%pytest +# -q: prevent to colorize the terminal from color commands in parametrized test names +%pytest -q %files %{python_files} %license LICENSE %doc CHANGELOG.md README.md -%{python_sitelib}/* +%{python_sitelib}/cmd2 +%{python_sitelib}/cmd2-%{version}*-info %changelog ++++++ cmd2-2.4.1.tar.gz -> cmd2-2.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/CHANGELOG.md new/cmd2-2.4.2/CHANGELOG.md --- old/cmd2-2.4.1/CHANGELOG.md 2022-04-13 23:35:45.000000000 +0200 +++ new/cmd2-2.4.2/CHANGELOG.md 2022-07-13 17:30:49.000000000 +0200 @@ -1,3 +1,8 @@ +## 2.4.2 (July 13, 2022) +* Enhancements + * Updated argparse decorator to remove annotations when the docstring is used for a command's help text. + * Updated unit test to be Python 3.11 compliant. + ## 2.4.1 (April 13, 2022) * Bug Fixes * Fixed value for `ansi.Bg.YELLOW`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/PKG-INFO new/cmd2-2.4.2/PKG-INFO --- old/cmd2-2.4.1/PKG-INFO 2022-04-13 23:48:01.850962000 +0200 +++ new/cmd2-2.4.2/PKG-INFO 2022-07-13 17:55:21.588835000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cmd2 -Version: 2.4.1 +Version: 2.4.2 Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python Home-page: https://github.com/python-cmd2/cmd2 Author: Catherine Devlin @@ -48,7 +48,7 @@ <a href="#version-two-notes">Version 2.0 Notes</a> </p> -[](https://youtu.be/DDU_JH6cFsA) +[](https://youtu.be/DDU_JH6cFsA) cmd2 is a tool for building interactive command line applications in Python. Its goal is to make it quick and easy for developers to build feature-rich and user-friendly interactive command line @@ -60,7 +60,7 @@ The developers toolbox ---------------------- - + When creating solutions developers have no shortage of tools to create rich and smart user interfaces. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/README.md new/cmd2-2.4.2/README.md --- old/cmd2-2.4.1/README.md 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/README.md 2022-07-13 17:30:49.000000000 +0200 @@ -16,7 +16,7 @@ <a href="#version-two-notes">Version 2.0 Notes</a> </p> -[](https://youtu.be/DDU_JH6cFsA) +[](https://youtu.be/DDU_JH6cFsA) cmd2 is a tool for building interactive command line applications in Python. Its goal is to make it quick and easy for developers to build feature-rich and user-friendly interactive command line @@ -28,7 +28,7 @@ The developers toolbox ---------------------- - + When creating solutions developers have no shortage of tools to create rich and smart user interfaces. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/cmd2/cmd2.py new/cmd2-2.4.2/cmd2/cmd2.py --- old/cmd2-2.4.1/cmd2/cmd2.py 2022-04-13 22:51:28.000000000 +0200 +++ new/cmd2-2.4.2/cmd2/cmd2.py 2022-05-12 22:22:33.000000000 +0200 @@ -139,6 +139,7 @@ from .utils import ( Settable, get_defining_class, + strip_doc_annotations, ) # Set up readline @@ -3808,23 +3809,7 @@ doc = cmd_func.__doc__ # Attempt to locate the first documentation block - cmd_desc = '' - if doc: - found_first = False - for doc_line in doc.splitlines(): - stripped_line = doc_line.strip() - - # Don't include :param type lines - if stripped_line.startswith(':'): - if found_first: - break - elif stripped_line: - if found_first: - cmd_desc += "\n" - cmd_desc += stripped_line - found_first = True - elif found_first: - break + cmd_desc = strip_doc_annotations(doc) if doc else '' # Add this command to the table table_row = topic_table.generate_data_row([command, cmd_desc]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/cmd2/decorators.py new/cmd2-2.4.2/cmd2/decorators.py --- old/cmd2-2.4.1/cmd2/decorators.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/cmd2/decorators.py 2022-05-12 22:22:33.000000000 +0200 @@ -29,6 +29,9 @@ from .parsing import ( Statement, ) +from .utils import ( + strip_doc_annotations, +) if TYPE_CHECKING: # pragma: no cover import cmd2 @@ -384,7 +387,7 @@ # If the description has not been set, then use the method docstring if one exists if parser.description is None and func.__doc__: - parser.description = func.__doc__ + parser.description = strip_doc_annotations(func.__doc__) # Set the command's help text as argparser.description (which can be None) cmd_wrapper.__doc__ = parser.description diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/cmd2/utils.py new/cmd2-2.4.2/cmd2/utils.py --- old/cmd2-2.4.1/cmd2/utils.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/cmd2/utils.py 2022-05-12 22:22:33.000000000 +0200 @@ -1228,3 +1228,29 @@ """ self.parser = parser self.preserve_quotes = preserve_quotes + + +def strip_doc_annotations(doc: str) -> str: + """ + Strip annotations from a docstring leaving only the text description + + :param doc: documentation string + """ + # Attempt to locate the first documentation block + cmd_desc = '' + found_first = False + for doc_line in doc.splitlines(): + stripped_line = doc_line.strip() + + # Don't include :param type lines + if stripped_line.startswith(':'): + if found_first: + break + elif stripped_line: + if found_first: + cmd_desc += "\n" + cmd_desc += stripped_line + found_first = True + elif found_first: + break + return cmd_desc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/cmd2.egg-info/PKG-INFO new/cmd2-2.4.2/cmd2.egg-info/PKG-INFO --- old/cmd2-2.4.1/cmd2.egg-info/PKG-INFO 2022-04-13 23:48:01.000000000 +0200 +++ new/cmd2-2.4.2/cmd2.egg-info/PKG-INFO 2022-07-13 17:55:20.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cmd2 -Version: 2.4.1 +Version: 2.4.2 Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python Home-page: https://github.com/python-cmd2/cmd2 Author: Catherine Devlin @@ -48,7 +48,7 @@ <a href="#version-two-notes">Version 2.0 Notes</a> </p> -[](https://youtu.be/DDU_JH6cFsA) +[](https://youtu.be/DDU_JH6cFsA) cmd2 is a tool for building interactive command line applications in Python. Its goal is to make it quick and easy for developers to build feature-rich and user-friendly interactive command line @@ -60,7 +60,7 @@ The developers toolbox ---------------------- - + When creating solutions developers have no shortage of tools to create rich and smart user interfaces. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/docs/conf.py new/cmd2-2.4.2/docs/conf.py --- old/cmd2-2.4.1/docs/conf.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/docs/conf.py 2022-07-13 17:45:58.000000000 +0200 @@ -69,7 +69,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/examples/arg_decorators.py new/cmd2-2.4.2/examples/arg_decorators.py --- old/cmd2-2.4.1/examples/arg_decorators.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/examples/arg_decorators.py 2022-05-12 22:22:33.000000000 +0200 @@ -48,7 +48,11 @@ @cmd2.with_argparser(pow_parser) def do_pow(self, args: argparse.Namespace) -> None: - """Raise an integer to a small integer exponent, either positive or negative""" + """ + Raise an integer to a small integer exponent, either positive or negative + + :param args: argparse arguments + """ self.poutput('{} ** {} == {}'.format(args.base, args.exponent, args.base**args.exponent)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/tests/test_argparse.py new/cmd2-2.4.2/tests/test_argparse.py --- old/cmd2-2.4.1/tests/test_argparse.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/tests/test_argparse.py 2022-05-12 22:22:33.000000000 +0200 @@ -35,7 +35,13 @@ @cmd2.with_argparser(say_parser) def do_say(self, args, *, keyword_arg: Optional[str] = None): - """Repeat what you tell me to.""" + """ + Repeat what you + tell me to. + + :param args: argparse namespace + :param keyword_arg: Optional keyword arguments + """ words = [] for word in args.words: if word is None: @@ -198,7 +204,10 @@ out, err = run_cmd(argparse_app, 'help say') assert out[0].startswith('Usage: say') assert out[1] == '' - assert out[2] == 'Repeat what you tell me to.' + assert out[2] == 'Repeat what you' + assert out[3] == 'tell me to.' + for line in out: + assert not line.startswith(':') def test_argparse_help_description(argparse_app): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.1/tests/test_argparse_completer.py new/cmd2-2.4.2/tests/test_argparse_completer.py --- old/cmd2-2.4.1/tests/test_argparse_completer.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.2/tests/test_argparse_completer.py 2022-06-06 15:30:00.000000000 +0200 @@ -1371,5 +1371,5 @@ no_custom_completer_parser = subparsers.add_parser(name="no_custom_completer") assert no_custom_completer_parser.get_ap_completer_type() is None # type: ignore[attr-defined] - custom_completer_parser = subparsers.add_parser(name="no_custom_completer", ap_completer_type=CustomCompleter) + custom_completer_parser = subparsers.add_parser(name="custom_completer", ap_completer_type=CustomCompleter) assert custom_completer_parser.get_ap_completer_type() is CustomCompleter # type: ignore[attr-defined]