---
# https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2
# NOTE: not building epub because epub does not know how to handle .ico files
# which results in a warning which causes the build to fail due to
# `sphinx.fail_on_warning`
# https://github.com/sphinx-doc/sphinx/issues/10350
formats:
  - htmlzip
  - pdf

build:
  os: ubuntu-20.04
  tools:
    # Using 3.9 as earlier versions have trouble generating documentation for
    # `@typing.overload`` with type aliases.
    python: "3.9"
  jobs:
    post_create_environment:
    # Using requirements-poetry.in as requirements-poetry.txt has conflicts with
    # the readthedocs environment.
    - pip install -r devtools/requirements-poetry.in
    post_install:
    - poetry export --only=main --only=docs --without-hashes -o requirements.txt
    - pip install --no-cache-dir -r requirements.txt
    - pip install .
    - python -c "from rdflib import Graph; print(Graph)"

sphinx:
  fail_on_warning: true
