# .readthedocs.yml
# Read the Docs configuration file

# Details
# - https://docs.readthedocs.io/en/stable/config-file/v2.html

# Required
version: 2

build:
  os: "ubuntu-22.04"
  tools:
    python: "3.10"
  # apt_packages:
  #   - libeccodes-dev
  #   - libgeos-dev

  # Work around timeout error.
  # ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
  # https://stackoverflow.com/questions/43298872/how-to-solve-readtimeouterror-httpsconnectionpoolhost-pypi-python-org-port#comment110786026_43560499
  # https://github.com/readthedocs/readthedocs.org/issues/6311#issuecomment-1324426604
  # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-jobs
  jobs:
    post_checkout:
      - echo "export PIP_DEFAULT_TIMEOUT=100" >> ~/.profile

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

python:
  install:
    - method: pip
      path: .
      extra_requirements:
        - docs

# Optionally build your docs in additional formats such as PDF
formats:
  - pdf
