Remove distutils dependency (Python 3.12+); fix API-reference drift#271
Open
ZayanKhan-12 wants to merge 2 commits into
Open
Remove distutils dependency (Python 3.12+); fix API-reference drift#271ZayanKhan-12 wants to merge 2 commits into
ZayanKhan-12 wants to merge 2 commits into
Conversation
distutils was removed from the standard library in Python 3.12, so 'from distutils.version import LooseVersion' fails on a clean install (it only works today when setuptools happens to be present and shims distutils). Tableau file versions are simple dotted numerics, so parse them into comparable tuples locally instead of depending on LooseVersion; the unsupported-version exception now carries the raw version string. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- save_as takes new_filename (workbook.py), not new_file - Field.create_field_xml requires six positional arguments (field.py), not zero - the library handles TWB/TWBX/TDS/TDSX; nothing in the package reads TDE (find_file_in_zip only extracts twb/tds entries) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the contribution! Before we can merge this, we need @zk-khan to sign the Salesforce Inc. Contributor License Agreement. |
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.
Two commits:
distutilsdependency —tableaudocumentapi/xfile.pyimportedLooseVersionfromdistutils, which was removed from the standard library in Python 3.12; on a clean install (without setuptools present to shimdistutils) the package fails at import. Tableau file versions are simple dotted numerics, so they're now parsed into comparable tuples by a small local helper, with no new dependency. The unsupported-version exception now carries the raw version string.docs/docs/api-ref.mddescribedsave_as's parameter asnew_file(it'snew_filename, perworkbook.py) and showedField.create_field_xml()with no arguments (it requires six positional arguments, perfield.py); the README and docs index claimed TDE support, but nothing in the package reads TDE —find_file_in_ziponly extractstwb/tdsentries — so the supported list now reads TWB/TWBX/TDS/TDSX.Verification: full
python -m unittest discoverpasses locally (52 tests OK; Python 3.14, macOS arm64), and the package imports cleanly in a fresh venv with onlylxmlinstalled (which fails onmaster).Prepared with AI assistance (Claude); each claim verified against the source as described.