Skip to content

Commit 40d0b86

Browse files
Fix compatibility with tabulate 0.10.0 (#107)
* Fix compatibility with tabulate 0.10.0 Because `tabulate.PRESERVE_WHITESPACE` was replaced with a keyword argument but was not removed from the module namespace (even though modifying it no longer has any effect), the only way to check whether we should pass the new `preserve_whitespace` argument is to examine `tabulate.__version__`. This required adding a dependency on `packaging` to parse and compare the version string. * Changelog entry for tabulate 0.10 support * Add Benjamin Beasley as a contributor in AUTHORS * Require tabulate>=0.10.0 to avoid a packaging dependency
1 parent 9fb9f65 commit 40d0b86

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This project receives help from these awesome contributors:
2626
- Andrii Kohut
2727
- Roland Walker
2828
- Doug Harris
29+
- Benjamin Beasley
2930

3031
Thanks
3132
------

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
- Support and require version 0.10 of `tabulate`
6+
37
## Version 2.10.1
48

59
(released on 2025-02-18)

cli_helpers/tabular_output/tabulate_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def adapter(data, headers, table_format=None, preserve_whitespace=False, **kwarg
249249
if table_format in supported_markup_formats:
250250
tkwargs.update(numalign=None, stralign=None)
251251

252-
tabulate.PRESERVE_WHITESPACE = preserve_whitespace
252+
tkwargs.update(preserve_whitespace=preserve_whitespace)
253253

254254
tkwargs.update(default_kwargs.get(table_format, {}))
255255
if table_format in headless_formats:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def open_file(filename):
3737
long_description_content_type="text/x-rst",
3838
install_requires=[
3939
"configobj >= 5.0.5",
40-
"tabulate[widechars] >= 0.9.0",
40+
"tabulate[widechars] >= 0.10.0",
4141
],
4242
extras_require={
4343
"styles": ["Pygments >= 1.6"],

0 commit comments

Comments
 (0)