Fix compatibility with tabulate 0.10.0#107
Merged
rolandwalker merged 4 commits intodbcli:mainfrom Mar 5, 2026
Merged
Conversation
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.
Contributor
|
Hi! Thanks! Is requiring the newest tabulate an option? |
Contributor
Author
Sure, if it works for you. It would certainly be simpler. |
0aff1ce to
4b29164
Compare
Contributor
Author
|
This PR now requires |
Contributor
|
Sorry about the commit hooks! This whole repo needs a refresh. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In
tabulate0.10.0, thetabulate.PRESERVE_WHITESPACEmodule-scope global variable was replaced with apreserve_whitespacekeyword argument totabulate(). See astanin/python-tabulate@v0.9.0...v0.10.0.Because
tabulate.PRESERVE_WHITESPACEwas 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 newpreserve_whitespaceargument is to examinetabulate.__version__. This required adding a dependency onpackagingto parse and compare the version string.Checklist
CHANGELOG.AUTHORSfile (or it's already there).pip install pre-commit && pre-commit install), and ranblackon my code. Pre-commit hooks are stale: I don’t have a Python 3.7 interpreter on my system because it is long past end of life. I tried runningblackwithoutpre-commit, but the only changes it suggested were in places I hadn’t modified.