Skip to content

Commit 8202e0e

Browse files
authored
ARROW-213 Update docs config to match PyMongo (#194)
1 parent 7f4e298 commit 8202e0e

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

bindings/python/docs/source/conf.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,23 @@
3434
# Add any Sphinx extension module names here, as strings. They can be
3535
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3636
# ones.
37-
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx"]
37+
# Add any Sphinx extension module names here, as strings. They can be extensions
38+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
39+
extensions = [
40+
"sphinx.ext.autodoc",
41+
"sphinx.ext.doctest",
42+
"sphinx.ext.coverage",
43+
"sphinx.ext.todo",
44+
"sphinx.ext.intersphinx",
45+
]
46+
47+
# Add optional extensions
48+
try:
49+
import sphinxcontrib.shellcheck # noqa: F401
50+
51+
extensions += ["sphinxcontrib.shellcheck"]
52+
except ImportError:
53+
pass
3854

3955
# Add any paths that contain templates here, relative to this directory.
4056
templates_path = ["_templates"]
@@ -44,15 +60,32 @@
4460
# This pattern also affects html_static_path and html_extra_path.
4561
exclude_patterns = []
4662

63+
# If true, the current module name will be prepended to all description
64+
# unit titles (such as .. function::).
65+
add_module_names = True
66+
67+
# The name of the Pygments (syntax highlighting) style to use.
68+
pygments_style = "sphinx"
69+
70+
# -- Options for extensions ----------------------------------------------------
71+
autoclass_content = "init"
72+
73+
autodoc_typehints = "description"
4774

4875
# -- Options for HTML output -------------------------------------------------
4976

5077
# The theme to use for HTML and HTML Help pages. See the documentation for
5178
# a list of builtin themes.
5279
#
53-
html_theme = "pydoctheme"
54-
html_theme_path = ["."]
55-
html_theme_options = {"collapsiblesidebar": True, "googletag": False}
80+
try:
81+
import furo # noqa: F401
82+
83+
html_theme = "furo"
84+
except ImportError:
85+
# Theme gratefully vendored from CPython source.
86+
html_theme = "pydoctheme"
87+
html_theme_path = ["."]
88+
html_theme_options = {"collapsiblesidebar": True, "googletag": False}
5689

5790
# Add any paths that contain custom static files (such as style sheets) here,
5891
# relative to this directory. They are copied after the builtin static files,

bindings/python/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ Source = "https://github.com/mongodb-labs/mongo-arrow/tree/main/bindings/python"
4949
Tracker = "https://jira.mongodb.org/projects/ARROW/issues"
5050

5151
[project.optional-dependencies]
52-
docs = ["sphinx"]
52+
docs = [
53+
"sphinx>=5.3,<8",
54+
"sphinx_rtd_theme>=2,<3",
55+
"sphinxcontrib-shellcheck>=1,<2",
56+
"furo==2023.9.10",
57+
]
5358
test = ["pytz", "pytest"]
5459

5560
[tool.setuptools]

0 commit comments

Comments
 (0)