Skip to content

Commit fba8892

Browse files
authored
PYTHON-4696 Add ReadTheDocs Config (#146)
* PYTHON-4696 Add ReadTheDocs Config * fix path * handle warnings and version
1 parent 526d425 commit fba8892

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

.readthedocs.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the doc/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
fail_on_warning: true
12+
13+
# Set the version of Python and requirements required to build the docs.
14+
python:
15+
install:
16+
# Install pymongo itself.
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- docs
21+
22+
build:
23+
os: ubuntu-22.04
24+
tools:
25+
python: "3.11"

docs/source/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88
from __future__ import annotations
99

10+
from importlib.metadata import version as _version
11+
1012
project = "django_mongodb"
1113
copyright = "2024, The MongoDB Python Team"
1214
author = "The MongoDB Python Team"
13-
release = "0.1.0.dev0"
15+
release = _version("django_mongodb")
1416

1517
# -- General configuration ---------------------------------------------------
1618
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1719

1820
extensions = []
1921

20-
templates_path = ["_templates"]
22+
# templates_path = ["_templates"]
2123
exclude_patterns = []
2224

2325

2426
# -- Options for HTML output -------------------------------------------------
2527
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
2628

2729
html_theme = "alabaster"
28-
html_static_path = ["_static"]
30+
# html_static_path = ["_static"]

0 commit comments

Comments
 (0)