-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update doc build. #8536
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
Update doc build. #8536
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,48 +38,40 @@ | |
|
||
exclude_patterns = ['api/api_changes/*', 'users/whats_new/*'] | ||
|
||
# Use IPython's console highlighting by default | ||
try: | ||
from IPython.sphinxext import ipython_console_highlighting | ||
except ImportError: | ||
raise ImportError( | ||
"IPython must be installed to build the Matplotlib docs") | ||
else: | ||
extensions.append('IPython.sphinxext.ipython_console_highlighting') | ||
extensions.append('IPython.sphinxext.ipython_directive') | ||
|
||
try: | ||
import numpydoc | ||
except ImportError: | ||
raise ImportError("No module named numpydoc - you need to install " | ||
"numpydoc to build the documentation.") | ||
|
||
try: | ||
import sphinx_gallery | ||
except ImportError: | ||
raise ImportError("No module named sphinx_gallery - you need to install " | ||
"sphinx_gallery to build the documentation.") | ||
|
||
try: | ||
import colorspacious | ||
except ImportError: | ||
raise ImportError("No module named colorspacious - you need to install " | ||
"colorspacious to build the documentation") | ||
|
||
def _check_deps(): | ||
names = ["colorspacious", | ||
"IPython.sphinxext.ipython_console_highlighting", | ||
"matplotlib", | ||
"numpydoc", | ||
"PIL.Image", | ||
"scipy", | ||
"sphinx_gallery"] | ||
if sys.version_info < (3, 3): | ||
names.append("mock") | ||
missing = [] | ||
for name in names: | ||
try: | ||
__import__(name) | ||
except ImportError: | ||
missing.append(name) | ||
if missing: | ||
raise ImportError( | ||
"The following dependencies are missing to build the " | ||
"documentation: {}".format(", ".join(missing))) | ||
|
||
_check_deps() | ||
|
||
import matplotlib | ||
try: | ||
from unittest.mock import MagicMock | ||
except ImportError: | ||
try: | ||
from mock import MagicMock | ||
except ImportError: | ||
raise ImportError("No module named mock - you need to install " | ||
"mock to build the documentation") | ||
from mock import MagicMock | ||
|
||
try: | ||
from PIL import Image | ||
except ImportError: | ||
raise ImportError("No module named Image - you need to install " | ||
"pillow to build the documentation") | ||
|
||
# Use IPython's console highlighting by default | ||
extensions.extend(['IPython.sphinxext.ipython_console_highlighting', | ||
'IPython.sphinxext.ipython_directive']) | ||
|
||
if six.PY2: | ||
from distutils.spawn import find_executable | ||
|
@@ -92,12 +84,6 @@ | |
"No binary named dot - you need to install the Graph Visualization " | ||
"software (usually packaged as 'graphviz') to build the documentation") | ||
|
||
try: | ||
import matplotlib | ||
except ImportError: | ||
msg = "Error: Matplotlib must be installed before building the documentation" | ||
sys.exit(msg) | ||
|
||
|
||
autosummary_generate = True | ||
|
||
|
@@ -134,7 +120,7 @@ | |
project = 'Matplotlib' | ||
copyright = ('2002 - 2012 John Hunter, Darren Dale, Eric Firing, ' | ||
'Michael Droettboom and the Matplotlib development ' | ||
'team; 2012 - 2016 The Matplotlib development team') | ||
'team; 2012 - 2017 The Matplotlib development team') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe overkill but we could always use
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somehow automatically generating copyright years feels wrong to me... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hehe fair enough, just a thought :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can imagine in 3 years someone would realize it's showing "2012 - NULL_VALUE" or something |
||
|
||
# The default replacements for |version| and |release|, also used in various | ||
# other places throughout the built documents. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
mock
now be in the list of dependencies on L43?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unittest.mock is part of the stdlib in py3.3+; we check for mock for py2.