From 1815ab610ec67c793bfc0ec485ba4b278ee025ee Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Jul 2020 11:26:43 -0400 Subject: [PATCH] remove hard dependency and configure spelling extension only if it can load enchant properly --- doc/utils/sphinx-config/conf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/utils/sphinx-config/conf.py b/doc/utils/sphinx-config/conf.py index ffb43e7bff..9441f9dac5 100644 --- a/doc/utils/sphinx-config/conf.py +++ b/doc/utils/sphinx-config/conf.py @@ -16,6 +16,13 @@ import sys import os +has_enchant = False +try: + import enchant + has_enchant = True +except: + pass + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -321,7 +328,7 @@ epub_author = 'The LAMMPS Developers' # configure spelling extension if present import importlib.util spelling_spec = importlib.util.find_spec("sphinxcontrib.spelling") -if spelling_spec: +if spelling_spec and has_enchant: extensions.append('sphinxcontrib.spelling') spelling_lang='en_US'