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

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.11"
  # https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
  jobs:
    post_create_environment:
      - pip install poetry
    post_install:
      # Virtualenv management per
      # https://docs.readthedocs.io/en/latest/build-customization.html#install-dependencies-with-poetry
      # https://github.com/python-poetry/poetry/issues/9025#issuecomment-1963073941
      - cd docs && VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install

# Build documentation in the "docs/" directory with Sphinx
sphinx:
  configuration: docs/conf.py
  # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
  # builder: "dirhtml"
  # Fail on all warnings to avoid broken references
  fail_on_warning: true
