GeezerVison is showing github.com — docs: set up Sphinx + ReadTheDocs pipeline for auto-generated API reference by jacalata · Pull Request #1832 · tableau/server-client-python
Conversation
jacalata
commented
Jul 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Motivation
api-ref.md on gh-pages is the canonical reference doc today. It's
hand-edited: when a new method or model field lands, someone has to
remember to update it. Coverage drifts and diverges from the code.
Sphinx generates the same content from docstrings, so the update path
becomes "write the docstring, docs regenerate." Concepts and tutorials
stay in Jekyll -- Sphinx just replaces the reference section.
Not merging this into the live Jekyll site yet: docstring coverage
across the models package is thin, and the auto-generated output today
would be a regression from the handwritten api-ref.md. Landing the
pipeline now unblocks incremental docstring work without a public-facing
rush. #1855 is the first tranche of docstring backfill.
Behavior change
None to the runtime library. Adds a docs build pipeline:
.readthedocs.yaml -- RTD build config, Python 3.13
docs/conf.py -- Sphinx config; reads project details from pyproject.toml; furo theme
docs/index.rst -- automodule with :members: :imported-members:
so re-exports from __init__.py render (without :imported-members:
the output was nearly empty)
.github/workflows/docs.yml -- triggers on push: branches: [master],
builds Sphinx, opens a PR into gh-pages at sphinx/. Uses
concurrency: docs-publish to serialize runs
pyproject.toml -- adds docs = ["sphinx>=7,<9", "furo>=2024,<2027", "tomli; python_version < '3.11'"] optional-deps group
Also incidentally: small docstring cleanups in connection_item.py and
site_item.py (side effect of the initial Sphinx pass).
Why both RTD and gh-pages/sphinx: the workflow-driven PR into gh-pages
puts the built HTML next to the existing Jekyll site so we can add nav
links whenever coverage is good enough. RTD is the fallback/canonical
hosting if we prefer to keep gh-pages Jekyll-only. Long-term one goes
away; keeping both live in the setup lets us pick without rebuilding.
Test plan
- Sphinx builds cleanly locally
(sphinx-build -b html docs sphinx_build) -- 3000-line index with all
re-exports rendering. One benign warning about a duplicate
UserItem.idp_configuration_id object description (pre-existing
property+setter shape).
- RTD build succeeds via
.readthedocs.yaml -- not exercised until
the PR merges and RTD picks up the config
-
.github/workflows/docs.yml runtime not exercised until this is
on master
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add Read the Docs configuration file for documentation build
Added configuration settings for Sphinx documentation. Direct copy from example conf file.
Updated project information to load from pyproject.toml.
- Add docs optional-dependencies group (sphinx, tomli) to pyproject.toml
- Wire up .readthedocs.yaml to install .[docs] extra
- Fix conf.py: correct pyproject.toml path, use importlib.metadata for
version, switch to alabaster theme, use tomllib/tomli compat import
- Add minimal docs/index.rst
- Fix RST docstring errors in connection_item, site_item, job_item,
task_item that caused Sphinx build warnings/errors
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
On push to master, builds Sphinx HTML and opens a PR from
docs-update into gh-pages so the generated API reference
can be reviewed before going live.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|

Coverage Report
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Four cleanups on the docs branch surfaced by an adversarial review:
- Revert id_ -> id docstring renames in JobItem and TaskItem. The
constructors take `id_` (trailing underscore because `id` shadows the
builtin); the docstring should describe the actual parameter name.
The original rename was cosmetic and made the docstring actively
misleading — users copying the docstring's kwarg would get a
TypeError.
- Add :imported-members: to docs/index.rst. Without it, the top-level
automodule directive only documents symbols defined in
tableauserverclient/__init__.py itself (which is 99% re-exports), so
the generated API reference was nearly empty. With this, all
re-exported classes render.
- Pin [docs] extras. Was `sphinx`, `tomli`, `furo` — unpinned. Now
`sphinx>=7,<9`, `furo>=2024,<2027`, `tomli; python_version < '3.11'`.
A future Sphinx major bump can silently break the RTD reproducible
build otherwise. `tomli` narrowed to just the Python 3.10 build path;
3.11+ has stdlib tomllib.
- Workflow changes:
- Add `concurrency: docs-publish` so overlapping runs don't rewrite
docs-update mid-flight.
- Set `delete-branch: true` on peter-evans/create-pull-request so
stale docs-update branches don't accumulate and force-updates
don't strand review comments.
- Set `fetch-depth: 0` on the gh-pages checkout so
create-pull-request can detect no-op diffs correctly.
- Remove the templates_path = ["_templates"] config in docs/conf.py.
The referenced directory doesn't ship, so Sphinx emits a warning on
every build.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Jul 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a Sphinx/Read the Docs documentation pipeline to generate an API reference from docstrings, intended to live alongside (and eventually replace) the manually maintained api-ref.md on gh-pages.
Changes:
- Introduces Sphinx configuration and a minimal
index.rst that documents the top-level tableauserverclient module.
- Adds Read the Docs configuration and a GitHub Actions workflow that builds docs and opens an automated PR into
gh-pages/sphinx/.
- Adds a
docs optional-dependency group and includes minor docstring adjustments to improve generated output.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File |
Description |
.readthedocs.yaml |
Adds RTD build/install configuration for Sphinx docs. |
docs/conf.py |
Adds Sphinx configuration (theme/extensions) and reads project metadata from pyproject.toml. |
docs/index.rst |
Adds Sphinx root page that auto-documents tableauserverclient (including re-exports). |
.github/workflows/docs.yml |
Adds CI job to build Sphinx HTML and open a PR to gh-pages with generated output. |
pyproject.toml |
Adds docs extras (Sphinx, furo, tomli fallback). |
tableauserverclient/models/connection_item.py |
Refines docstring for XML parsing helper. |
tableauserverclient/models/site_item.py |
Clarifies tier capacity docstrings for Creator/Explorer/Viewer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+4
to
+7
|
|
.. toctree::
|
|
|
:maxdepth: 2
|
|
|
:caption: Contents:
|
|
|
|
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 7, 2026
The previous conf.py used a single `.. automodule:: tableauserverclient`
which only covers names re-exported from `tableauserverclient/__init__.py`.
That silently drops every endpoint class and every root helper module --
Favorites, VirtualConnections, config, datetime_helpers, filesys_helpers,
namespace, exponential_backoff -- and readers running into missing methods
had no way to find the underlying signatures.
Wire in sphinx-autoapi with autoapi_dirs pointing at the source tree.
The generator walks every module (including private endpoints) and
produces a reference page per module under docs/reference/.
`autoapi_root` and the corresponding .gitignore entry are kept in sync.
Other tweaks:
- Replace the empty toctree in docs/index.rst with a hidden one so
autoapi's `autoapi_add_toctree_entry` has a node to append to
(without an existing toctree it is a no-op and Furo's sidebar comes
out empty).
- Add `python -m pip install --upgrade pip` to the docs workflow to
avoid the resolver-warnings that older pips emit on modern extras.
Docstring warnings surfaced by autoapi are not addressed here; a
follow-up PR will fix the RST-vs-Google mismatches introduced by the
recent Favorites, VirtualConnections, and root-helper docstring passes.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jacalata
added a commit
that referenced
this pull request
Sep 10, 2026
* docs: numpy-style docstrings on Favorites endpoint (15 methods)
Adds a class-level docstring plus 15 method docstrings on
Favorites (get, add_favorite, 6x add_favorite_<type>, delete_favorite,
6x delete_favorite_<type>). Content ported from docs/api-ref.md's
Favorites section on gh-pages so that the Sphinx pipeline in #1832 will
produce equivalent output once wired up.
Part of the api-ref -> Sphinx migration; see the migration audit
report for the full list of methods still needing docstrings. Favorites
was the largest single chunk in the "needs_docstring" bucket
(15/41 methods).
No behavior change. Docs only.
* docs: address fresh-eyes review on Favorites docstrings
- Class docstring: add missing "collections" FavoriteType (7, not 6).
- add_favorite: drop misleading #add_workbook_to_favorites anchor on
polymorphic method; link to Favorites Methods page root.
- add_favorite_metric: add REST API link (#add_metric_to_favorites).
- delete_favorite: add REST API link; polymorphic, so page root.
- delete_favorite_metric: add REST API link; no per-type anchor exists,
so page root.
- delete_favorite_flow: fix anchor drift (#delete_flow_from_favorites
-> #ref_delete_flow_from_favorites).
This branch has not been deployed
No deployments
Reviewers
At least 1 approving review is required to merge this pull request.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|