Skip to content

Commit f1971f0

Browse files
authored
Merge pull request #151 from igerber/fix-latest-docs-build-issue
Fix RTD docs build failure caused by Rust/maturin compilation timeout
2 parents 7434be3 + 3897977 commit f1971f0

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.readthedocs.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ build:
77
os: ubuntu-22.04
88
tools:
99
python: "3.11"
10-
# Rust needed for maturin build. Pin for cache stability; update periodically.
11-
rust: "1.82"
10+
jobs:
11+
post_install:
12+
# Install runtime + docs deps without building the package itself.
13+
# The Rust backend is optional and unnecessary for docs, so we skip
14+
# the maturin build entirely. Sphinx imports diff_diff from the
15+
# checked-out source via sys.path (see docs/conf.py).
16+
#
17+
# Keep in sync with pyproject.toml [project.dependencies]
18+
# and [project.optional-dependencies.docs].
19+
- pip install "numpy>=1.20.0" "pandas>=1.3.0" "scipy>=1.7.0" "sphinx>=6.0" "sphinx-rtd-theme>=1.0"
1220

1321
# Build documentation in the "docs/" directory with Sphinx
1422
sphinx:
1523
configuration: docs/conf.py
16-
17-
# Install from checked-out source so autodoc always matches the code at this ref.
18-
# Dependencies consolidated in pyproject.toml [project.optional-dependencies.docs].
19-
python:
20-
install:
21-
- method: pip
22-
path: .
23-
extra_requirements:
24-
- docs

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Fix docs/PyPI version mismatch (issue #146) — RTD now builds versioned docs from source
12+
- Fix RTD docs build failure caused by Rust/maturin compilation timeout on ReadTheDocs
1213

1314
### Changed
1415
- Remove Rust outer-loop variance estimation for SyntheticDiD (placebo and bootstrap)

docs/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55

66
import os
7+
import sys
8+
9+
# Add repository root to sys.path so autodoc imports from checked-out source
10+
# without needing pip install (which would require the Rust/maturin toolchain).
11+
# Note: visualization.py lazily imports matplotlib inside functions, so it is
12+
# not needed as a build dependency. If a future module adds a top-level
13+
# matplotlib import, add it to the RTD dep list in .readthedocs.yaml.
14+
sys.path.insert(0, os.path.abspath(".."))
715

816
import diff_diff
917

0 commit comments

Comments
 (0)