Skip to content

Commit 017cb47

Browse files
committed
docs: Set up combined page for API docs
1 parent 3dd38a7 commit 017cb47

File tree

7 files changed

+416
-4
lines changed

7 files changed

+416
-4
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
run: uv run pytest clients/python
140140

141141
docs:
142-
name: Cargo Docs
142+
name: Build Documentation
143143
runs-on: ubuntu-latest
144144

145145
permissions:
@@ -161,20 +161,37 @@ jobs:
161161
with:
162162
key: ${{ github.job }}
163163

164-
- name: Build Docs
164+
- name: Build Rust Docs
165165
run: cargo doc --workspace --all-features --no-deps
166166
env:
167167
RUSTDOCFLAGS: -Dwarnings
168168

169-
- run: echo '<meta http-equiv="refresh" content="0; url=objectstore/" />Redirecting to <a href="objectstore/">objectstore</a>' > target/doc/index.html
169+
- uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
170+
171+
- name: Install Python dependencies
172+
run: uv sync --all-packages --all-groups --group docs
173+
174+
- name: Build Python Docs
175+
run: |
176+
mkdir -p docs/_build
177+
uv run sphinx-apidoc -o clients/python/docs/ clients/python/src/ --force --module-first
178+
uv run sphinx-build -vv -W -b html clients/python/docs/ docs/_build
179+
180+
- name: Setup combined docs directory
181+
run: |
182+
mkdir -p gh-pages/rust
183+
mkdir -p gh-pages/python
184+
cp -r target/doc/* gh-pages/rust/
185+
cp -r docs/_build/* gh-pages/python/
186+
echo '<h1>Objectstore API Documentation</h1><ul><li><a href="rust/">Rust Server and Client documentation</a></li><li><a href="python/">Python Client Documentation</a></li></ul>' > gh-pages/index.html
170187
171188
- name: Setup Pages
172189
uses: actions/configure-pages@v5
173190

174191
- name: Upload artifact
175192
uses: actions/upload-pages-artifact@v3
176193
with:
177-
path: "target/doc"
194+
path: "gh-pages"
178195

179196
- name: Deploy to GitHub Pages
180197
uses: actions/deploy-pages@v4

clients/python/docs/conf.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# type: ignore
2+
import os
3+
import sys
4+
5+
sys.path.insert(0, os.path.abspath("../src"))
6+
7+
project = "objectstore-client"
8+
copyright = "2025, Sentry"
9+
author = "Sentry"
10+
11+
extensions = [
12+
"sphinx.ext.autodoc",
13+
"sphinx.ext.viewcode",
14+
"sphinx.ext.napoleon",
15+
]
16+
17+
templates_path = ["_templates"]
18+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
19+
20+
html_theme = "sphinx_rtd_theme"
21+
html_static_path = []
22+
23+
autodoc_default_options = {
24+
"members": True,
25+
"undoc-members": True,
26+
"show-inheritance": True,
27+
}

clients/python/docs/index.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Objectstore Python Client
2+
======================================
3+
4+
This package provides a Python Client to interact with the Objectstore service.
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
:caption: Contents:
9+
10+
modules
11+
12+
Indices and tables
13+
==================
14+
15+
* :ref:`genindex`
16+
* :ref:`modindex`
17+
* :ref:`search`

clients/python/docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
src
2+
===
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
objectstore_client
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
objectstore\_client package
2+
===========================
3+
4+
.. automodule:: objectstore_client
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Submodules
10+
----------
11+
12+
objectstore\_client.client module
13+
---------------------------------
14+
15+
.. automodule:: objectstore_client.client
16+
:members:
17+
:show-inheritance:
18+
:undoc-members:
19+
20+
objectstore\_client.metadata module
21+
-----------------------------------
22+
23+
.. automodule:: objectstore_client.metadata
24+
:members:
25+
:show-inheritance:
26+
:undoc-members:
27+
28+
objectstore\_client.metrics module
29+
----------------------------------
30+
31+
.. automodule:: objectstore_client.metrics
32+
:members:
33+
:show-inheritance:
34+
:undoc-members:

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
name = "objectstore"
33
version = "0.1.0"
44
requires-python = ">=3.13"
5+
dependencies = [
6+
"packaging>=25.0",
7+
]
58

69
[tool.uv]
710
required-version = "==0.9.3" # keep in sync with devenv/config.ini
@@ -19,6 +22,10 @@ dev = [
1922
"ruff>=0.14.2",
2023
"pre-commit>=4.2.0",
2124
]
25+
docs = [
26+
"sphinx>=8.1.3",
27+
"sphinx-rtd-theme>=3.0.1",
28+
]
2229

2330
[tool.ruff.lint]
2431
select = ["E", "F", "I", "UP"] # pycodestyle, pyflakes, isort, pyupgrade

0 commit comments

Comments
 (0)