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

# Thank you also https://browniebroke.com/blog/specify-docs-dependency-groups-with-poetry-and-read-the-docs/

# Required
version: 2

# Set the version of Python and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.11"
  jobs:
    post_create_environment:
      - pip install poetry
      - poetry config virtualenvs.create false
    post_install:
      # RtD seems to be not happy with poetry installs,
      # hence use pip directly instead.
      - poetry export -f requirements.txt --output requirements.txt --with docs
      - python -m pip install -r requirements.txt
      - python -m pip install .
      - python -m pip list

# Set sphinx configuration
sphinx:
   configuration: docs/source/conf.py