public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-cli-helpers] f44: Fix compatibility with tabulate 0.10.0
@ 2026-09-02 16:22 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-09-02 16:22 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-cli-helpers
Branch : f44
Commit : 6e8728c782bf37f064e3b4f160b4044fd34fcbb1
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-03-05T14:25:54+00:00
Stats  : +169/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-cli-helpers/c/6e8728c782bf37f064e3b4f160b4044fd34fcbb1?branch=f44

Log:
Fix compatibility with tabulate 0.10.0

---
diff --git a/107.patch b/107.patch
new file mode 100644
index 0000000..c65be63
--- /dev/null
+++ b/107.patch
@@ -0,0 +1,161 @@
+From 435c13f84ddf0ff54c1a14322b4640026ec0fb80 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 5 Mar 2026 13:39:12 +0000
+Subject: [PATCH 1/4] 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.
+---
+ cli_helpers/tabular_output/tabulate_adapter.py | 6 +++++-
+ setup.py                                       | 1 +
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/cli_helpers/tabular_output/tabulate_adapter.py b/cli_helpers/tabular_output/tabulate_adapter.py
+index 5caa55e..0872a3d 100644
+--- a/cli_helpers/tabular_output/tabulate_adapter.py
++++ b/cli_helpers/tabular_output/tabulate_adapter.py
+@@ -21,6 +21,7 @@
+     escape_newlines,
+ )
+ 
++from packaging.version import Version
+ import tabulate
+ 
+ 
+@@ -249,7 +250,10 @@ def adapter(data, headers, table_format=None, preserve_whitespace=False, **kwarg
+     if table_format in supported_markup_formats:
+         tkwargs.update(numalign=None, stralign=None)
+ 
+-    tabulate.PRESERVE_WHITESPACE = preserve_whitespace
++    if Version(tabulate.__version__) < Version("0.10.0"):
++        tabulate.PRESERVE_WHITESPACE = preserve_whitespace
++    else:
++        tkwargs.update(preserve_whitespace=preserve_whitespace)
+ 
+     tkwargs.update(default_kwargs.get(table_format, {}))
+     if table_format in headless_formats:
+diff --git a/setup.py b/setup.py
+index 16ecf5b..f02c970 100755
+--- a/setup.py
++++ b/setup.py
+@@ -37,6 +37,7 @@ def open_file(filename):
+     long_description_content_type="text/x-rst",
+     install_requires=[
+         "configobj >= 5.0.5",
++        "packaging",
+         "tabulate[widechars] >= 0.9.0",
+     ],
+     extras_require={
+
+From eff1544712bcbede509a85ef346f8fb8fc4de718 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 5 Mar 2026 13:43:26 +0000
+Subject: [PATCH 2/4] Changelog entry for tabulate 0.10 support
+
+---
+ CHANGELOG | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index f078662..a4aff98 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -1,5 +1,9 @@
+ # Changelog
+ 
++## [Unreleased]
++
++- Support version 0.10 of `tabulate`
++
+ ## Version 2.10.1
+ 
+ (released on 2025-02-18)
+
+From 9120d7e9286b9659e54cd6f22d44ec534e01d08b Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 5 Mar 2026 13:44:04 +0000
+Subject: [PATCH 3/4] Add Benjamin Beasley as a contributor in AUTHORS
+
+---
+ AUTHORS | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/AUTHORS b/AUTHORS
+index 536b972..17bf821 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -26,6 +26,7 @@ This project receives help from these awesome contributors:
+ - Andrii Kohut
+ - Roland Walker
+ - Doug Harris
++- Benjamin Beasley
+ 
+ Thanks
+ ------
+
+From 4b291642952e760d0273056589b81c09165c6a79 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 5 Mar 2026 14:23:15 +0000
+Subject: [PATCH 4/4] Require tabulate>=0.10.0 to avoid a packaging dependency
+
+---
+ CHANGELOG                                      | 2 +-
+ cli_helpers/tabular_output/tabulate_adapter.py | 6 +-----
+ setup.py                                       | 3 +--
+ 3 files changed, 3 insertions(+), 8 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index a4aff98..d2a3c76 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -2,7 +2,7 @@
+ 
+ ## [Unreleased]
+ 
+-- Support version 0.10 of `tabulate`
++- Support and require version 0.10 of `tabulate`
+ 
+ ## Version 2.10.1
+ 
+diff --git a/cli_helpers/tabular_output/tabulate_adapter.py b/cli_helpers/tabular_output/tabulate_adapter.py
+index 0872a3d..cf32da5 100644
+--- a/cli_helpers/tabular_output/tabulate_adapter.py
++++ b/cli_helpers/tabular_output/tabulate_adapter.py
+@@ -21,7 +21,6 @@
+     escape_newlines,
+ )
+ 
+-from packaging.version import Version
+ import tabulate
+ 
+ 
+@@ -250,10 +249,7 @@ def adapter(data, headers, table_format=None, preserve_whitespace=False, **kwarg
+     if table_format in supported_markup_formats:
+         tkwargs.update(numalign=None, stralign=None)
+ 
+-    if Version(tabulate.__version__) < Version("0.10.0"):
+-        tabulate.PRESERVE_WHITESPACE = preserve_whitespace
+-    else:
+-        tkwargs.update(preserve_whitespace=preserve_whitespace)
++    tkwargs.update(preserve_whitespace=preserve_whitespace)
+ 
+     tkwargs.update(default_kwargs.get(table_format, {}))
+     if table_format in headless_formats:
+diff --git a/setup.py b/setup.py
+index f02c970..3b1cc9e 100755
+--- a/setup.py
++++ b/setup.py
+@@ -37,8 +37,7 @@ def open_file(filename):
+     long_description_content_type="text/x-rst",
+     install_requires=[
+         "configobj >= 5.0.5",
+-        "packaging",
+-        "tabulate[widechars] >= 0.9.0",
++        "tabulate[widechars] >= 0.10.0",
+     ],
+     extras_require={
+         "styles": ["Pygments >= 1.6"],

diff --git a/python-cli-helpers.spec b/python-cli-helpers.spec
index e236666..d4ed6da 100644
--- a/python-cli-helpers.spec
+++ b/python-cli-helpers.spec
@@ -3,11 +3,14 @@
 Summary:        Python helpers for common CLI tasks
 Name:           python-cli-helpers
 Version:        2.10.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 # Automatically converted from old format: BSD - review is highly recommended.
 License:        LicenseRef-Callaway-BSD
 URL:            https://github.com/dbcli/cli_helpers
 Source0:        https://github.com/dbcli/cli_helpers/archive/v%{version}/cli_helpers-%{version}.tar.gz
+# Fix compatibility with tabulate 0.10.0
+# https://github.com/dbcli/cli_helpers/pull/107
+Patch:          %{url}/pull/107.patch
 BuildArch:      noarch
 BuildRequires:  python3-configobj
 BuildRequires:  python3-devel
@@ -33,7 +36,7 @@ Requires:       python3-wcwidth
 %pyproject_extras_subpkg -n python3-cli-helpers styles
 
 %prep
-%autosetup -n %{pypi_name}-%{version}
+%autosetup -n %{pypi_name}-%{version} -p1
 
 %generate_buildrequires
 %pyproject_buildrequires
@@ -54,6 +57,9 @@ PYTHONPATH=build/lib/ py.test-3
 %doc AUTHORS CHANGELOG README.rst
 
 %changelog
+* Thu Mar 05 2026 Benjamin A. Beasley <code@musicinmybrain.net> - 2.10.1-2
+- Fix compatibility with tabulate 0.10.0
+
 * Wed Feb 18 2026 Terje Rosten <terjeros@gmail.com> - 2.10.1-1
 - 2.10.1
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-02 16:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-02 16:22 [rpms/python-cli-helpers] f44: Fix compatibility with tabulate 0.10.0 Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox