Skip to content

Commit 939ad9d

Browse files
jacalataclaude
andcommitted
docs: address adversarial review findings on Sphinx/RTD pipeline
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) <noreply@anthropic.com>
1 parent f0f4f2f commit 939ad9d

6 files changed

Lines changed: 16 additions & 5 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ permissions:
88
contents: write
99
pull-requests: write
1010

11+
# Serialize docs regen runs so a new push doesn't rewrite the docs-update
12+
# branch mid-flight for a prior run that hasn't finished opening its PR.
13+
concurrency:
14+
group: docs-publish
15+
cancel-in-progress: false
16+
1117
jobs:
1218
build-and-pr:
1319
runs-on: ubuntu-latest
@@ -29,18 +35,24 @@ jobs:
2935
with:
3036
ref: gh-pages
3137
path: gh-pages
38+
fetch-depth: 0
3239

3340
- name: Copy Sphinx output into gh-pages/sphinx
3441
run: |
3542
rm -rf gh-pages/sphinx
3643
cp -r sphinx_build gh-pages/sphinx
3744
45+
# delete-branch: true removes the docs-update branch after its PR is
46+
# merged/closed. Without it, an unmerged prior PR's branch gets
47+
# force-updated on the next run and any review comments on it are
48+
# stranded.
3849
- name: Create PR to gh-pages
3950
uses: peter-evans/create-pull-request@v6
4051
with:
4152
path: gh-pages
4253
branch: docs-update
4354
base: gh-pages
55+
delete-branch: true
4456
title: "docs: update generated API reference"
4557
body: "Automated update of Sphinx-generated API reference from master."
4658
commit-message: "docs: regenerate Sphinx API reference"

‎docs/conf.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
}
4949
intersphinx_disabled_domains = ["std"]
5050

51-
templates_path = ["_templates"]
52-
5351
# List of patterns, relative to source directory, that match files and
5452
# directories to ignore when looking for source files.
5553
# This pattern also affects html_static_path and html_extra_path.

‎docs/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ tableauserverclient
77

88
.. automodule:: tableauserverclient
99
:members:
10+
:imported-members:

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repository = "https://github.com/tableau/server-client-python"
3535
[project.optional-dependencies]
3636
test = ["black==26.5.1", "build", "mypy==2.3.0", "pytest>=7.0", "pytest-cov", "pytest-subtests",
3737
"pytest-xdist", "requests-mock>=1.0,<2.0", "types-requests>=2.32.4.20250913"]
38-
docs = ["sphinx", "tomli", "furo"]
38+
docs = ["sphinx>=7,<9", "furo>=2024,<2027", "tomli; python_version < '3.11'"]
3939

4040
[tool.setuptools.package-data]
4141
# Only include data for tableauserverclient, not for samples, test, docs

‎tableauserverclient/models/job_item.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class JobItem:
2727
2828
Parameters
2929
----------
30-
id : str
30+
id_ : str
3131
The identifier of the job.
3232
3333
job_type : str

‎tableauserverclient/models/task_item.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TaskItem:
1313
1414
Parameters
1515
----------
16-
id : str
16+
id_ : str
1717
The ID of the task.
1818
1919
task_type : str

0 commit comments

Comments
 (0)