Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-cliff for openSUSE:Factory checked in at 2026-11-18 18:30:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cliff (Old) and /work/SRC/openSUSE:Factory/.python-cliff.new.1251 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cliff" Wed Nov 18 18:30:19 2026 rev:55 rq:1398235 version:4.17.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cliff/python-cliff.changes 2026-09-08 16:56:46.980647672 +0200 +++ /work/SRC/openSUSE:Factory/.python-cliff.new.1251/python-cliff.changes 2026-11-18 18:31:00.004443092 +0100 @@ -1,0 +2,15 @@ +Tue Nov 17 17:17:37 UTC 2026 - Dirk Müller <[email protected]> + +- fix requires + +------------------------------------------------------------------- +Sun Nov 8 17:59:05 UTC 2026 - Dirk Müller <[email protected]> + +- update to 4.17.0: + * Add ShowOneWithDetails for field-oriented tables + * Add release notes build + * Move dependencies to pyproject.toml + * Normalize sort column names + * Gracefully handle metadata + +------------------------------------------------------------------- Old: ---- cliff-4.16.0.tar.gz New: ---- cliff-4.17.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cliff.spec ++++++ --- /var/tmp/diff_new_pack.1vO3Hc/_old 2026-11-18 18:31:01.195493551 +0100 +++ /var/tmp/diff_new_pack.1vO3Hc/_new 2026-11-18 18:31:01.196493593 +0100 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-cliff -Version: 4.16.0 +Version: 4.17.0 Release: 0 Summary: Command Line Interface Formulation Framework License: Apache-2.0 @@ -33,19 +33,19 @@ BuildRequires: %{python_module PrettyTable >= 0.7.2} BuildRequires: %{python_module PyYAML >= 3.12} BuildRequires: %{python_module Sphinx >= 5.0.0} -BuildRequires: %{python_module cmd2 >= 3.0.0} +BuildRequires: %{python_module cmd2 >= 4.0.0} BuildRequires: %{python_module coverage >= 5.0} BuildRequires: %{python_module fixtures >= 3.0.0} BuildRequires: %{python_module pytest} BuildRequires: %{python_module stevedore >= 5.6.0} BuildRequires: %{python_module testscenarios >= 0.4} -BuildRequires: %{python_module testtools >= 2.2.0} +BuildRequires: %{python_module testtools >= 2.8.0} # /SECTION BuildRequires: fdupes Requires: python-PrettyTable >= 0.7.2 Requires: python-PyYAML >= 3.12 Requires: python-autopage >= 0.4.0 -Requires: python-cmd2 >= 3.0.0 +Requires: python-cmd2 >= 4.0.0 Requires: python-stevedore >= 5.6.0 BuildArch: noarch %python_subpackages ++++++ cliff-4.16.0.tar.gz -> cliff-4.17.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/.pre-commit-config.yaml new/cliff-4.17.0/.pre-commit-config.yaml --- old/cliff-4.16.0/.pre-commit-config.yaml 2026-08-24 16:02:20.106734000 +0200 +++ new/cliff-4.17.0/.pre-commit-config.yaml 2026-10-22 10:34:14.317400000 +0200 @@ -15,7 +15,7 @@ files: .*\.(yaml|yml)$ exclude: '^zuul.d/.*$' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.18 + rev: v0.17.0 hooks: - id: ruff-check args: ['--fix', '--unsafe-fixes'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/.zuul.yaml new/cliff-4.17.0/.zuul.yaml --- old/cliff-4.16.0/.zuul.yaml 2026-08-24 16:02:20.106734000 +0200 +++ new/cliff-4.17.0/.zuul.yaml 2026-10-22 10:34:14.318399200 +0200 @@ -28,6 +28,7 @@ - openstack-python3-jobs - openstack-python3-next-jobs - publish-openstack-docs-pti + - release-notes-jobs-python3 check: jobs: - cliff-tox-py313-neutronclient-tip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/AUTHORS new/cliff-4.17.0/AUTHORS --- old/cliff-4.16.0/AUTHORS 2026-08-24 16:02:58.809058700 +0200 +++ new/cliff-4.17.0/AUTHORS 2026-10-22 10:34:59.949986200 +0200 @@ -120,6 +120,7 @@ qneill <[email protected]> shizhihui <[email protected]> songwenping <[email protected]> +t.hosseini <[email protected]> wu.chunyang <[email protected]> xuanyandong <[email protected]> yanpuqing <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/ChangeLog new/cliff-4.17.0/ChangeLog --- old/cliff-4.16.0/ChangeLog 2026-08-24 16:02:58.788058500 +0200 +++ new/cliff-4.17.0/ChangeLog 2026-10-22 10:34:59.896954300 +0200 @@ -1,6 +1,15 @@ CHANGES ======= +4.17.0 +------ + +* Add ShowOneWithDetails for field-oriented tables +* Add release notes build +* Move dependencies to pyproject.toml +* Normalize sort column names +* Gracefully handle metadata + 4.16.0 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/PKG-INFO new/cliff-4.17.0/PKG-INFO --- old/cliff-4.16.0/PKG-INFO 2026-08-24 16:02:58.842059000 +0200 +++ new/cliff-4.17.0/PKG-INFO 2026-10-22 10:35:00.049043000 +0200 @@ -1,15 +1,14 @@ Metadata-Version: 2.4 Name: cliff -Version: 4.16.0 +Version: 4.17.0 Summary: Command Line Interface Formulation Framework Author-email: OpenStack <[email protected]> -License: Apache-2.0 +License-Expression: Apache-2.0 Project-URL: Homepage, https://docs.openstack.org/cliff/ Project-URL: Repository, https://opendev.org/openstack/cliff/ Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Console Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 @@ -24,13 +23,12 @@ Requires-Dist: autopage>=0.4.0 Requires-Dist: cmd2>=4.0.0 Requires-Dist: PrettyTable>=0.7.2 -Requires-Dist: stevedore>=5.6.0 Requires-Dist: PyYAML>=3.12 +Requires-Dist: stevedore>=5.6.0 Provides-Extra: sphinxext -Requires-Dist: sphinx>=9.0.4; extra == "sphinxext" Requires-Dist: docutils>=0.21.2; extra == "sphinxext" +Requires-Dist: sphinx>=9.0.4; extra == "sphinxext" Dynamic: license-file -Dynamic: requires-dist ======================== Team and repository tags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff/command.py new/cliff-4.17.0/cliff/command.py --- old/cliff-4.16.0/cliff/command.py 2026-08-24 16:02:20.107734000 +0200 +++ new/cliff-4.17.0/cliff/command.py 2026-10-22 10:34:14.319398400 +0200 @@ -42,7 +42,14 @@ if _dists_by_mods is None: # There can be multiple distribution in the case of namespace packages # so we'll just grab the first one - _dists_by_mods = {k: v[0] for k, v in packages_distributions().items()} + try: + _dists_by_mods = { + k: v[0] for k, v in packages_distributions().items() + } + except FileNotFoundError: + # MetadataNotFound is only available in Python 3.15+ + # https://docs.python.org/3.15/library/importlib.metadata.html + _dists_by_mods = {} return _dists_by_mods diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff/display.py new/cliff-4.17.0/cliff/display.py --- old/cliff-4.16.0/cliff/display.py 2026-08-24 16:02:20.108734000 +0200 +++ new/cliff-4.17.0/cliff/display.py 2026-10-22 10:34:14.319398400 +0200 @@ -135,12 +135,13 @@ if not parsed_args.columns: return list(column_names), None - def normalize_column(column_name: str) -> str: - return column_name.lower().strip().replace(' ', '_') - - requested_columns = [normalize_column(c) for c in parsed_args.columns] + requested_columns = [ + self._normalize_column_name(c) for c in parsed_args.columns + ] columns_to_include = [ - c for c in column_names if normalize_column(c) in requested_columns + c + for c in column_names + if self._normalize_column_name(c) in requested_columns ] if not columns_to_include: raise ValueError( @@ -152,6 +153,10 @@ selector = [(c in columns_to_include) for c in column_names] return columns_to_include, selector + @staticmethod + def _normalize_column_name(column_name: str) -> str: + return column_name.lower().strip().replace(' ', '_') + def run(self, parsed_args: argparse.Namespace) -> int: parsed_args = self._run_before_hooks(parsed_args) formatter = self._formatter_plugins[parsed_args.formatter].obj diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff/lister.py new/cliff-4.17.0/cliff/lister.py --- old/cliff-4.16.0/cliff/lister.py 2026-08-24 16:02:20.109734000 +0200 +++ new/cliff-4.17.0/cliff/lister.py 2026-10-22 10:34:14.321396800 +0200 @@ -69,7 +69,8 @@ help=( 'specify the column(s) to sort the data (columns specified ' 'first have a priority, non-existing columns are ignored), ' - 'can be repeated' + 'column names are case-insensitive and accept underscores ' + 'for spaces, can be repeated' ), ) sort_dir_group = group.add_mutually_exclusive_group() @@ -96,11 +97,20 @@ data: Iterable[Sequence[Any]], ) -> int: if parsed_args.sort_columns and self.need_sort_by_cliff: - indexes = [ - column_names.index(c) - for c in parsed_args.sort_columns - if c in column_names + normalized_column_names = [ + self._normalize_column_name(c) for c in column_names ] + indexes = [] + for column in parsed_args.sort_columns: + if column in column_names: + indexes.append(column_names.index(column)) + continue + + normalized_column = self._normalize_column_name(column) + if normalized_column in normalized_column_names: + indexes.append( + normalized_column_names.index(normalized_column) + ) reverse = parsed_args.sort_direction == 'desc' for index in indexes[::-1]: try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff/show.py new/cliff-4.17.0/cliff/show.py --- old/cliff-4.16.0/cliff/show.py 2026-08-24 16:02:20.109734000 +0200 +++ new/cliff-4.17.0/cliff/show.py 2026-10-22 10:34:14.321396800 +0200 @@ -71,3 +71,54 @@ return ((), ()) else: return (tuple(data.keys()), tuple(data.values())) + + +class ShowOneWithDetails( + display.DisplayCommandBase[base_formatters.ListFormatter], + metaclass=abc.ABCMeta, +): + """Display a single object's fields with additional columns. + + Each row starts with a field name, followed by its value and any + additional details. The ``-c`` option selects fields (rows), not output + columns. Output is rendered using list formatters. + """ + + @property + def formatter_namespace(self) -> str: + return 'cliff.formatter.list' + + @property + def formatter_default(self) -> str: + return 'table' + + @abc.abstractmethod + def take_action( + self, parsed_args: argparse.Namespace + ) -> tuple[Sequence[str], Iterable[Sequence[Any]]]: + """Return output column names and an iterable of field rows. + + The first item in each row must be a string containing the field + name used for selection with ``-c``. The remaining items contain + the field's value and additional details, in column order. + """ + + def produce_output( + self, + parsed_args: argparse.Namespace, + column_names: Sequence[str], + data: Iterable[Sequence[Any]], + ) -> int: + if parsed_args.columns: + rows = list(data) + field_names = [row[0] for row in rows] + _, selector = self._generate_columns_and_selector( + parsed_args, field_names + ) + if selector: + data = self._compress_iterable(rows, selector) + + self.formatter.emit_list( + column_names, data, self.app.stdout, parsed_args + ) + return 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff/tests/test_lister.py new/cliff-4.17.0/cliff/tests/test_lister.py --- old/cliff-4.16.0/cliff/tests/test_lister.py 2026-08-24 16:02:20.112734000 +0200 +++ new/cliff-4.17.0/cliff/tests/test_lister.py 2026-10-22 10:34:14.327391900 +0200 @@ -118,6 +118,66 @@ data = list(args[1]) self.assertEqual([['a', 'A'], ['c', 'A'], ['b', 'B']], data) + def test_sort_by_column_normalized(self): + test_lister = ExerciseLister(mock.Mock(), None) + parsed_args = mock.Mock() + parsed_args.columns = ('Col1', 'Col2') + parsed_args.formatter = 'test' + parsed_args.sort_columns = ['col2', 'COL1'] + + test_lister.run(parsed_args) + + f = test_lister._formatter_plugins['test'] + assert isinstance(f, FauxFormatter) + args = f.args[0] + data = list(args[1]) + self.assertEqual([['a', 'A'], ['c', 'A'], ['b', 'B']], data) + + def test_sort_by_column_normalized_spaces(self): + test_lister = ExerciseLister(mock.Mock(), None) + parsed_args = mock.Mock() + parsed_args.columns = ('Column One', 'Column Two') + parsed_args.formatter = 'test' + parsed_args.sort_columns = ['column_two', 'column_one'] + + test_lister.run(parsed_args) + + f = test_lister._formatter_plugins['test'] + assert isinstance(f, FauxFormatter) + args = f.args[0] + data = list(args[1]) + self.assertEqual([['a', 'A'], ['c', 'A'], ['b', 'B']], data) + + def test_sort_by_column_normalized_whitespace(self): + test_lister = ExerciseLister(mock.Mock(), None) + parsed_args = mock.Mock() + parsed_args.columns = ('Column One', 'Column Two') + parsed_args.formatter = 'test' + parsed_args.sort_columns = [' column_two '] + + test_lister.run(parsed_args) + + f = test_lister._formatter_plugins['test'] + assert isinstance(f, FauxFormatter) + args = f.args[0] + data = list(args[1]) + self.assertEqual([['a', 'A'], ['c', 'A'], ['b', 'B']], data) + + def test_sort_by_column_exact_match_takes_priority(self): + test_lister = ExerciseLister(mock.Mock(), None) + parsed_args = mock.Mock() + parsed_args.columns = ('Column One', 'column_one') + parsed_args.formatter = 'test' + parsed_args.sort_columns = ['column_one'] + + test_lister.run(parsed_args) + + f = test_lister._formatter_plugins['test'] + assert isinstance(f, FauxFormatter) + args = f.args[0] + data = list(args[1]) + self.assertEqual([['a', 'A'], ['c', 'A'], ['b', 'B']], data) + def test_sort_by_column_reverse_order(self): test_lister = ExerciseLister(mock.Mock(), None) parsed_args = mock.Mock() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff/tests/test_show.py new/cliff-4.17.0/cliff/tests/test_show.py --- old/cliff-4.16.0/cliff/tests/test_show.py 2026-08-24 16:02:20.112734000 +0200 +++ new/cliff-4.17.0/cliff/tests/test_show.py 2026-10-22 10:34:14.327391900 +0200 @@ -29,7 +29,7 @@ return None def emit_one(self, columns, data, stdout, args): - self.args.append((columns, data)) + self.args.append((columns, data, stdout, args)) class ExerciseShowOne(show.ShowOne): @@ -62,6 +62,27 @@ self.assertEqual(list(parsed_args.columns), args[0]) data = list(args[1]) self.assertEqual([('a', 'A'), ('b', 'B')], data) + self.assertIs(app.stdout, args[2]) + self.assertIs(parsed_args, args[3]) + + def test_select_fields(self): + test_show = ExerciseShowOne(mock.Mock(), None) + parsed_args = mock.Mock() + parsed_args.columns = ('STATUS', ' RESOURCE_NAME ') + parsed_args.formatter = 'test' + with mock.patch.object(test_show, 'take_action') as mock_take_action: + mock_take_action.return_value = ( + ('Resource Name', 'Status', 'Region'), + ('demo', 'ACTIVE', 'RegionOne'), + ) + test_show.run(parsed_args) + + f = test_show._formatter_plugins['test'] + assert isinstance(f, FauxFormatter) + self.assertEqual(1, len(f.args)) + args = f.args[0] + self.assertEqual(['Resource Name', 'Status'], args[0]) + self.assertEqual(['demo', 'ACTIVE'], list(args[1])) def test_dict2columns(self): app = mock.Mock() @@ -80,3 +101,104 @@ mock_take_action.return_value = (('Col1', 'Col2', 'Col3'), []) with self.assertRaises(ValueError): test_show.run(parsed_args) + + +class FauxListFormatter(base_formatters.ListFormatter): + def __init__(self): + self.args = [] + self.obj = weakref.proxy(self) + + def add_argument_group(self, parser: argparse.ArgumentParser) -> None: + return None + + def emit_list(self, columns, data, stdout, args): + self.args.append((columns, data, stdout, args)) + + +class ExerciseShowOneWithDetails(show.ShowOneWithDetails): + columns: tuple[str, ...] = ('Field', 'Value', 'Description') + data: list[tuple[str, ...]] = [ + ('Resource Name', 'demo', 'Resource name'), + ('Status', 'ACTIVE', 'Current resource status'), + ('Region', 'RegionOne', 'Resource region'), + ] + + def _load_formatter_plugins(self): + return { + 'test': FauxListFormatter(), + } + + def take_action(self, parsed_args): + return (self.columns, iter(self.data)) + + +class TestShowOneWithDetails(base.TestBase): + def setUp(self): + super().setUp() + self.app = mock.Mock() + self.cmd = ExerciseShowOneWithDetails(self.app, None) + self.parsed_args = mock.Mock() + self.parsed_args.columns = [] + self.parsed_args.formatter = 'test' + + def test_formatter_configuration(self): + self.assertEqual('cliff.formatter.list', self.cmd.formatter_namespace) + self.assertEqual('table', self.cmd.formatter_default) + + def test_formatter_args(self): + self.cmd.run(self.parsed_args) + + f = self.cmd._formatter_plugins['test'] + assert isinstance(f, FauxListFormatter) + self.assertEqual(1, len(f.args)) + args = f.args[0] + self.assertEqual(self.cmd.columns, args[0]) + self.assertEqual(self.cmd.data, list(args[1])) + self.assertIs(self.app.stdout, args[2]) + self.assertIs(self.parsed_args, args[3]) + + def test_select_fields(self): + self.parsed_args.columns = ('STATUS', ' RESOURCE_NAME ') + self.cmd.run(self.parsed_args) + + f = self.cmd._formatter_plugins['test'] + assert isinstance(f, FauxListFormatter) + self.assertEqual(1, len(f.args)) + args = f.args[0] + self.assertEqual(self.cmd.columns, args[0]) + self.assertEqual(self.cmd.data[:2], list(args[1])) + + def test_cannot_select_output_column(self): + self.parsed_args.columns = ('Description',) + with self.assertRaisesRegex(ValueError, 'No recognized column names'): + self.cmd.run(self.parsed_args) + + def test_empty_data(self): + self.cmd.data = [] + self.cmd.run(self.parsed_args) + + f = self.cmd._formatter_plugins['test'] + assert isinstance(f, FauxListFormatter) + self.assertEqual(1, len(f.args)) + args = f.args[0] + self.assertEqual(self.cmd.columns, args[0]) + self.assertEqual([], list(args[1])) + + def test_empty_data_with_selection(self): + self.cmd.data = [] + self.parsed_args.columns = ('Status',) + with self.assertRaisesRegex(ValueError, 'No recognized column names'): + self.cmd.run(self.parsed_args) + + def test_additional_columns(self): + self.cmd.columns = (*self.cmd.columns, 'Source') + self.cmd.data = [(*row, 'API') for row in self.cmd.data] + self.parsed_args.columns = ('Status',) + self.cmd.run(self.parsed_args) + + f = self.cmd._formatter_plugins['test'] + assert isinstance(f, FauxListFormatter) + self.assertEqual(1, len(f.args)) + args = f.args[0] + self.assertEqual(self.cmd.columns, args[0]) + self.assertEqual([self.cmd.data[1]], list(args[1])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff.egg-info/PKG-INFO new/cliff-4.17.0/cliff.egg-info/PKG-INFO --- old/cliff-4.16.0/cliff.egg-info/PKG-INFO 2026-08-24 16:02:58.816058600 +0200 +++ new/cliff-4.17.0/cliff.egg-info/PKG-INFO 2026-10-22 10:34:59.953988600 +0200 @@ -1,15 +1,14 @@ Metadata-Version: 2.4 Name: cliff -Version: 4.16.0 +Version: 4.17.0 Summary: Command Line Interface Formulation Framework Author-email: OpenStack <[email protected]> -License: Apache-2.0 +License-Expression: Apache-2.0 Project-URL: Homepage, https://docs.openstack.org/cliff/ Project-URL: Repository, https://opendev.org/openstack/cliff/ Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Console Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 @@ -24,13 +23,12 @@ Requires-Dist: autopage>=0.4.0 Requires-Dist: cmd2>=4.0.0 Requires-Dist: PrettyTable>=0.7.2 -Requires-Dist: stevedore>=5.6.0 Requires-Dist: PyYAML>=3.12 +Requires-Dist: stevedore>=5.6.0 Provides-Extra: sphinxext -Requires-Dist: sphinx>=9.0.4; extra == "sphinxext" Requires-Dist: docutils>=0.21.2; extra == "sphinxext" +Requires-Dist: sphinx>=9.0.4; extra == "sphinxext" Dynamic: license-file -Dynamic: requires-dist ======================== Team and repository tags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff.egg-info/SOURCES.txt new/cliff-4.17.0/cliff.egg-info/SOURCES.txt --- old/cliff-4.16.0/cliff.egg-info/SOURCES.txt 2026-08-24 16:02:58.830058800 +0200 +++ new/cliff-4.17.0/cliff.egg-info/SOURCES.txt 2026-10-22 10:35:00.008020600 +0200 @@ -8,10 +8,8 @@ LICENSE README.rst pyproject.toml -requirements.txt setup.cfg setup.py -test-requirements.txt tox.ini cliff/__init__.py cliff/_argparse.py @@ -103,5 +101,9 @@ releasenotes/notes/drop-python-39-bbeabc19b5143cd3.yaml releasenotes/notes/drop-python27-support-b16c9e5a9e2000ef.yaml releasenotes/notes/handle-none-values-when-sorting-de40e36c66ad95ca.yaml +releasenotes/notes/normalize-sort-column-names-30e913f3530a4e9f.yaml +releasenotes/notes/show-one-with-details-c28dc2f925394c50.yaml releasenotes/notes/strip-period-from-help-strings-be368e5cf5bd5269.yaml -releasenotes/notes/undeprecate-commandmanager-namespace-argument-96d110bf3df0b9fd.yaml \ No newline at end of file +releasenotes/notes/undeprecate-commandmanager-namespace-argument-96d110bf3df0b9fd.yaml +releasenotes/source/conf.py +releasenotes/source/index.rst \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff.egg-info/pbr.json new/cliff-4.17.0/cliff.egg-info/pbr.json --- old/cliff-4.16.0/cliff.egg-info/pbr.json 2026-08-24 16:02:58.815058700 +0200 +++ new/cliff-4.17.0/cliff.egg-info/pbr.json 2026-10-22 10:34:59.966996400 +0200 @@ -1 +1 @@ -{"git_version": "89efc71", "is_release": true} \ No newline at end of file +{"git_version": "c0a279c", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/cliff.egg-info/requires.txt new/cliff-4.17.0/cliff.egg-info/requires.txt --- old/cliff-4.16.0/cliff.egg-info/requires.txt 2026-08-24 16:02:58.816058600 +0200 +++ new/cliff-4.17.0/cliff.egg-info/requires.txt 2026-10-22 10:34:59.955989800 +0200 @@ -1,9 +1,9 @@ autopage>=0.4.0 cmd2>=4.0.0 PrettyTable>=0.7.2 -stevedore>=5.6.0 PyYAML>=3.12 +stevedore>=5.6.0 [sphinxext] -sphinx>=9.0.4 docutils>=0.21.2 +sphinx>=9.0.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/doc/requirements.txt new/cliff-4.17.0/doc/requirements.txt --- old/cliff-4.16.0/doc/requirements.txt 2026-08-24 16:02:20.113734000 +0200 +++ new/cliff-4.17.0/doc/requirements.txt 2026-10-22 10:34:14.328391000 +0200 @@ -1,5 +1,2 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. -sphinx>=2.0.0,!=2.1.0 # BSD openstackdocstheme>=2.2.1 # Apache-2.0 +sphinx>=5.0.0 # BSD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/doc/source/reference/index.rst new/cliff-4.17.0/doc/source/reference/index.rst --- old/cliff-4.16.0/doc/source/reference/index.rst 2026-08-24 16:02:20.113734000 +0200 +++ new/cliff-4.17.0/doc/source/reference/index.rst 2026-10-22 10:34:14.329390300 +0200 @@ -41,6 +41,12 @@ .. autoclass:: cliff.show.ShowOne :members: +ShowOneWithDetails +------------------ + +.. autoclass:: cliff.show.ShowOneWithDetails + :members: + Lister ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/doc/source/user/show_commands.rst new/cliff-4.17.0/doc/source/user/show_commands.rst --- old/cliff-4.16.0/doc/source/user/show_commands.rst 2026-08-24 16:02:20.114734200 +0200 +++ new/cliff-4.17.0/doc/source/user/show_commands.rst 2026-10-22 10:34:14.330389500 +0200 @@ -20,6 +20,76 @@ names. See the description of :ref:`the file command in the demoapp <demoapp-show>` for details. +ShowOneWithDetails +================== + +The :class:`cliff.show.ShowOneWithDetails` base class displays a single +object's fields with additional columns, such as descriptions, types, or +sources. Unlike :class:`~cliff.show.ShowOne`, it does not limit table output +to ``Field`` and ``Value`` columns. + +Subclasses implement :meth:`~cliff.show.ShowOneWithDetails.take_action` to +return a two-member tuple containing: + +* A sequence of output column names. +* An iterable of rows, each containing values in output column order. + The first value in each row must be a string containing the resource's + field name. + +For example: + +.. code-block:: python + + from cliff import show + + + class ShowResource(show.ShowOneWithDetails): + def take_action(self, parsed_args): + return ( + ('Field', 'Value', 'Description'), + ( + ('name', 'demo', 'Resource name'), + ('status', 'ACTIVE', 'Current resource status'), + ), + ) + +As with ``ShowOne``, ``-c`` / ``--column`` selects resource fields (rows), +not output columns. Selection is case-insensitive, ignores surrounding +whitespace, and accepts underscores in place of spaces. Selected rows +retain their original order and all their output columns. Unrecognized +field names are ignored if at least one requested field is recognized; +otherwise, selection raises an error. + +For example, ``resource show -c status`` would produce: + +.. code-block:: text + + +--------+--------+-------------------------+ + | Field | Value | Description | + +--------+--------+-------------------------+ + | status | ACTIVE | Current resource status | + +--------+--------+-------------------------+ + +``ShowOneWithDetails`` uses the ``cliff.formatter.list`` plugins described +in :doc:`list_commands`, with ``table`` as the default. Consequently, JSON +and YAML output contain a list of row mappings rather than the single +field-to-value mapping produced by ``ShowOne``. For example, +``resource show -f json -c status`` would produce: + +.. code-block:: json + + [ + { + "Field": "status", + "Value": "ACTIVE", + "Description": "Current resource status" + } + ] + +CSV and value output also include every output column of each selected +row. The show-only ``shell`` formatter and ``Lister`` sorting options are +not available. + Show Output Formatters ====================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/pyproject.toml new/cliff-4.17.0/pyproject.toml --- old/cliff-4.16.0/pyproject.toml 2026-08-24 16:02:20.114734200 +0200 +++ new/cliff-4.17.0/pyproject.toml 2026-10-22 10:34:14.330389500 +0200 @@ -9,14 +9,20 @@ {name = "OpenStack", email = "[email protected]"}, ] readme = {file = "README.rst", content-type = "text/x-rst"} -license = {text = "Apache-2.0"} -dynamic = ["version", "dependencies"] +license = "Apache-2.0" +dynamic = ["version"] +dependencies = [ + "autopage>=0.4.0", # Apache 2.0 + "cmd2>=4.0.0", # MIT + "PrettyTable>=0.7.2", # BSD + "PyYAML>=3.12", # MIT + "stevedore>=5.6.0", # Apache-2.0 +] requires-python = ">=3.11" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", @@ -27,14 +33,32 @@ "Typing :: Typed", ] +[dependency-groups] +doc = [ + "openstackdocstheme>=2.2.1", # Apache-2.0 + "reno>=3.1.0", # Apache-2.0 + "sphinx>=5.0.0", # BSD +] +test = [ + "fixtures>=3.0.0", # Apache-2.0/BSD + "sphinx>=5.0.0", # BSD + "stestr>=1.0.0", # Apache-2.0 + "testtools>=2.8.0", # MIT +] +typing = [ + "mypy", # MIT + "types-docutils", # Apache-2.0 + "types-PyYAML", # Apache-2.0 +] + [project.urls] Homepage = "https://docs.openstack.org/cliff/" Repository = "https://opendev.org/openstack/cliff/" [project.optional-dependencies] sphinxext = [ - "sphinx>=9.0.4", "docutils>=0.21.2", + "sphinx>=9.0.4", ] [project.entry-points."cliff.formatter.list"] @@ -71,10 +95,8 @@ [project.entry-points."cliff.demo.hooked"] sample-hook = "cliffdemo.hook:Hook" -[tool.setuptools] -packages = [ - "cliff" -] +[tool.setuptools.packages.find] +include = ["cliff*"] [tool.mypy] python_version = "3.11" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/releasenotes/notes/normalize-sort-column-names-30e913f3530a4e9f.yaml new/cliff-4.17.0/releasenotes/notes/normalize-sort-column-names-30e913f3530a4e9f.yaml --- old/cliff-4.16.0/releasenotes/notes/normalize-sort-column-names-30e913f3530a4e9f.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/cliff-4.17.0/releasenotes/notes/normalize-sort-column-names-30e913f3530a4e9f.yaml 2026-10-22 10:34:14.333387100 +0200 @@ -0,0 +1,7 @@ +--- +fixes: + - | + Values passed to ``--sort-column`` are now normalized in the same way as + values passed to ``--column``. Sorting is therefore case-insensitive and + accepts underscores in place of spaces in column names, including leading + or trailing whitespace around the requested name. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/releasenotes/notes/show-one-with-details-c28dc2f925394c50.yaml new/cliff-4.17.0/releasenotes/notes/show-one-with-details-c28dc2f925394c50.yaml --- old/cliff-4.16.0/releasenotes/notes/show-one-with-details-c28dc2f925394c50.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/cliff-4.17.0/releasenotes/notes/show-one-with-details-c28dc2f925394c50.yaml 2026-10-22 10:34:14.333387100 +0200 @@ -0,0 +1,9 @@ +--- +features: + - | + Added ``cliff.show.ShowOneWithDetails`` for displaying a single resource's + fields with additional output columns, such as descriptions or sources. + Like ``ShowOne``, its ``-c`` / ``--column`` option selects resource fields + (rows), not output columns. It uses list formatters, so JSON and YAML + output contain a list of row mappings rather than a single field-to-value + mapping. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/releasenotes/source/conf.py new/cliff-4.17.0/releasenotes/source/conf.py --- old/cliff-4.16.0/releasenotes/source/conf.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cliff-4.17.0/releasenotes/source/conf.py 2026-10-22 10:34:14.334386300 +0200 @@ -0,0 +1,78 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# -- General configuration ------------------------------------------------ + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'openstackdocstheme', + 'reno.sphinxext', +] + +# openstackdocstheme options +openstackdocs_repo_name = 'openstack/cliff' +openstackdocs_auto_name = False +openstackdocs_bug_project = 'cliff' +openstackdocs_bug_tag = 'doc' + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'cliff Release Notes' +copyright = '2012-present, cliff Developers' + +# Release notes do not need a version number in the title, they +# cover multiple releases. +# The full version, including alpha/beta/rc tags. +release = '' +# The short X.Y version. +version = '' + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'native' + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'openstackdocs' + + +# -- Options for LaTeX output --------------------------------------------- + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + 'index', + 'cliffReleaseNotes.tex', + 'cliff Release Notes Documentation', + 'cliff Developers', + 'manual', + ), +] + + +# -- Options for Internationalization output ------------------------------ +locale_dirs = ['locale/'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/releasenotes/source/index.rst new/cliff-4.17.0/releasenotes/source/index.rst --- old/cliff-4.16.0/releasenotes/source/index.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/cliff-4.17.0/releasenotes/source/index.rst 2026-10-22 10:34:14.334386300 +0200 @@ -0,0 +1,5 @@ +===================== + cliff Release Notes +===================== + +.. release-notes:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/requirements.txt new/cliff-4.17.0/requirements.txt --- old/cliff-4.16.0/requirements.txt 2026-08-24 16:02:20.115734000 +0200 +++ new/cliff-4.17.0/requirements.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -autopage>=0.4.0 # Apache 2.0 -cmd2>=4.0.0 # MIT -PrettyTable>=0.7.2 # BSD -stevedore>=5.6.0 # Apache-2.0 -PyYAML>=3.12 # MIT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/test-requirements.txt new/cliff-4.17.0/test-requirements.txt --- old/cliff-4.16.0/test-requirements.txt 2026-08-24 16:02:20.116734000 +0200 +++ new/cliff-4.17.0/test-requirements.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -fixtures>=3.0.0 # Apache-2.0/BSD -# sphinx is required in test-requirements in addition to doc/requirements -# because there is a sphinx extension that has tests -sphinx>=5.0.0 # BSD -stestr>=1.0.0 # Apache-2.0 -testtools>=2.8.0 # MIT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-4.16.0/tox.ini new/cliff-4.17.0/tox.ini --- old/cliff-4.16.0/tox.ini 2026-08-24 16:02:20.116734000 +0200 +++ new/cliff-4.17.0/tox.ini 2026-10-22 10:34:14.334386300 +0200 @@ -1,76 +1,80 @@ [tox] -minversion = 3.1.0 +minversion = 4.28.0 envlist = py3,pep8 [testenv] +description = + Run unit tests. setenv = - VIRTUAL_ENV={envdir} OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 +constraints = + {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} +dependency_groups = + test commands = stestr run {posargs} stestr slowest + +[testenv:cover] +description = + Run unit tests and generate coverage report. +setenv = + {[testenv]setenv} + PYTHON=coverage run --source cliff --parallel-mode deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - -r{toxinidir}/test-requirements.txt - -r{toxinidir}/requirements.txt + coverage>=5.0 +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:pep8] description = Run style checks. +dependency_groups = + test + typing deps = pre-commit - {[testenv:mypy]deps} commands = - pre-commit run --all-files --show-diff-on-failure + pre-commit run -a {[testenv:mypy]commands} [testenv:mypy] description = Run type checks. -deps = - {[testenv]deps} - mypy - types-docutils - types-PyYAML +dependency_groups = + test + typing commands = mypy --cache-dir="{envdir}/mypy_cache" {posargs:cliff} [testenv:venv] -# TODO(modred) remove doc/requirements.txt once the openstack-build-sphinx-docs -# job is updated. -deps = - -r{toxinidir}/test-requirements.txt - -r{toxinidir}/doc/requirements.txt +description = + Run specified command in a virtual environment with all dependencies installed. +dependency_groups = + test + doc commands = {posargs} -[testenv:neutronclient-tip] -deps = os:openstack/python-neutronclient:python-neutronclient -commands = {toxinidir}/integration-tests/neutronclient-tip.sh {envdir} - -[testenv:openstackclient-tip] -deps = os:openstack/python-openstackclient:python-openstackclient -commands = {toxinidir}/integration-tests/openstackclient-tip.sh {envdir} - [testenv:docs] -deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - -r{toxinidir}/doc/requirements.txt -commands = sphinx-build -W -b html doc/source doc/build/html +description = + Build documentation in HTML format. +dependency_groups = + doc +commands = + sphinx-build -W --keep-going -b html -j auto doc/source/ doc/build/html -[testenv:cover] -deps = - {[testenv]deps} - coverage>=5.0 -setenv = - {[testenv]setenv} - PYTHON=coverage run --source cliff --parallel-mode +[testenv:releasenotes] +description = + Build release notes in HTML format. +dependency_groups = + doc commands = - stestr run {posargs} - coverage combine - coverage html -d cover - coverage xml -o cover/coverage.xml + sphinx-build -a -W -E -b html releasenotes/source releasenotes/build/html [flake8] application-import-names = cliff
