Only use inkscapeconverter if inkscape installed

This commit is contained in:
Andrew Neitsch 2021-09-02 20:40:17 -06:00
parent e929d15848
commit b46d5f4657
1 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@
# The short X.Y version.
import ast
import os
import shutil
import sys
from typing import List
from typing import TYPE_CHECKING
@ -55,9 +56,15 @@ extensions = [
"sphinx.ext.viewcode",
"sphinx_removed_in",
"sphinxcontrib_trio",
"sphinxcontrib.inkscapeconverter",
]
# Building PDF docs on readthedocs requires inkscape for svg to pdf
# conversion. The relevant plugin is not useful for normal HTML builds, but
# it still raises warnings and fails CI if inkscape is not available. So
# only use the plugin if inkscape is actually available.
if shutil.which('inkscape'):
extensions.append("sphinxcontrib.inkscapeconverter")
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]