Skip to content

DOC/BLD: doc building with python 3 #15012

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 6 commits into from
Dec 30, 2016
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
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ matrix:
- CACHE_NAME="35_ascii"
- USE_CACHE=true
# In allow_failures
- python: 2.7
- python: 3.5
env:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.5
- JOB_NAME: "doc_build"
- FULL_DEPS=true
- DOC_BUILD=true
Expand Down Expand Up @@ -275,9 +275,9 @@ matrix:
- LOCALE_OVERRIDE="C"
- CACHE_NAME="35_ascii"
- USE_CACHE=true
- python: 2.7
- python: 3.5
env:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.5
- JOB_NAME: "doc_build"
- FULL_DEPS=true
- DOC_BUILD=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dateutil
python-dateutil
pytz
numpy
cython
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ notebook
matplotlib
scipy
lxml
beautiful-soup
beautifulsoup4
html5lib
pytables
openpyxl=1.8.5
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/_templates/autosummary/accessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

.. currentmodule:: {{ module.split('.')[0] }}

.. automethod:: {{ [module.split('.')[1], objname]|join('.') }}
.. autoaccessor:: {{ (module.split('.')[1:] + [objname]) | join('.') }}
2 changes: 1 addition & 1 deletion doc/_templates/autosummary/accessor_attribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

.. currentmodule:: {{ module.split('.')[0] }}

.. autoaccessorattribute:: {{ [module.split('.')[1], objname]|join('.') }}
.. autoaccessorattribute:: {{ (module.split('.')[1:] + [objname]) | join('.') }}
2 changes: 1 addition & 1 deletion doc/_templates/autosummary/accessor_callable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

.. currentmodule:: {{ module.split('.')[0] }}

.. autoaccessorcallable:: {{ [module.split('.')[1], objname]|join('.') }}.__call__
.. autoaccessorcallable:: {{ (module.split('.')[1:] + [objname]) | join('.') }}.__call__
2 changes: 1 addition & 1 deletion doc/_templates/autosummary/accessor_method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

.. currentmodule:: {{ module.split('.')[0] }}

.. autoaccessormethod:: {{ [module.split('.')[1], objname]|join('.') }}
.. autoaccessormethod:: {{ (module.split('.')[1:] + [objname]) | join('.') }}
23 changes: 23 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,23 @@
from sphinx.ext.autosummary import Autosummary


class AccessorDocumenter(MethodDocumenter):
"""
Specialized Documenter subclass for accessors.
"""

objtype = 'accessor'
directivetype = 'method'

# lower than MethodDocumenter so this is not chosen for normal methods
priority = 0.6

def format_signature(self):
# this method gives an error/warning for the accessors, therefore
# overriding it (accessor has no arguments)
return ''


class AccessorLevelDocumenter(Documenter):
"""
Specialized Documenter subclass for objects on accessor level (methods,
Expand Down Expand Up @@ -381,12 +398,17 @@ class AccessorAttributeDocumenter(AccessorLevelDocumenter, AttributeDocumenter):
objtype = 'accessorattribute'
directivetype = 'attribute'

# lower than AttributeDocumenter so this is not chosen for normal attributes
priority = 0.6

class AccessorMethodDocumenter(AccessorLevelDocumenter, MethodDocumenter):

objtype = 'accessormethod'
directivetype = 'method'

# lower than MethodDocumenter so this is not chosen for normal methods
priority = 0.6


class AccessorCallableDocumenter(AccessorLevelDocumenter, MethodDocumenter):
"""
Expand Down Expand Up @@ -483,6 +505,7 @@ def remove_flags_docstring(app, what, name, obj, options, lines):

def setup(app):
app.connect("autodoc-process-docstring", remove_flags_docstring)
app.add_autodocumenter(AccessorDocumenter)
app.add_autodocumenter(AccessorAttributeDocumenter)
app.add_autodocumenter(AccessorMethodDocumenter)
app.add_autodocumenter(AccessorCallableDocumenter)
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinxext/ipython_sphinxext/ipython_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def setup(self):
# EmbeddedSphinxShell is created, its interactive shell member
# is the same for each instance.

if mplbackend:
if mplbackend and 'matplotlib.backends' not in sys.modules:
import matplotlib
# Repeated calls to use() will not hurt us since `mplbackend`
# is the same each time.
Expand Down