Unverified Commit 1815ab61 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

remove hard dependency and configure spelling extension only if it can load enchant properly

parent 735f9ad5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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'