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 2023-01-29 14:10:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cmd2 (Old) and /work/SRC/openSUSE:Factory/.python-cmd2.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cmd2" Sun Jan 29 14:10:35 2023 rev:46 rq:1061746 version:2.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cmd2/python-cmd2.changes 2022-08-20 20:27:50.757216686 +0200 +++ /work/SRC/openSUSE:Factory/.python-cmd2.new.32243/python-cmd2.changes 2023-01-29 14:14:29.292294259 +0100 @@ -1,0 +2,10 @@ +Sat Jan 28 14:33:56 UTC 2023 - Dirk Müller <[email protected]> + +- update to 2.4.3: + * Fixed ValueError caused when passing `Cmd.columnize()` strings wider than + `display_width`. + * Renamed `utils.str_to_bool()` -> `utils.to_bool()`. + * Enhanced `utils.to_bool()` so that it accepts and converts `bool`, `int`, + and `float` in addition to `str`. + +------------------------------------------------------------------- Old: ---- cmd2-2.4.2.tar.gz New: ---- cmd2-2.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cmd2.spec ++++++ --- /var/tmp/diff_new_pack.wJOw1c/_old 2023-01-29 14:14:30.368300112 +0100 +++ /var/tmp/diff_new_pack.wJOw1c/_new 2023-01-29 14:14:30.412300352 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-cmd2 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-cmd2 -Version: 2.4.2 +Version: 2.4.3 Release: 0 Summary: Extra features for standard library's cmd module License: MIT ++++++ cmd2-2.4.2.tar.gz -> cmd2-2.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/CHANGELOG.md new/cmd2-2.4.3/CHANGELOG.md --- old/cmd2-2.4.2/CHANGELOG.md 2022-07-13 17:30:49.000000000 +0200 +++ new/cmd2-2.4.3/CHANGELOG.md 2023-01-28 01:35:30.000000000 +0100 @@ -1,3 +1,10 @@ +## 2.4.3 (January 27, 2023) +* Bug Fixes + * Fixed ValueError caused when passing `Cmd.columnize()` strings wider than `display_width`. +* Enhancements + * Renamed `utils.str_to_bool()` -> `utils.to_bool()`. + * Enhanced `utils.to_bool()` so that it accepts and converts `bool`, `int`, and `float` in addition to `str`. + ## 2.4.2 (July 13, 2022) * Enhancements * Updated argparse decorator to remove annotations when the docstring is used for a command's help text. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/LICENSE new/cmd2-2.4.3/LICENSE --- old/cmd2-2.4.2/LICENSE 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/LICENSE 2023-01-28 01:37:25.000000000 +0100 @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2008-2022 Catherine Devlin and others +Copyright (c) 2008-2023 Catherine Devlin and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/PKG-INFO new/cmd2-2.4.3/PKG-INFO --- old/cmd2-2.4.2/PKG-INFO 2022-07-13 17:55:21.588835000 +0200 +++ new/cmd2-2.4.3/PKG-INFO 2023-01-28 01:50:00.786195800 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cmd2 -Version: 2.4.2 +Version: 2.4.3 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 @@ -34,18 +34,19 @@ [](https://pypi.python.org/pypi/cmd2/) [](https://github.com/python-cmd2/cmd2/actions?query=workflow%3ACI) -[](https://python-cmd2.visualstudio.com/cmd2/_build/latest?definitionId=1&branch=master) [](https://codecov.io/gh/python-cmd2/cmd2) [](http://cmd2.readthedocs.io/en/latest/?badge=latest) <a href="https://discord.gg/RpVG6tk"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"></a> <p align="center"> - <a href="#main-features">Main Features</a> ⢠+ <a href="#the-developers-toolbox">Develper's Toolbox</a> ⢠+ <a href="#philosophy">Philosophy</a> ⢠<a href="#installation">Installation</a> ⢠+ <a href="#documentation">Documentation</a> ⢠<a href="#tutorials">Tutorials</a> ⢠+ <a href="#hello-world">Hello World</a> ⢠<a href="#projects-using-cmd2">Projects using cmd2</a> ⢠- <a href="#version-two-notes">Version 2.0 Notes</a> </p> [](https://youtu.be/DDU_JH6cFsA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/Pipfile new/cmd2-2.4.3/Pipfile --- old/cmd2-2.4.2/Pipfile 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/Pipfile 2022-11-01 20:26:38.000000000 +0100 @@ -20,7 +20,6 @@ invoke = "*" ipython = "*" isort = "*" -mock = {version = "*",markers = "python_version < '3.6'"} mypy = "*" pyreadline3 = {version = ">=3.4",sys_platform = "== 'win32'"} pytest = "*" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/README.md new/cmd2-2.4.3/README.md --- old/cmd2-2.4.2/README.md 2022-07-13 17:30:49.000000000 +0200 +++ new/cmd2-2.4.3/README.md 2022-11-01 20:26:38.000000000 +0100 @@ -2,18 +2,19 @@ [](https://pypi.python.org/pypi/cmd2/) [](https://github.com/python-cmd2/cmd2/actions?query=workflow%3ACI) -[](https://python-cmd2.visualstudio.com/cmd2/_build/latest?definitionId=1&branch=master) [](https://codecov.io/gh/python-cmd2/cmd2) [](http://cmd2.readthedocs.io/en/latest/?badge=latest) <a href="https://discord.gg/RpVG6tk"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"></a> <p align="center"> - <a href="#main-features">Main Features</a> ⢠+ <a href="#the-developers-toolbox">Develper's Toolbox</a> ⢠+ <a href="#philosophy">Philosophy</a> ⢠<a href="#installation">Installation</a> ⢠+ <a href="#documentation">Documentation</a> ⢠<a href="#tutorials">Tutorials</a> ⢠+ <a href="#hello-world">Hello World</a> ⢠<a href="#projects-using-cmd2">Projects using cmd2</a> ⢠- <a href="#version-two-notes">Version 2.0 Notes</a> </p> [](https://youtu.be/DDU_JH6cFsA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/cmd2/argparse_custom.py new/cmd2-2.4.3/cmd2/argparse_custom.py --- old/cmd2-2.4.2/cmd2/argparse_custom.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/cmd2/argparse_custom.py 2023-01-28 01:25:05.000000000 +0100 @@ -276,7 +276,7 @@ runtime_checkable, ) except ImportError: - from typing_extensions import ( # type: ignore[misc] + from typing_extensions import ( # type: ignore[assignment] Protocol, runtime_checkable, ) @@ -1033,7 +1033,7 @@ ############################################################################################################ # noinspection PyPep8Naming,PyProtectedMember -def _SubParsersAction_remove_parser(self: argparse._SubParsersAction, name: str) -> None: +def _SubParsersAction_remove_parser(self: argparse._SubParsersAction, name: str) -> None: # type: ignore """ Removes a sub-parser from a sub-parsers group. Used to remove subcommands from a parser. @@ -1333,7 +1333,7 @@ self.set_ap_completer_type(ap_completer_type) # type: ignore[attr-defined] # noinspection PyProtectedMember - def add_subparsers(self, **kwargs: Any) -> argparse._SubParsersAction: + def add_subparsers(self, **kwargs: Any) -> argparse._SubParsersAction: # type: ignore """ Custom override. Sets a default title if one was not given. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/cmd2/cmd2.py new/cmd2-2.4.3/cmd2/cmd2.py --- old/cmd2-2.4.2/cmd2/cmd2.py 2022-05-12 22:22:33.000000000 +0200 +++ new/cmd2-2.4.3/cmd2/cmd2.py 2023-01-28 01:25:05.000000000 +0100 @@ -2431,7 +2431,8 @@ if raise_keyboard_interrupt and not stop: raise ex except SystemExit as ex: - self.exit_code = ex.code + if isinstance(ex.code, int): + self.exit_code = ex.code stop = True except PassThroughException as ex: raise ex.wrapped_ex @@ -2444,7 +2445,8 @@ if raise_keyboard_interrupt and not stop: raise ex except SystemExit as ex: - self.exit_code = ex.code + if isinstance(ex.code, int): + self.exit_code = ex.code stop = True except PassThroughException as ex: raise ex.wrapped_ex @@ -3688,9 +3690,10 @@ if totwidth <= display_width: break else: + # The output is wider than display_width. Print 1 column with each string on its own row. nrows = len(str_list) ncols = 1 - colwidths = [0] + colwidths = [1] for row in range(nrows): texts = [] for col in range(ncols): @@ -4426,7 +4429,7 @@ local_vars['self'] = self # Configure IPython - config = TraitletsLoader.Config() + config = TraitletsLoader.Config() # type: ignore config.InteractiveShell.banner2 = ( 'Entering an IPython shell. Type exit, quit, or Ctrl-D to exit.\n' f'Run CLI commands with: {self.py_bridge_name}("command ...")\n' @@ -5256,7 +5259,7 @@ import signal original_sigint_handler = signal.getsignal(signal.SIGINT) - signal.signal(signal.SIGINT, self.sigint_handler) + signal.signal(signal.SIGINT, self.sigint_handler) # type: ignore # Grab terminal lock before the command line prompt has been drawn by readline self.terminal_lock.acquire() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/cmd2/utils.py new/cmd2-2.4.3/cmd2/utils.py --- old/cmd2-2.4.2/cmd2/utils.py 2022-05-12 22:22:33.000000000 +0200 +++ new/cmd2-2.4.3/cmd2/utils.py 2022-11-09 21:21:52.000000000 +0100 @@ -41,12 +41,10 @@ if TYPE_CHECKING: # pragma: no cover import cmd2 # noqa: F401 - PopenTextIO = subprocess.Popen[bytes] - + PopenTextIO = subprocess.Popen[str] else: PopenTextIO = subprocess.Popen - _T = TypeVar('_T') @@ -91,11 +89,14 @@ return arg -def str_to_bool(val: str) -> bool: - """Converts a string to a boolean based on its value. +def to_bool(val: Any) -> bool: + """Converts anything to a boolean based on its value. + + Strings like "True", "true", "False", and "false" return True, True, False, and False + respectively. All other values are converted using bool() - :param val: string being converted - :return: boolean value expressed in the string + :param val: value being converted + :return: boolean value expressed in the passed in value :raises: ValueError if the string does not contain a value corresponding to a boolean value """ if isinstance(val, str): @@ -103,7 +104,11 @@ return True elif val.capitalize() == str(False): return False - raise ValueError("must be True or False (case-insensitive)") + raise ValueError("must be True or False (case-insensitive)") + elif isinstance(val, bool): + return val + else: + return bool(val) class Settable: @@ -128,7 +133,7 @@ :param name: name of the instance attribute being made settable :param val_type: callable used to cast the string value from the command line into its proper type and even validate its value. Setting this to bool provides tab completion for true/false and - validation using str_to_bool(). The val_type function should raise an exception if it fails. + validation using to_bool(). The val_type function should raise an exception if it fails. This exception will be caught and printed by Cmd.do_set(). :param description: string describing this setting :param settable_object: object to which the instance attribute belongs (e.g. self) @@ -155,7 +160,7 @@ """Used to tab complete lowercase boolean values""" return ['true', 'false'] - val_type = str_to_bool + val_type = to_bool choices_provider = cast(ChoicesProviderFunc, get_bool_choices) self.name = name @@ -670,12 +675,15 @@ self._write_bytes(write_stream, available) @staticmethod - def _write_bytes(stream: Union[StdSim, TextIO], to_write: bytes) -> None: + def _write_bytes(stream: Union[StdSim, TextIO], to_write: Union[bytes, str]) -> None: """ Write bytes to a stream :param stream: the stream being written to :param to_write: the bytes being written """ + if isinstance(to_write, str): + to_write = to_write.encode() + try: stream.buffer.write(to_write) except BrokenPipeError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/cmd2.egg-info/PKG-INFO new/cmd2-2.4.3/cmd2.egg-info/PKG-INFO --- old/cmd2-2.4.2/cmd2.egg-info/PKG-INFO 2022-07-13 17:55:20.000000000 +0200 +++ new/cmd2-2.4.3/cmd2.egg-info/PKG-INFO 2023-01-28 01:50:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cmd2 -Version: 2.4.2 +Version: 2.4.3 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 @@ -34,18 +34,19 @@ [](https://pypi.python.org/pypi/cmd2/) [](https://github.com/python-cmd2/cmd2/actions?query=workflow%3ACI) -[](https://python-cmd2.visualstudio.com/cmd2/_build/latest?definitionId=1&branch=master) [](https://codecov.io/gh/python-cmd2/cmd2) [](http://cmd2.readthedocs.io/en/latest/?badge=latest) <a href="https://discord.gg/RpVG6tk"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"></a> <p align="center"> - <a href="#main-features">Main Features</a> ⢠+ <a href="#the-developers-toolbox">Develper's Toolbox</a> ⢠+ <a href="#philosophy">Philosophy</a> ⢠<a href="#installation">Installation</a> ⢠+ <a href="#documentation">Documentation</a> ⢠<a href="#tutorials">Tutorials</a> ⢠+ <a href="#hello-world">Hello World</a> ⢠<a href="#projects-using-cmd2">Projects using cmd2</a> ⢠- <a href="#version-two-notes">Version 2.0 Notes</a> </p> [](https://youtu.be/DDU_JH6cFsA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/cmd2.egg-info/SOURCES.txt new/cmd2-2.4.3/cmd2.egg-info/SOURCES.txt --- old/cmd2-2.4.2/cmd2.egg-info/SOURCES.txt 2022-07-13 17:55:21.000000000 +0200 +++ new/cmd2-2.4.3/cmd2.egg-info/SOURCES.txt 2023-01-28 01:50:00.000000000 +0100 @@ -107,6 +107,7 @@ examples/async_printing.py examples/basic.py examples/basic_completion.py +examples/cmd2_history.dat examples/cmd_as_argument.py examples/colors.py examples/custom_parser.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/cmd2.egg-info/requires.txt new/cmd2-2.4.3/cmd2.egg-info/requires.txt --- old/cmd2-2.4.2/cmd2.egg-info/requires.txt 2022-07-13 17:55:21.000000000 +0200 +++ new/cmd2-2.4.3/cmd2.egg-info/requires.txt 2023-01-28 01:50:00.000000000 +0100 @@ -14,7 +14,7 @@ doc8 flake8 invoke -mypy==0.902 +mypy nox pytest>=4.6 pytest-cov @@ -36,5 +36,5 @@ [validate] flake8 -mypy==0.902 +mypy types-pkg-resources diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/docs/api/utils.rst new/cmd2-2.4.3/docs/api/utils.rst --- old/cmd2-2.4.2/docs/api/utils.rst 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/docs/api/utils.rst 2022-11-09 21:21:52.000000000 +0100 @@ -88,7 +88,7 @@ Miscellaneous ------------- -.. autofunction:: cmd2.utils.str_to_bool +.. autofunction:: cmd2.utils.to_bool .. autofunction:: cmd2.utils.categorize Binary files old/cmd2-2.4.2/examples/cmd2_history.dat and new/cmd2-2.4.3/examples/cmd2_history.dat differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/noxfile.py new/cmd2-2.4.3/noxfile.py --- old/cmd2-2.4.2/noxfile.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/noxfile.py 2023-01-28 01:25:05.000000000 +0100 @@ -17,7 +17,7 @@ ) [email protected](python=['3.6', '3.7', '3.8', '3.9', '3.10']) [email protected](python=['3.7', '3.8', '3.9', '3.10', '3.11']) @nox.parametrize('plugin', [None, 'ext_test', 'template', 'coverage']) def tests(session, plugin): if plugin is None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/plugins/template/README.md new/cmd2-2.4.3/plugins/template/README.md --- old/cmd2-2.4.2/plugins/template/README.md 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/plugins/template/README.md 2023-01-28 01:25:05.000000000 +0100 @@ -298,8 +298,9 @@ ### Use nox to run unit tests in multiple versions of python -The included `noxfile.py` is setup to run the unit tests in python 3.6, 3.7, 3.8, -and 3.9. You can run your unit tests in all of these versions of python by: +The included `noxfile.py` is setup to run the unit tests in python 3.7, 3.8, +3.9, 3.10, and 3.11 You can run your unit tests in all of these versions of +python by: ``` $ nox ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/plugins/template/build-pyenvs.sh new/cmd2-2.4.3/plugins/template/build-pyenvs.sh --- old/cmd2-2.4.2/plugins/template/build-pyenvs.sh 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/plugins/template/build-pyenvs.sh 2023-01-28 01:25:05.000000000 +0100 @@ -23,7 +23,7 @@ # virtualenvs will be added to '.python-version'. Feel free to modify # this list, but note that this script intentionally won't install # dev, rc, or beta python releases -declare -a pythons=("3.7" "3.6" "3.8" "3.9") +declare -a pythons=("3.7" "3.8" "3.9" "3.10" "3.11") # function to find the latest patch of a minor version of python function find_latest_version { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/plugins/template/noxfile.py new/cmd2-2.4.3/plugins/template/noxfile.py --- old/cmd2-2.4.2/plugins/template/noxfile.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/plugins/template/noxfile.py 2023-01-28 01:25:05.000000000 +0100 @@ -1,7 +1,7 @@ import nox [email protected](python=['3.6', '3.7', '3.8', '3.9']) [email protected](python=['3.7', '3.8', '3.9', '3.10', '3.11']) def tests(session): session.install('invoke', './[test]') session.run('invoke', 'pytest', '--junit', '--no-pty') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/plugins/template/setup.py new/cmd2-2.4.3/plugins/template/setup.py --- old/cmd2-2.4.2/plugins/template/setup.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/plugins/template/setup.py 2023-01-28 01:25:05.000000000 +0100 @@ -39,6 +39,7 @@ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], # dependencies for development and testing # $ pip install -e .[dev] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/setup.cfg new/cmd2-2.4.3/setup.cfg --- old/cmd2-2.4.2/setup.cfg 2022-07-13 17:55:21.588835000 +0200 +++ new/cmd2-2.4.3/setup.cfg 2023-01-28 01:50:00.786195800 +0100 @@ -9,7 +9,7 @@ [flake8] count = True -ignore = E203,E231,W503 # E231 can be removed once black is fixed. +ignore = E203,W503 max-complexity = 26 max-line-length = 127 show-source = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/setup.py new/cmd2-2.4.3/setup.py --- old/cmd2-2.4.2/setup.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/setup.py 2022-11-01 20:26:39.000000000 +0100 @@ -68,7 +68,7 @@ 'doc8', 'flake8', 'invoke', - 'mypy==0.902', + 'mypy', 'nox', "pytest>=4.6", 'pytest-cov', @@ -80,7 +80,7 @@ ], 'validate': [ 'flake8', - 'mypy==0.902', + 'mypy', 'types-pkg-resources', ], } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/tasks.py new/cmd2-2.4.3/tasks.py --- old/cmd2-2.4.2/tasks.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/tasks.py 2022-11-01 20:26:39.000000000 +0100 @@ -353,3 +353,14 @@ namespace.add_task(flake8) + + +# Black and isort auto-formatting [email protected]() +def format(context): + """Run black and isort auto-formatting for code style enforcement""" + with context.cd(TASK_ROOT_STR): + context.run("black . && isort .") + + +namespace.add_task(format) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/tests/test_cmd2.py new/cmd2-2.4.3/tests/test_cmd2.py --- old/cmd2-2.4.2/tests/test_cmd2.py 2022-04-13 20:11:38.000000000 +0200 +++ new/cmd2-2.4.3/tests/test_cmd2.py 2023-01-28 01:25:05.000000000 +0100 @@ -1454,7 +1454,7 @@ assert read_input_mock.call_count == 2 -def test_select_ctrl_c(outsim_app, monkeypatch, capsys): +def test_select_ctrl_c(outsim_app, monkeypatch): # Ctrl-C during select prints ^C and raises a KeyboardInterrupt read_input_mock = mock.MagicMock(name='read_input', side_effect=KeyboardInterrupt) monkeypatch.setattr("cmd2.Cmd.read_input", read_input_mock) @@ -2866,3 +2866,12 @@ transcript_files = ['foo', 'bar'] app = cmd2.Cmd(allow_cli_args=False, transcript_files=transcript_files) assert app._transcript_files == transcript_files + + +def test_columnize_too_wide(outsim_app): + """Test calling columnize with output that wider than display_width""" + str_list = ["way too wide", "much wider than the first"] + outsim_app.columnize(str_list, display_width=5) + + expected = "\n".join(str_list) + "\n" + assert outsim_app.stdout.getvalue() == expected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmd2-2.4.2/tests/test_utils.py new/cmd2-2.4.3/tests/test_utils.py --- old/cmd2-2.4.2/tests/test_utils.py 2022-03-18 18:10:38.000000000 +0100 +++ new/cmd2-2.4.3/tests/test_utils.py 2022-11-09 21:21:52.000000000 +0100 @@ -824,28 +824,41 @@ assert aligned == fill_char + ' ' + text -def test_str_to_bool_true(): - assert cu.str_to_bool('true') - assert cu.str_to_bool('True') - assert cu.str_to_bool('TRUE') - assert cu.str_to_bool('tRuE') +def test_to_bool_str_true(): + assert cu.to_bool('true') + assert cu.to_bool('True') + assert cu.to_bool('TRUE') + assert cu.to_bool('tRuE') -def test_str_to_bool_false(): - assert not cu.str_to_bool('false') - assert not cu.str_to_bool('False') - assert not cu.str_to_bool('FALSE') - assert not cu.str_to_bool('fAlSe') +def test_to_bool_str_false(): + assert not cu.to_bool('false') + assert not cu.to_bool('False') + assert not cu.to_bool('FALSE') + assert not cu.to_bool('fAlSe') -def test_str_to_bool_invalid(): +def test_to_bool_str_invalid(): with pytest.raises(ValueError): - cu.str_to_bool('other') + cu.to_bool('other') -def test_str_to_bool_bad_input(): - with pytest.raises(ValueError): - cu.str_to_bool(1) +def test_to_bool_bool(): + assert cu.to_bool(True) + assert not cu.to_bool(False) + + +def test_to_bool_int(): + assert cu.to_bool(1) + assert cu.to_bool(-1) + assert not cu.to_bool(0) + + +def test_to_bool_float(): + assert cu.to_bool(2.35) + assert cu.to_bool(0.25) + assert cu.to_bool(-3.1415) + assert not cu.to_bool(0) def test_find_editor_specified():
