From 3a18a4ca455cff078808a8fa2577a111e8090a72 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 5 Mar 2026 14:03:13 +0000 Subject: [PATCH] Support tabulate version 0.10.0 The `tabulate.PRESERVE_WHITESPACE` global was replaced with a new `preserve_whitespace` keyword argument for `tabulate()`. Since preserving backward compatibility with previous `tabulate` versions would be tedious, requiring various conditionals and parsing `tabulate.__version__`, support *only* `tabulate>=0.10.0`. --- setup.py | 2 +- src/interrogate/coverage.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index aeeb025..dfc0100 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ def find_meta(meta): "click>=7.1", "colorama", "py", - "tabulate", + "tabulate>=0.10.0", "tomli; python_version < '3.11'", ] EXTRAS_REQUIRE = { diff --git a/src/interrogate/coverage.py b/src/interrogate/coverage.py index 4c1226b..2414988 100644 --- a/src/interrogate/coverage.py +++ b/src/interrogate/coverage.py @@ -18,9 +18,6 @@ from interrogate import config, utils, visit -tabulate.PRESERVE_WHITESPACE = True - - @attr.s class BaseInterrogateResult: """Base results class. @@ -382,6 +379,7 @@ def _print_detailed_table(self, results: InterrogateResults) -> None: table_type="detailed" ), colalign=["left", "right"], + preserve_whitespace=True, ) self.output_formatter.tw.sep( "-", @@ -450,6 +448,7 @@ def _print_summary_table(self, results: InterrogateResults) -> None: table_type="summary" ), colalign=("left", "right", "right", "right", "right"), + preserve_whitespace=True, ) self.output_formatter.tw.line(to_print) @@ -519,6 +518,7 @@ def _print_omitted_file_count(self, results: InterrogateResults) -> None: table_type="summary" ), colalign=("center",), + preserve_whitespace=True, ) self.output_formatter.tw.line(to_print)