From b46d5f46573d414660b38d05f39fd3dec6d39ca7 Mon Sep 17 00:00:00 2001 From: Andrew Neitsch Date: Thu, 2 Sep 2021 20:40:17 -0600 Subject: [PATCH] Only use inkscapeconverter if inkscape installed --- doc/en/conf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 35941080b..90b41d023 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -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"]