# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools
build:
  os: ubuntu-22.04
  tools:
    python: "3.11"
  jobs:
    post_create_environment:
      - pip install uv
    post_install:
      - uv pip install -r docs/requirements-docs.txt
      - uv pip install -e .
    post_build:
      # Copy case_studies folder after Sphinx build completes
      - cp -r docs/source/case_studies $READTHEDOCS_OUTPUT/html/ || echo "case_studies not found, skipping"

# Build documentation in the docs/ directory with Sphinx
sphinx:
  configuration: docs/source/conf.py
  builder: html
  fail_on_warning: false

# Build PDF & ePub
formats:
  - pdf
  - epub

# Python dependencies
python:
  install:
    - requirements: docs/requirements-docs.txt
    - method: pip
      path: .