Skip to content

Commit

Permalink
DOC: Loading sphinxcontrib.spelling to sphinx only if it's available (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
datapythonista authored and jorisvandenbossche committed Jun 12, 2018
1 parent 1275f91 commit 2e3f4ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions ci/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ dependencies:
- pytz
- setuptools>=24.2.0
- sphinx
- sphinxcontrib-spelling
1 change: 1 addition & 0 deletions ci/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ python-dateutil>=2.5.0
pytz
setuptools>=24.2.0
sphinx
sphinxcontrib-spelling
13 changes: 11 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
import re
import inspect
import importlib
from sphinx.ext.autosummary import _import_by_name
import logging
import warnings
from sphinx.ext.autosummary import _import_by_name

logger = logging.getLogger(__name__)

try:
raw_input # Python 2
Expand Down Expand Up @@ -73,9 +75,16 @@
'sphinx.ext.ifconfig',
'sphinx.ext.linkcode',
'nbsphinx',
'sphinxcontrib.spelling'
]

try:
import sphinxcontrib.spelling
except ImportError as err:
logger.warn(('sphinxcontrib.spelling failed to import with error "{}". '
'`spellcheck` command is not available.'.format(err)))
else:
extensions.append('sphinxcontrib.spelling')

exclude_patterns = ['**.ipynb_checkpoints']

spelling_word_list_filename = ['spelling_wordlist.txt', 'names_wordlist.txt']
Expand Down

0 comments on commit 2e3f4ec

Please sign in to comment.