Hello community, here is the log from the commit of package python-cli-helpers for openSUSE:Factory checked in at 2019-06-18 14:58:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cli-helpers (Old) and /work/SRC/openSUSE:Factory/.python-cli-helpers.new.4811 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cli-helpers" Tue Jun 18 14:58:22 2019 rev:3 rq:710334 version:1.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cli-helpers/python-cli-helpers.changes 2019-06-13 23:01:33.587508774 +0200 +++ /work/SRC/openSUSE:Factory/.python-cli-helpers.new.4811/python-cli-helpers.changes 2019-06-18 14:58:36.965321891 +0200 @@ -1,0 +2,8 @@ +Mon Jun 17 11:18:18 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 1.2.1: + * Work with new pygments +- Remove merged patch: + * pygments.patch + +------------------------------------------------------------------- Old: ---- cli_helpers-1.2.0.tar.gz pygments.patch New: ---- cli_helpers-1.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cli-helpers.spec ++++++ --- /var/tmp/diff_new_pack.R4t48d/_old 2019-06-18 14:58:37.833321392 +0200 +++ /var/tmp/diff_new_pack.R4t48d/_new 2019-06-18 14:58:37.837321390 +0200 @@ -18,14 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-cli-helpers -Version: 1.2.0 +Version: 1.2.1 Release: 0 Summary: Helpers for building command-line apps License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/dbcli/cli_helpers Source: https://files.pythonhosted.org/packages/source/c/cli_helpers/cli_helpers-%{version}.tar.gz -Patch0: pygments.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -68,7 +67,6 @@ %prep %setup -q -n cli_helpers-%{version} -%patch0 -p1 %build %python_build ++++++ cli_helpers-1.2.0.tar.gz -> cli_helpers-1.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/CHANGELOG new/cli_helpers-1.2.1/CHANGELOG --- old/cli_helpers-1.2.0/CHANGELOG 2019-04-06 01:54:13.000000000 +0200 +++ new/cli_helpers-1.2.1/CHANGELOG 2019-06-10 13:30:21.000000000 +0200 @@ -1,6 +1,16 @@ Changelog ========= +Version 1.2.1 +------------- + +(released on 2019-06-09) + +* Pin Pygments to >= 2.4.0 for tests. +* Remove Python 3.4 from tests and Trove classifier. +* Add an option to skip truncating multi-line strings. +* When truncating long strings, add ellipsis. + Version 1.2.0 ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/PKG-INFO new/cli_helpers-1.2.1/PKG-INFO --- old/cli_helpers-1.2.0/PKG-INFO 2019-04-06 02:01:19.000000000 +0200 +++ new/cli_helpers-1.2.1/PKG-INFO 2019-06-10 13:33:31.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cli_helpers -Version: 1.2.0 +Version: 1.2.1 Summary: Helpers for building command-line apps Home-page: https://github.com/dbcli/cli_helpers Author: dbcli @@ -52,7 +52,6 @@ Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/cli_helpers/__init__.py new/cli_helpers-1.2.1/cli_helpers/__init__.py --- old/cli_helpers-1.2.0/cli_helpers/__init__.py 2019-04-06 01:54:37.000000000 +0200 +++ new/cli_helpers-1.2.1/cli_helpers/__init__.py 2019-06-10 13:30:21.000000000 +0200 @@ -1 +1 @@ -__version__ = '1.2.0' +__version__ = '1.2.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/cli_helpers/tabular_output/preprocessors.py new/cli_helpers-1.2.1/cli_helpers/tabular_output/preprocessors.py --- old/cli_helpers-1.2.0/cli_helpers/tabular_output/preprocessors.py 2019-04-06 01:49:19.000000000 +0200 +++ new/cli_helpers-1.2.1/cli_helpers/tabular_output/preprocessors.py 2019-06-09 13:52:10.000000000 +0200 @@ -8,7 +8,7 @@ HAS_PYGMENTS, Terminal256Formatter, StringIO) -def truncate_string(data, headers, max_field_width=None, **_): +def truncate_string(data, headers, max_field_width=None, skip_multiline_string=True, **_): """Truncate very long strings. Only needed for tabular representation, because trying to tabulate very long data is problematic in terms of performance, and does not make any @@ -20,8 +20,8 @@ :return: The processed data and headers. :rtype: tuple """ - return (([utils.truncate_string(v, max_field_width) for v in row] for row in data), - [utils.truncate_string(h, max_field_width) for h in headers]) + return (([utils.truncate_string(v, max_field_width, skip_multiline_string) for v in row] for row in data), + [utils.truncate_string(h, max_field_width, skip_multiline_string) for h in headers]) def convert_to_string(data, headers, **_): @@ -193,7 +193,7 @@ class YourStyle(Style): default_style = "" styles = { - Token.Output.Header: 'bold #ansired', + Token.Output.Header: 'bold ansibrightred', Token.Output.OddRow: 'bg:#eee #111', Token.Output.EvenRow: '#0f0' } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/cli_helpers/utils.py new/cli_helpers-1.2.1/cli_helpers/utils.py --- old/cli_helpers-1.2.0/cli_helpers/utils.py 2019-03-26 17:06:31.000000000 +0100 +++ new/cli_helpers-1.2.1/cli_helpers/utils.py 2019-06-09 13:52:10.000000000 +0200 @@ -29,10 +29,12 @@ return text_type(value) -def truncate_string(value, max_width=None): +def truncate_string(value, max_width=None, skip_multiline_string=True): """Truncate string values.""" - if isinstance(value, text_type) and max_width is not None and len(value) > max_width: - return value[:max_width] + if skip_multiline_string and isinstance(value, text_type) and '\n' in value: + return value + elif isinstance(value, text_type) and max_width is not None and len(value) > max_width: + return value[:max_width-3] + "..." return value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/cli_helpers.egg-info/PKG-INFO new/cli_helpers-1.2.1/cli_helpers.egg-info/PKG-INFO --- old/cli_helpers-1.2.0/cli_helpers.egg-info/PKG-INFO 2019-04-06 02:01:19.000000000 +0200 +++ new/cli_helpers-1.2.1/cli_helpers.egg-info/PKG-INFO 2019-06-10 13:33:30.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cli-helpers -Version: 1.2.0 +Version: 1.2.1 Summary: Helpers for building command-line apps Home-page: https://github.com/dbcli/cli_helpers Author: dbcli @@ -52,7 +52,6 @@ Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/requirements-dev.txt new/cli_helpers-1.2.1/requirements-dev.txt --- old/cli_helpers-1.2.0/requirements-dev.txt 2018-12-02 01:49:53.000000000 +0100 +++ new/cli_helpers-1.2.1/requirements-dev.txt 2019-05-25 22:02:09.000000000 +0200 @@ -3,6 +3,7 @@ coverage==4.3.4 mock==2.0.0 pep8radius +Pygments>=2.4.0 pytest==3.0.7 pytest-cov==2.4.0 Sphinx==1.5.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/setup.py new/cli_helpers-1.2.1/setup.py --- old/cli_helpers-1.2.0/setup.py 2018-12-02 01:49:53.000000000 +0100 +++ new/cli_helpers-1.2.1/setup.py 2019-05-25 22:02:09.000000000 +0200 @@ -54,7 +54,6 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/tests/tabular_output/test_preprocessors.py new/cli_helpers-1.2.1/tests/tabular_output/test_preprocessors.py --- old/cli_helpers-1.2.0/tests/tabular_output/test_preprocessors.py 2019-04-06 01:49:19.000000000 +0200 +++ new/cli_helpers-1.2.1/tests/tabular_output/test_preprocessors.py 2019-06-09 13:52:10.000000000 +0200 @@ -154,14 +154,14 @@ class CliStyle(Style): default_style = "" styles = { - Token.Output.Header: 'bold #ansired', + Token.Output.Header: 'bold ansibrightred', Token.Output.OddRow: 'bg:#eee #111', Token.Output.EvenRow: '#0f0' } headers = ['h1', 'h2'] data = [['观音', '2'], ['Ποσειδῶν', 'b']] - expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m'] + expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m'] expected_data = [['\x1b[38;5;233;48;5;7m观音\x1b[39;49m', '\x1b[38;5;233;48;5;7m2\x1b[39;49m'], ['\x1b[38;5;10mΠοσειδῶν\x1b[39m', '\x1b[38;5;10mb\x1b[39m']] @@ -176,14 +176,14 @@ class CliStyle(Style): default_style = "" styles = { - Token.Output.Header: 'bold #ansired', + Token.Output.Header: 'bold ansibrightred', Token.Output.OddRow: 'bg:#eee #111', Token.Output.EvenRow: '#0f0' } headers = ['h1', 'h2'] data = [['观音\nLine2', 'Ποσειδῶν']] - expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m'] + expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m'] expected_data = [ ['\x1b[38;5;233;48;5;7m观音\x1b[39;49m\n\x1b[38;5;233;48;5;7m' 'Line2\x1b[39;49m', @@ -200,14 +200,14 @@ class CliStyle(Style): default_style = "" styles = { - Token.Results.Headers: 'bold #ansired', + Token.Results.Headers: 'bold ansibrightred', Token.Results.OddRows: 'bg:#eee #111', Token.Results.EvenRows: '#0f0' } headers = ['h1', 'h2'] data = [['1', '2'], ['a', 'b']] - expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m'] + expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m'] expected_data = [['\x1b[38;5;233;48;5;7m1\x1b[39;49m', '\x1b[38;5;233;48;5;7m2\x1b[39;49m'], ['\x1b[38;5;10ma\x1b[39m', '\x1b[38;5;10mb\x1b[39m']] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/tests/tabular_output/test_tabulate_adapter.py new/cli_helpers-1.2.1/tests/tabular_output/test_tabulate_adapter.py --- old/cli_helpers-1.2.0/tests/tabular_output/test_tabulate_adapter.py 2018-08-06 23:52:52.000000000 +0200 +++ new/cli_helpers-1.2.1/tests/tabular_output/test_tabulate_adapter.py 2019-06-09 13:52:10.000000000 +0200 @@ -63,7 +63,7 @@ class CliStyle(Style): default_style = "" styles = { - Token.Output.TableSeparator: '#ansired', + Token.Output.TableSeparator: 'ansibrightred', } headers = ['h1', 'h2'] data = [['观音', '2'], ['Ποσειδῶν', 'b']] @@ -73,24 +73,24 @@ output = tabulate_adapter.adapter(iter(data), headers, table_format='psql') assert "\n".join(output) == dedent('''\ - \x1b[31;01m+\x1b[39;00m''' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 6)) + - '''\x1b[31;01m+\x1b[39;00m - \x1b[31;01m|\x1b[39;00m h1 \x1b[31;01m|\x1b[39;00m''' + - ''' h2 \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m|\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 6)) + - '''\x1b[31;01m|\x1b[39;00m - \x1b[31;01m|\x1b[39;00m 观音 \x1b[31;01m|\x1b[39;00m''' + - ''' 2 \x1b[31;01m|\x1b[39;00m - \x1b[31;01m|\x1b[39;00m Ποσειδῶν \x1b[31;01m|\x1b[39;00m''' + - ''' b \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m+\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 6)) + - '\x1b[31;01m+\x1b[39;00m') + \x1b[91m+\x1b[39m''' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 6)) + + '''\x1b[91m+\x1b[39m + \x1b[91m|\x1b[39m h1 \x1b[91m|\x1b[39m''' + + ''' h2 \x1b[91m|\x1b[39m + ''' + '\x1b[91m|\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 6)) + + '''\x1b[91m|\x1b[39m + \x1b[91m|\x1b[39m 观音 \x1b[91m|\x1b[39m''' + + ''' 2 \x1b[91m|\x1b[39m + \x1b[91m|\x1b[39m Ποσειδῶν \x1b[91m|\x1b[39m''' + + ''' b \x1b[91m|\x1b[39m + ''' + '\x1b[91m+\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 6)) + + '\x1b[91m+\x1b[39m') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/tests/tabular_output/test_terminaltables_adapter.py new/cli_helpers-1.2.1/tests/tabular_output/test_terminaltables_adapter.py --- old/cli_helpers-1.2.0/tests/tabular_output/test_terminaltables_adapter.py 2018-08-06 23:52:52.000000000 +0200 +++ new/cli_helpers-1.2.1/tests/tabular_output/test_terminaltables_adapter.py 2019-06-09 13:52:10.000000000 +0200 @@ -36,7 +36,7 @@ class CliStyle(Style): default_style = "" styles = { - Token.Output.TableSeparator: '#ansired', + Token.Output.TableSeparator: 'ansibrightred', } headers = ['h1', 'h2'] data = [['观音', '2'], ['Ποσειδῶν', 'b']] @@ -46,24 +46,24 @@ output = terminaltables_adapter.adapter(iter(data), headers, table_format='ascii') assert "\n".join(output) == dedent('''\ - \x1b[31;01m+\x1b[39;00m''' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 4)) + - '''\x1b[31;01m+\x1b[39;00m - \x1b[31;01m|\x1b[39;00m h1 \x1b[31;01m|\x1b[39;00m''' + - ''' h2 \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m+\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 4)) + - '''\x1b[31;01m+\x1b[39;00m - \x1b[31;01m|\x1b[39;00m 观音 \x1b[31;01m|\x1b[39;00m''' + - ''' 2 \x1b[31;01m|\x1b[39;00m - \x1b[31;01m|\x1b[39;00m Ποσειδῶν \x1b[31;01m|\x1b[39;00m''' + - ''' b \x1b[31;01m|\x1b[39;00m - ''' + '\x1b[31;01m+\x1b[39;00m' + ( - ('\x1b[31;01m-\x1b[39;00m' * 10) + - '\x1b[31;01m+\x1b[39;00m' + - ('\x1b[31;01m-\x1b[39;00m' * 4)) + - '\x1b[31;01m+\x1b[39;00m') + \x1b[91m+\x1b[39m''' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 4)) + + '''\x1b[91m+\x1b[39m + \x1b[91m|\x1b[39m h1 \x1b[91m|\x1b[39m''' + + ''' h2 \x1b[91m|\x1b[39m + ''' + '\x1b[91m+\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 4)) + + '''\x1b[91m+\x1b[39m + \x1b[91m|\x1b[39m 观音 \x1b[91m|\x1b[39m''' + + ''' 2 \x1b[91m|\x1b[39m + \x1b[91m|\x1b[39m Ποσειδῶν \x1b[91m|\x1b[39m''' + + ''' b \x1b[91m|\x1b[39m + ''' + '\x1b[91m+\x1b[39m' + ( + ('\x1b[91m-\x1b[39m' * 10) + + '\x1b[91m+\x1b[39m' + + ('\x1b[91m-\x1b[39m' * 4)) + + '\x1b[91m+\x1b[39m') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/tests/test_utils.py new/cli_helpers-1.2.1/tests/test_utils.py --- old/cli_helpers-1.2.0/tests/test_utils.py 2019-03-26 17:06:31.000000000 +0100 +++ new/cli_helpers-1.2.1/tests/test_utils.py 2019-06-09 13:52:10.000000000 +0200 @@ -35,8 +35,19 @@ def test_truncate_string(): """Test string truncate preprocessor.""" - val = 'x' * 1000 - assert utils.truncate_string(val, 10) == 'x' * 10 + val = 'x' * 100 + assert utils.truncate_string(val, 10) == 'xxxxxxx...' + + val = 'x ' * 100 + assert utils.truncate_string(val, 10) == 'x x x x...' + + val = 'x' * 100 + assert utils.truncate_string(val) == 'x' * 100 + + val = ['x'] * 100 + val[20] = '\n' + str_val = ''.join(val) + assert utils.truncate_string(str_val, 10, skip_multiline_string=True) == str_val def test_intlen_with_decimal(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli_helpers-1.2.0/tox.ini new/cli_helpers-1.2.1/tox.ini --- old/cli_helpers-1.2.0/tox.ini 2018-12-02 01:49:53.000000000 +0100 +++ new/cli_helpers-1.2.1/tox.ini 2019-05-25 22:02:10.000000000 +0200 @@ -1,5 +1,5 @@ [tox] -envlist = cov-init, py27, py34, py35, py36, py37, noextras, docs, packaging, cov-report +envlist = cov-init, py27, py35, py36, py37, noextras, docs, packaging, cov-report [testenv] passenv = CI TRAVIS TRAVIS_* CODECOV