diff --git a/.travis.yml b/.travis.yml index becb347c3700f..b2a1a8a63cfe6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/ci/requirements-2.7_DOC_BUILD.build b/ci/requirements-3.5_DOC_BUILD.build similarity index 52% rename from ci/requirements-2.7_DOC_BUILD.build rename to ci/requirements-3.5_DOC_BUILD.build index faf1e3559f7f1..9558cf00ddf5c 100644 --- a/ci/requirements-2.7_DOC_BUILD.build +++ b/ci/requirements-3.5_DOC_BUILD.build @@ -1,4 +1,4 @@ -dateutil +python-dateutil pytz numpy cython diff --git a/ci/requirements-2.7_DOC_BUILD.run b/ci/requirements-3.5_DOC_BUILD.run similarity index 92% rename from ci/requirements-2.7_DOC_BUILD.run rename to ci/requirements-3.5_DOC_BUILD.run index 9da8e76bc7e22..644a16f51f4b6 100644 --- a/ci/requirements-2.7_DOC_BUILD.run +++ b/ci/requirements-3.5_DOC_BUILD.run @@ -7,7 +7,7 @@ notebook matplotlib scipy lxml -beautiful-soup +beautifulsoup4 html5lib pytables openpyxl=1.8.5 diff --git a/ci/requirements-2.7_DOC_BUILD.sh b/ci/requirements-3.5_DOC_BUILD.sh similarity index 100% rename from ci/requirements-2.7_DOC_BUILD.sh rename to ci/requirements-3.5_DOC_BUILD.sh diff --git a/doc/_templates/autosummary/accessor.rst b/doc/_templates/autosummary/accessor.rst index 1401121fb51c6..4ba745cd6fdba 100644 --- a/doc/_templates/autosummary/accessor.rst +++ b/doc/_templates/autosummary/accessor.rst @@ -3,4 +3,4 @@ .. currentmodule:: {{ module.split('.')[0] }} -.. automethod:: {{ [module.split('.')[1], objname]|join('.') }} +.. autoaccessor:: {{ (module.split('.')[1:] + [objname]) | join('.') }} diff --git a/doc/_templates/autosummary/accessor_attribute.rst b/doc/_templates/autosummary/accessor_attribute.rst index a2f0eb5e068c4..b5ad65d6a736f 100644 --- a/doc/_templates/autosummary/accessor_attribute.rst +++ b/doc/_templates/autosummary/accessor_attribute.rst @@ -3,4 +3,4 @@ .. currentmodule:: {{ module.split('.')[0] }} -.. autoaccessorattribute:: {{ [module.split('.')[1], objname]|join('.') }} +.. autoaccessorattribute:: {{ (module.split('.')[1:] + [objname]) | join('.') }} diff --git a/doc/_templates/autosummary/accessor_callable.rst b/doc/_templates/autosummary/accessor_callable.rst index 6f45e0fd01e16..7a3301814f5f4 100644 --- a/doc/_templates/autosummary/accessor_callable.rst +++ b/doc/_templates/autosummary/accessor_callable.rst @@ -3,4 +3,4 @@ .. currentmodule:: {{ module.split('.')[0] }} -.. autoaccessorcallable:: {{ [module.split('.')[1], objname]|join('.') }}.__call__ +.. autoaccessorcallable:: {{ (module.split('.')[1:] + [objname]) | join('.') }}.__call__ diff --git a/doc/_templates/autosummary/accessor_method.rst b/doc/_templates/autosummary/accessor_method.rst index 43dfc3b813120..aefbba6ef1bbc 100644 --- a/doc/_templates/autosummary/accessor_method.rst +++ b/doc/_templates/autosummary/accessor_method.rst @@ -3,4 +3,4 @@ .. currentmodule:: {{ module.split('.')[0] }} -.. autoaccessormethod:: {{ [module.split('.')[1], objname]|join('.') }} +.. autoaccessormethod:: {{ (module.split('.')[1:] + [objname]) | join('.') }} diff --git a/doc/source/conf.py b/doc/source/conf.py index 4f679f3f728bf..1e82dfca87d17 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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, @@ -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): """ @@ -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) diff --git a/doc/sphinxext/ipython_sphinxext/ipython_directive.py b/doc/sphinxext/ipython_sphinxext/ipython_directive.py index b8b0935cd5b96..49fbacba99592 100644 --- a/doc/sphinxext/ipython_sphinxext/ipython_directive.py +++ b/doc/sphinxext/ipython_sphinxext/ipython_directive.py @@ -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.