diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3f52c420..4117e046 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,18 +7,17 @@ build: os: ubuntu-22.04 tools: python: "3.11" - # Rust needed for maturin build. Pin for cache stability; update periodically. - rust: "1.82" + jobs: + post_install: + # Install runtime + docs deps without building the package itself. + # The Rust backend is optional and unnecessary for docs, so we skip + # the maturin build entirely. Sphinx imports diff_diff from the + # checked-out source via sys.path (see docs/conf.py). + # + # Keep in sync with pyproject.toml [project.dependencies] + # and [project.optional-dependencies.docs]. + - pip install "numpy>=1.20.0" "pandas>=1.3.0" "scipy>=1.7.0" "sphinx>=6.0" "sphinx-rtd-theme>=1.0" # Build documentation in the "docs/" directory with Sphinx sphinx: configuration: docs/conf.py - -# Install from checked-out source so autodoc always matches the code at this ref. -# Dependencies consolidated in pyproject.toml [project.optional-dependencies.docs]. -python: - install: - - method: pip - path: . - extra_requirements: - - docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 6165fd6a..5429b75c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix docs/PyPI version mismatch (issue #146) — RTD now builds versioned docs from source +- Fix RTD docs build failure caused by Rust/maturin compilation timeout on ReadTheDocs ### Changed - Remove Rust outer-loop variance estimation for SyntheticDiD (placebo and bootstrap) diff --git a/docs/conf.py b/docs/conf.py index 5997b7e5..4755e570 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,6 +4,14 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html import os +import sys + +# Add repository root to sys.path so autodoc imports from checked-out source +# without needing pip install (which would require the Rust/maturin toolchain). +# Note: visualization.py lazily imports matplotlib inside functions, so it is +# not needed as a build dependency. If a future module adds a top-level +# matplotlib import, add it to the RTD dep list in .readthedocs.yaml. +sys.path.insert(0, os.path.abspath("..")) import diff_diff