diff options
author | Stephen Finucane <sfinucan@redhat.com> | 2020-11-19 10:13:00 +0000 |
---|---|---|
committer | Stephen Finucane <sfinucan@redhat.com> | 2021-02-11 11:01:48 +0000 |
commit | 117a1005dc208b55aba93652856c8001b28a48ce (patch) | |
tree | 1a3ddb71114bff22ae6aea66b662ca33f026e0b4 | |
parent | 421f20c9c8aa155d1c986aecd6af1504640c4596 (diff) | |
download | cliff-117a1005dc208b55aba93652856c8001b28a48ce.tar.gz |
requirements: Uncap PrettyTablewallaby-em3.7.0
PrettyTable was capped at a < 0.8, which meant we were getting the
veritably ancient 0.7.2 release first release in April 2013 (!) [1].
The project is now being maintained as a Jazzband project [2], meaning
we should switch to this new version.
The only significant change required here is that we no longer set the
'min_width' attribute since that actually does something - the wrong
thing - now. We want this attribute to set a lower bound on the wrap
width as opposed to an absolute minimum we can use, which is what
setting the 'min_width' attribute would do.
While we're here, we also remove a now useless bit of Python 2 code and
bump cmd2 to a slightly newer version.
[1] https://pypi.org/project/prettytable/#history
[2] https://github.com/jazzband/prettytable
Change-Id: Iceac729e7a9429e8ab25c60524a48d0aaeebeb37
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/requirements/+/774917
-rw-r--r-- | cliff/formatters/table.py | 13 | ||||
-rw-r--r-- | doc/source/user/list_commands.rst | 2 | ||||
-rw-r--r-- | doc/source/user/show_commands.rst | 2 | ||||
-rw-r--r-- | requirements.txt | 4 |
4 files changed, 7 insertions, 14 deletions
diff --git a/cliff/formatters/table.py b/cliff/formatters/table.py index 397777c..df0b087 100644 --- a/cliff/formatters/table.py +++ b/cliff/formatters/table.py @@ -10,12 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. -"""Output formatters using prettytable. -""" +"""Output formatters using prettytable.""" -import prettytable import os +import prettytable + from cliff import utils from . import base from cliff import columns @@ -39,10 +39,6 @@ class TableFormatter(base.ListFormatter, base.SingleFormatter): str: 'l', float: 'r', } - try: - ALIGNMENTS[unicode] = 'l' - except NameError: - pass def add_argument_group(self, parser): group = parser.add_argument_group('table formatter') @@ -175,9 +171,6 @@ class TableFormatter(base.ListFormatter, base.SingleFormatter): @staticmethod def _assign_max_widths(stdout, x, max_width, min_width=0, fit_width=False): - if min_width: - x.min_width = min_width - if max_width > 0: term_width = max_width elif not fit_width: diff --git a/doc/source/user/list_commands.rst b/doc/source/user/list_commands.rst index d682ff9..5a28c7b 100644 --- a/doc/source/user/list_commands.rst +++ b/doc/source/user/list_commands.rst @@ -49,7 +49,7 @@ table The ``table`` formatter uses PrettyTable_ to produce output formatted for human consumption. -.. _PrettyTable: http://code.google.com/p/prettytable/ +.. _PrettyTable: https://pypi.org/project/prettytable/ :: diff --git a/doc/source/user/show_commands.rst b/doc/source/user/show_commands.rst index 8751285..ccbb668 100644 --- a/doc/source/user/show_commands.rst +++ b/doc/source/user/show_commands.rst @@ -34,7 +34,7 @@ table The ``table`` formatter uses PrettyTable_ to produce output formatted for human consumption. This is the default formatter. -.. _PrettyTable: http://code.google.com/p/prettytable/ +.. _PrettyTable: https://pypi.org/project/prettytable :: diff --git a/requirements.txt b/requirements.txt index cb74608..774d9d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. pbr!=2.1.0,>=2.0.0 # Apache-2.0 -cmd2>=0.8.0,!=0.8.3 # MIT -PrettyTable<0.8,>=0.7.2 # BSD +cmd2>=1.0.0 # MIT +PrettyTable>=0.7.2 # BSD pyparsing>=2.1.0 # MIT stevedore>=2.0.1 # Apache-2.0 PyYAML>=3.12 # MIT |