mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'master' into add_override_option
This commit is contained in:
commit
72a0896bd0
1
CHANGES
1
CHANGES
@ -32,6 +32,7 @@ Deprecated
|
||||
deprecated
|
||||
* ``sphinx.locale.l_()`` is deprecated
|
||||
* #2157: helper function ``warn()`` for HTML themes is deprecated
|
||||
* ``env._nitpick_ignore`` is deprecated
|
||||
* ``app.override_domain()`` is deprecated
|
||||
|
||||
For more details, see `deprecation APIs list
|
||||
|
@ -118,6 +118,11 @@ The following is a list of deprecated interface.
|
||||
- 3.0
|
||||
- :meth:`~sphinx.application.Sphinx.add_domain()`
|
||||
|
||||
* - ``BuildEnvironment._nitpick_ignore``
|
||||
- 1.8
|
||||
- 3.0
|
||||
- :confval:`nitpick_ignore`
|
||||
|
||||
* - ``warn()`` (template helper function)
|
||||
- 1.8
|
||||
- 3.0
|
||||
|
@ -10,12 +10,12 @@
|
||||
"""
|
||||
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
||||
from sphinx.ext.apidoc import main as _main
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -532,9 +532,6 @@ class BuildEnvironment(object):
|
||||
self.config = config
|
||||
self._update_settings(config)
|
||||
|
||||
# this cache also needs to be updated every time
|
||||
self._nitpick_ignore = set(self.config.nitpick_ignore)
|
||||
|
||||
# return tuple of (changed, reason)
|
||||
return bool(changed_reason), changed_reason
|
||||
|
||||
@ -864,3 +861,11 @@ class BuildEnvironment(object):
|
||||
warnings.warn('env._read_parallel() is deprecated. Please use builder.read() instead.',
|
||||
RemovedInSphinx30Warning)
|
||||
return self.app.builder._read_parallel(docnames, nproc)
|
||||
|
||||
@property
|
||||
def _nitpick_ignore(self):
|
||||
# type: () -> List[unicode]
|
||||
warnings.warn('env._nitpick_ignore is deprecated. '
|
||||
'Please use config.nitpick_ignore instead.',
|
||||
RemovedInSphinx30Warning)
|
||||
return self.config.nitpick_ignore
|
||||
|
@ -24,15 +24,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes, utils
|
||||
from six import iteritems
|
||||
|
||||
import sphinx
|
||||
from sphinx.util.nodes import split_explicit_title
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -10,11 +10,11 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import sphinx
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -10,8 +10,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
import sphinx
|
||||
@ -20,8 +18,8 @@ from sphinx.ext.mathbase import get_node_equation_number
|
||||
from sphinx.ext.mathbase import setup_math as mathbase_setup
|
||||
from sphinx.locale import _
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -11,8 +11,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
import sphinx
|
||||
@ -21,7 +19,8 @@ from sphinx.ext.mathbase import get_node_equation_number
|
||||
from sphinx.ext.mathbase import setup_math as mathbase_setup
|
||||
from sphinx.locale import _
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -253,7 +253,13 @@ def init_console(locale_dir, catalog):
|
||||
|
||||
.. versionadded:: 1.8
|
||||
"""
|
||||
language, _ = locale.getlocale(locale.LC_MESSAGES) # encoding is ignored
|
||||
try:
|
||||
# encoding is ignored
|
||||
language, _ = locale.getlocale(locale.LC_MESSAGES)
|
||||
except AttributeError:
|
||||
# LC_MESSAGES is not always defined. Fallback to the default language
|
||||
# in case it is not.
|
||||
language = None
|
||||
return init([locale_dir], language, catalog, 'console')
|
||||
|
||||
|
||||
|
@ -10,12 +10,12 @@
|
||||
"""
|
||||
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.cmd.quickstart import main as _main
|
||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -10,11 +10,11 @@ import os
|
||||
import shutil
|
||||
import sys
|
||||
from io import open
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import PY2, text_type
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, IO, List # NOQA
|
||||
|
||||
|
||||
|
@ -156,13 +156,13 @@ class ReferencesResolver(SphinxTransform):
|
||||
warn = node.get('refwarn')
|
||||
if self.config.nitpicky:
|
||||
warn = True
|
||||
if self.env._nitpick_ignore:
|
||||
if self.config.nitpick_ignore:
|
||||
dtype = domain and '%s:%s' % (domain.name, typ) or typ
|
||||
if (dtype, target) in self.env._nitpick_ignore:
|
||||
if (dtype, target) in self.config.nitpick_ignore:
|
||||
warn = False
|
||||
# for "std" types also try without domain name
|
||||
if (not domain or domain.name == 'std') and \
|
||||
(typ, target) in self.env._nitpick_ignore:
|
||||
(typ, target) in self.config.nitpick_ignore:
|
||||
warn = False
|
||||
if not warn:
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user