Skip to content

Commit 1189314

Browse files
authored
Add configuration for readthedocs, and tweak sphinx settings to work with recent pyproject migration. (#413)
* Add configuration for readthedocs, and update sphinx config to point to our python module * Add requirements for doc build * Pull doc versions from python module
1 parent b1a3fd1 commit 1189314

3 files changed

Lines changed: 42 additions & 4 deletions

File tree

.readthedocs.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
17+
# Build documentation in the "docs/" directory with Sphinx
18+
sphinx:
19+
configuration: docs/conf.py
20+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
21+
# builder: "dirhtml"
22+
# Fail on all warnings to avoid broken references
23+
# fail_on_warning: true
24+
25+
# Optionally build your docs in additional formats such as PDF and ePub
26+
# formats:
27+
# - pdf
28+
# - epub
29+
30+
# Optional but recommended, declare the Python requirements required
31+
# to build your documentation
32+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
33+
python:
34+
install:
35+
- requirements: docs/requirements.txt

docs/conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#
1515
import os
1616
import sys
17-
sys.path.insert(0, os.path.abspath('../'))
17+
sys.path.insert(0, os.path.abspath('../src-python'))
18+
19+
from amazon.ion import __version__
1820

1921

2022
# -- Project information -----------------------------------------------------
@@ -24,9 +26,9 @@
2426
author = 'Amazon Ion Team'
2527

2628
# The short X.Y version
27-
version = ''
29+
version = __version__
2830
# The full version, including alpha/beta/rc tags
29-
release = '0.3.2'
31+
release = version
3032

3133

3234
# -- General configuration ---------------------------------------------------
@@ -166,4 +168,4 @@
166168
# -- Options for todo extension ----------------------------------------------
167169

168170
# If true, `todo` and `todoList` produce output, else they produce nothing.
169-
todo_include_todos = True
171+
todo_include_todos = True

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx-rtd-theme

0 commit comments

Comments
 (0)