Repository: astropy/sphinx-automodapi

Issue:
Sphinx warning: deprecated app.info
With Sphinx v1.8.1, I get these warnings:

> [automodsumm] tools.rst: found 16 automodsumm entries to generate
/home/simon/.pyenv/versions/3.7.0/lib/python3.7/site-packages/sphinx/application.py:402: RemovedInSphinx20Warning: app.info() is now deprecated. Use sphinx.util.logging instead.
  RemovedInSphinx20Warning)

Probably because of this : 

https://github.com/astropy/sphinx-automodapi/blob/23d9f1254599b3b70664ddb634c3dd11d56e30f8/sphinx_automodapi/automodsumm.py#L453

Comments:

Patch:
diff --git a/.travis.yml b/.travis.yml
index dea55d7..994a60f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,10 +31,12 @@ env:
     - PYTHON_VERSION=3.4 SPHINX_VERSION=1.3
     - PYTHON_VERSION=3.5 SPHINX_VERSION=1.4
     - PYTHON_VERSION=3.5 SPHINX_VERSION=1.5
-    - PYTHON_VERSION=3.6 SPHINX_VERSION=1.6 CONDA_CHANNELS="conda-forge"
-    - PYTHON_VERSION=3.6 SPHINX_VERSION=dev CONDA_DEPENDENCIES="setuptools cython pytest-cov"
+    - PYTHON_VERSION=3.6 SPHINX_VERSION=1.6
+    - PYTHON_VERSION=3.6 SPHINX_VERSION=1.7 
+    - PYTHON_VERSION=3.7 SPHINX_VERSION=1.8 
+    - PYTHON_VERSION=3.7 SPHINX_VERSION=dev CONDA_DEPENDENCIES="setuptools cython pytest-cov"
     - PYTHON_VERSION=2.7 LOCALE=C
-    - PYTHON_VERSION=3.6 LOCALE=C
+    - PYTHON_VERSION=3.7 LOCALE=C
   global:
     - LOCALE=default
     - CONDA_DEPENDENCIES="setuptools sphinx cython pytest-cov"
diff --git a/appveyor.yml b/appveyor.yml
index cf51b6e..a73ae4e 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -18,6 +18,7 @@ environment:
       - PYTHON_VERSION: "3.4"
       - PYTHON_VERSION: "3.5"
       - PYTHON_VERSION: "3.6"
+      - PYTHON_VERSION: "3.7"
 
 platform:
     -x64
diff --git a/sphinx_automodapi/automodsumm.py b/sphinx_automodapi/automodsumm.py
index 163d9ac..fcfda34 100644
--- a/sphinx_automodapi/automodsumm.py
+++ b/sphinx_automodapi/automodsumm.py
@@ -96,6 +96,10 @@ from docutils.parsers.rst.directives import flag
 
 from .utils import find_mod_objs, cleanup_whitespace
 
+__all__ = ['Automoddiagram', 'Automodsumm', 'automodsumm_to_autosummary_lines',
+           'generate_automodsumm_docs', 'process_automodsumm_generation']
+
+SPHINX_LT_16 = LooseVersion(__version__) < LooseVersion('1.6')
 SPHINX_LT_17 = LooseVersion(__version__) < LooseVersion('1.7')
 
 
@@ -266,7 +270,7 @@ def process_automodsumm_generation(app):
         suffix = os.path.splitext(sfn)[1]
         if len(lines) > 0:
             generate_automodsumm_docs(
-                lines, sfn, app=app, builder=app.builder, warn=app.warn, info=app.info,
+                lines, sfn, app=app, builder=app.builder,
                 suffix=suffix, base_path=app.srcdir,
                 inherited_members=app.config.automodsumm_inherited_members)
 
@@ -401,8 +405,8 @@ def automodsumm_to_autosummary_lines(fn, app):
     return newlines
 
 
-def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst', warn=None,
-                              info=None, base_path=None, builder=None,
+def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst',
+                              base_path=None, builder=None,
                               template_dir=None,
                               inherited_members=False):
     """
@@ -415,7 +419,6 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst', warn=None,
 
     from sphinx.jinja2glue import BuiltinTemplateLoader
     from sphinx.ext.autosummary import import_by_name, get_documenter
-    from sphinx.ext.autosummary.generate import _simple_info, _simple_warn
     from sphinx.util.osutil import ensuredir
     from sphinx.util.inspect import safe_getattr
     from jinja2 import FileSystemLoader, TemplateNotFound
@@ -423,10 +426,14 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst', warn=None,
 
     from .utils import find_autosummary_in_lines_for_automodsumm as find_autosummary_in_lines
 
-    if info is None:
-        info = _simple_info
-    if warn is None:
-        warn = _simple_warn
+    if SPHINX_LT_16:
+        info = app.info
+        warn = app.warn
+    else:
+        from sphinx.util import logging
+        logger = logging.getLogger(__name__)
+        info = logger.info
+        warn = logger.warning
 
     # info('[automodsumm] generating automodsumm for: ' + srcfn)
 


Test patch:
diff --git a/sphinx_automodapi/tests/test_automodsumm.py b/sphinx_automodapi/tests/test_automodsumm.py
index 0334e75..9336e56 100644
--- a/sphinx_automodapi/tests/test_automodsumm.py
+++ b/sphinx_automodapi/tests/test_automodsumm.py
@@ -61,11 +61,9 @@ ams_to_asmry_expected = """\
 
     Automoddiagram
     Automodsumm
-    SPHINX_LT_17
     automodsumm_to_autosummary_lines
     generate_automodsumm_docs
     process_automodsumm_generation
-    setup
 """