mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5421: autodoc emits deprecation warning for :confval:autodoc_default_flags
This commit is contained in:
parent
fa81b67141
commit
21d92b440a
2
CHANGES
2
CHANGES
@ -16,6 +16,8 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #5421: autodoc emits deprecation warning for :confval:`autodoc_default_flags`
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ from docutils.statemachine import ViewList
|
|||||||
from six import iteritems, itervalues, text_type, class_types, string_types
|
from six import iteritems, itervalues, text_type, class_types, string_types
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
from sphinx.deprecation import RemovedInSphinx20Warning, RemovedInSphinx30Warning
|
||||||
from sphinx.errors import ExtensionError
|
from sphinx.errors import ExtensionError
|
||||||
from sphinx.ext.autodoc.importer import mock, import_object, get_object_members
|
from sphinx.ext.autodoc.importer import mock, import_object, get_object_members
|
||||||
from sphinx.ext.autodoc.importer import _MockImporter # to keep compatibility # NOQA
|
from sphinx.ext.autodoc.importer import _MockImporter # to keep compatibility # NOQA
|
||||||
@ -1562,8 +1562,13 @@ def merge_autodoc_default_flags(app, config):
|
|||||||
if not config.autodoc_default_flags:
|
if not config.autodoc_default_flags:
|
||||||
return
|
return
|
||||||
|
|
||||||
logger.warning(__('autodoc_default_flags is now deprecated. '
|
# Note: this option will be removed in Sphinx-4.0. But I marked this as
|
||||||
'Please use autodoc_default_options instead.'))
|
# RemovedInSphinx *30* Warning because we have to emit warnings for users
|
||||||
|
# who will be still in use with Sphinx-3.x. So we should replace this by
|
||||||
|
# logger.warning() on 3.0.0 release.
|
||||||
|
warnings.warn('autodoc_default_flags is now deprecated. '
|
||||||
|
'Please use autodoc_default_options instead.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
|
||||||
for option in config.autodoc_default_flags:
|
for option in config.autodoc_default_flags:
|
||||||
if isinstance(option, string_types):
|
if isinstance(option, string_types):
|
||||||
|
Loading…
Reference in New Issue
Block a user