Skip to content

DOC: Loading sphinxcontrib.spelling to sphinx only if it's available (#21396) #21397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rather put it in the requirements-pip/conda-optional.txt

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback, you said it should be in requirements_dev.txt, may be you want to explain why? I also thought the optional files made more sense, but you two surely know better than me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirements_dev are for pure dev things
but i think things have gotten confused

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's discuss that in another one then

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