Skip to content

Remove distutils dependency (Python 3.12+); fix API-reference drift#271

Open
ZayanKhan-12 wants to merge 2 commits into
tableau:masterfrom
ZayanKhan-12:fix/docs-and-distutils
Open

Remove distutils dependency (Python 3.12+); fix API-reference drift#271
ZayanKhan-12 wants to merge 2 commits into
tableau:masterfrom
ZayanKhan-12:fix/docs-and-distutils

Conversation

@ZayanKhan-12

Copy link
Copy Markdown

Two commits:

  1. Remove the distutils dependencytableaudocumentapi/xfile.py imported LooseVersion from distutils, which was removed from the standard library in Python 3.12; on a clean install (without setuptools present to shim distutils) 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.
  2. Docs driftdocs/docs/api-ref.md described save_as's parameter as new_file (it's new_filename, per workbook.py) and showed Field.create_field_xml() with no arguments (it requires six positional arguments, per field.py); the README and docs index claimed TDE support, but nothing in the package reads TDE — find_file_in_zip only extracts twb/tds entries — so the supported list now reads TWB/TWBX/TDS/TDSX.

Verification: full python -m unittest discover passes locally (52 tests OK; Python 3.14, macOS arm64), and the package imports cleanly in a fresh venv with only lxml installed (which fails on master).

Prepared with AI assistance (Claude); each claim verified against the source as described.

zk-khan and others added 2 commits July 26, 2026 20:03
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>
@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @zk-khan to sign the Salesforce Inc. Contributor License Agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants