Skip to content

Commit ed8b75f

Browse files
jacalataclaude
andcommitted
docs: set up Sphinx with working ReadTheDocs config
- 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 <noreply@anthropic.com>
1 parent a195f86 commit ed8b75f

8 files changed

Lines changed: 39 additions & 28 deletions

File tree

‎.readthedocs.yaml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ sphinx:
1717
# Optionally, but recommended,
1818
# declare the Python requirements required to build your documentation
1919
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20-
# python:
21-
# install:
22-
# - requirements: docs/requirements.txt
23-
20+
python:
21+
install:
22+
- method: pip
23+
path: .
24+
extra_requirements:
25+
- docs

‎docs/conf.py‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,22 @@
1212

1313
# conf.py
1414

15-
import tomli
16-
with open("../../pyproject.toml", "rb") as f:
17-
toml = tomli.load(f)
15+
try:
16+
import tomllib
17+
except ImportError:
18+
import tomli as tomllib
1819

19-
# -- Project information -----------------------------------------------------
20+
from pathlib import Path
21+
import importlib.metadata
22+
23+
with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as f:
24+
toml = tomllib.load(f)
2025

21-
pyproject = toml["tool"]["setuptools"]
26+
# -- Project information -----------------------------------------------------
2227

23-
project = pyproject["name"]
24-
version = pyproject["version"]
25-
release = pyproject["version"]
28+
project = toml["project"]["name"]
29+
release = importlib.metadata.version(project)
30+
version = ".".join(release.split(".")[:2])
2631

2732
# -- General configuration ---------------------------------------------------
2833
# -- General configuration
@@ -54,9 +59,9 @@
5459
# The theme to use for HTML and HTML Help pages. See the documentation for
5560
# a list of builtin themes.
5661
#
57-
html_theme = "sphinx_rtd_theme"
62+
html_theme = "alabaster"
5863

5964
# Add any paths that contain custom static files (such as style sheets) here,
6065
# relative to this directory. They are copied after the builtin static files,
6166
# so a file named "default.css" will overwrite the builtin "default.css".
62-
html_static_path = ["_static"]
67+
html_static_path = []

‎docs/index.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
tableauserverclient
2+
===================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
.. automodule:: tableauserverclient
9+
:members:

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +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"]
3839

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

‎tableauserverclient/models/connection_item.py‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,7 @@ def from_response(cls, resp, ns) -> list["ConnectionItem"]:
150150

151151
@classmethod
152152
def from_xml_element(cls, parsed_response, ns) -> list["ConnectionItem"]:
153-
"""
154-
<connections>
155-
<connection serverAddress="mysql.test.com">
156-
<connectionCredentials embed="true" name="test" password="secret" />
157-
</connection>
158-
<connection serverAddress="pgsql.test.com">
159-
<connectionCredentials embed="true" name="test" password="secret" />
160-
</connection>
161-
</connections>
162-
"""
153+
"""Parse connection items from an XML ``<connections>`` element."""
163154
all_connection_items: list["ConnectionItem"] = list()
164155
all_connection_xml = parsed_response.findall(".//t:connection", namespaces=ns)
165156

‎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/site_item.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ class SiteItem:
5252
cause an error.
5353
5454
tier_explorer_capacity: int
55+
(Optional) The maximum number of licenses for users with the Explorer role allowed on a site.
56+
5557
tier_creator_capacity: int
58+
(Optional) The maximum number of licenses for users with the Creator role allowed on a site.
59+
5660
tier_viewer_capacity: int
57-
(Optional) The maximum number of licenses for users with the Creator,
58-
Explorer, or Viewer role, respectively, allowed on a site.
61+
(Optional) The maximum number of licenses for users with the Viewer role allowed on a site.
5962
6063
storage_quota: int
6164
(Optional) Specifies the maximum amount of space for the new site, in

‎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)