Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@

version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Rust needed for maturin build. Pin for cache stability; update periodically.
rust: "1.82"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Install from PyPI (has pre-built wheels with Rust backend)
# instead of building from source (which requires OpenBLAS)
# 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:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Fix docs/PyPI version mismatch (issue #146) — RTD now builds versioned docs from source

### Changed
- Remove Rust outer-loop variance estimation for SyntheticDiD (placebo and bootstrap)
- Fixes SE mismatch between pure Python and Rust backends (different RNG sequences)
Expand Down
21 changes: 17 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys

# Add the project root to the path for autodoc
sys.path.insert(0, os.path.abspath(".."))

import diff_diff

Expand All @@ -16,6 +12,7 @@
copyright = "2026, diff-diff contributors"
author = "diff-diff contributors"
release = diff_diff.__version__
version = ".".join(diff_diff.__version__.split(".")[:2])

# -- General configuration ---------------------------------------------------
extensions = [
Expand Down Expand Up @@ -76,6 +73,22 @@
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
}

# -- ReadTheDocs version-aware banner ----------------------------------------
# Shows a warning on development builds so users know they may be reading
# docs for unreleased features. Only activates on RTD (not local builds).
rtd_version = os.environ.get("READTHEDOCS_VERSION", "")
rtd_version_type = os.environ.get("READTHEDOCS_VERSION_TYPE", "")

if rtd_version == "latest" or rtd_version_type == "branch":
rst_prolog = """
.. warning::

This documentation is for the **development version** of diff-diff.
It may describe features not yet available in the latest PyPI release.
For stable documentation, use the version selector (bottom-left) to switch to **stable**.

"""

# -- Custom CSS --------------------------------------------------------------
def setup(app):
app.add_css_file("custom.css")
4 changes: 0 additions & 4 deletions docs/requirements.txt

This file was deleted.