mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add sphinx.util.typing:unicode to help mypy-3 migration
This commit is contained in:
parent
95dffb2af6
commit
3c99d00605
@ -18,6 +18,7 @@ from sphinx.deprecation import RemovedInSphinx30Warning
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import List, Sequence # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class translatable:
|
||||
|
@ -60,7 +60,7 @@ if False:
|
||||
from sphinx.extension import Extension # NOQA
|
||||
from sphinx.roles import XRefRole # NOQA
|
||||
from sphinx.theming import Theme # NOQA
|
||||
from sphinx.util.typing import RoleFunction, TitleGetter # NOQA
|
||||
from sphinx.util.typing import RoleFunction, TitleGetter, unicode # NOQA
|
||||
|
||||
builtin_extensions = (
|
||||
'sphinx.builders.applehelp',
|
||||
|
@ -47,6 +47,7 @@ if False:
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.i18n import CatalogInfo # NOQA
|
||||
from sphinx.util.tags import Tags # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -39,6 +39,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -31,6 +31,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -27,6 +27,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -36,6 +36,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Dict, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -18,6 +18,7 @@ if False:
|
||||
from typing import Any, Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class DummyBuilder(Builder):
|
||||
|
@ -28,6 +28,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -35,8 +35,9 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.util.i18n import CatalogInfo # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.i18n import CatalogInfo # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -60,6 +60,7 @@ if False:
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.domains import Domain, Index, IndexEntry # NOQA
|
||||
from sphinx.util.tags import Tags # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
# Experimental HTML5 Writer
|
||||
if is_html5_writer_available():
|
||||
@ -675,7 +676,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
doctree.settings = self.docsettings
|
||||
|
||||
self.secnumbers = self.env.toc_secnumbers.get(docname, {})
|
||||
self.fignumbers = self.env.toc_fignumbers.get(docname, {}) # type: Dict[unicode, Dict[unicode, Tuple[int, ...]]] # NOQA
|
||||
self.fignumbers = self.env.toc_fignumbers.get(docname, {})
|
||||
self.imgpath = relative_uri(self.get_target_uri(docname), '_images')
|
||||
self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') # type: unicode
|
||||
self.current_docname = docname
|
||||
|
@ -29,6 +29,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -45,6 +45,7 @@ if False:
|
||||
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
XINDY_LANG_OPTIONS = {
|
||||
|
@ -21,6 +21,7 @@ from sphinx.util.nodes import NodeMatcher
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Set, Tuple, Union # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
URI_SCHEMES = ('mailto:', 'http:', 'https:', 'ftp:')
|
||||
|
||||
|
@ -33,6 +33,7 @@ if False:
|
||||
from typing import Any, Dict, List, Set, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.requests.requests import Response # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -28,6 +28,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Set, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -31,6 +31,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -35,6 +35,7 @@ if False:
|
||||
# For type annotation
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -24,6 +24,7 @@ if False:
|
||||
from typing import Any, Dict, Iterator, Set, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,6 +13,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def setup(app):
|
||||
|
@ -25,6 +25,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterator, Set # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -29,6 +29,7 @@ from sphinx.util.osutil import cd, rmtree
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import List # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
BUILDERS = [
|
||||
|
@ -51,6 +51,7 @@ from sphinx.util.template import SphinxRenderer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, List, Pattern, Union # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
|
||||
|
||||
|
@ -33,6 +33,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.tags import Tags # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,6 +15,7 @@ if False:
|
||||
# For type annotation
|
||||
# note: Don't use typing.TYPE_CHECK here (for py27 and py34).
|
||||
from typing import Any, Dict, Type # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class RemovedInSphinx30Warning(PendingDeprecationWarning):
|
||||
|
@ -36,6 +36,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
# RE to strip backslash escapes
|
||||
|
@ -29,6 +29,7 @@ if False:
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -28,6 +28,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Generator, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
glob_re = re.compile(r'.*[*?\[].*')
|
||||
|
@ -20,6 +20,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class Figure(images.Figure):
|
||||
|
@ -24,7 +24,7 @@ if False:
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.roles import XRefRole # NOQA
|
||||
from sphinx.util.typing import RoleFunction # NOQA
|
||||
from sphinx.util.typing import RoleFunction, unicode # NOQA
|
||||
|
||||
|
||||
class ObjType:
|
||||
|
@ -28,6 +28,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
# RE to split at word boundaries
|
||||
|
@ -27,6 +27,7 @@ if False:
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
versionlabels = {
|
||||
|
@ -36,6 +36,7 @@ if False:
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -29,6 +29,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class JSObject(ObjectDescription):
|
||||
|
@ -25,6 +25,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -31,6 +31,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -25,6 +25,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
|
||||
|
@ -36,7 +36,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import RoleFunction # NOQA
|
||||
from sphinx.util.typing import RoleFunction, unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -40,6 +40,7 @@ if False:
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.domains import Domain # NOQA
|
||||
from sphinx.project import Project # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
if False:
|
||||
# For type annotation
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class ImageAdapter:
|
||||
|
@ -23,6 +23,7 @@ if False:
|
||||
from typing import Any, Dict, Pattern, List, Tuple # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -22,6 +22,7 @@ if False:
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,6 +15,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class EnvironmentCollector:
|
||||
|
@ -29,6 +29,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -23,6 +23,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class DependenciesCollector(EnvironmentCollector):
|
||||
|
@ -21,6 +21,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.applicatin import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -19,6 +19,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class MetadataCollector(EnvironmentCollector):
|
||||
|
@ -20,6 +20,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class TitleCollector(EnvironmentCollector):
|
||||
|
@ -24,6 +24,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class SphinxError(Exception):
|
||||
|
@ -20,6 +20,7 @@ from sphinx.locale import __
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, List # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
# List of all known core events. Maps name to arguments description.
|
||||
|
@ -35,6 +35,7 @@ from sphinx.util.osutil import FileAvoidWrite, ensuredir
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, List, Tuple # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
# automodule options
|
||||
if 'SPHINX_APIDOC_OPTIONS' in os.environ:
|
||||
|
@ -43,6 +43,7 @@ if False:
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.ext.autodoc.directive import DocumenterBridge # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -24,6 +24,7 @@ if False:
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.ext.autodoc import Documenter # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -22,6 +22,7 @@ from sphinx.util.inspect import isenumclass, safe_getattr
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Generator, Iterator, List, Optional, Tuple # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -27,6 +27,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def register_sections_as_label(app, document):
|
||||
|
@ -87,6 +87,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.ext.autodoc import Documenter # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -48,6 +48,7 @@ if False:
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.ext.autodoc import Documenter # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class DummyApplication:
|
||||
|
@ -26,6 +26,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, IO, List, Pattern, Set, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -38,6 +38,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Sequence, Set, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -35,6 +35,7 @@ if False:
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import RoleFunction # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def make_link_role(base_url, prefix):
|
||||
|
@ -18,6 +18,7 @@ if False:
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def create_nojekyll(app, env):
|
||||
|
@ -35,6 +35,7 @@ if False:
|
||||
from docutils.parsers.rst import Directive # NOQA
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -30,6 +30,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class ifconfig(nodes.Element):
|
||||
|
@ -21,6 +21,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -36,6 +36,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -55,6 +55,7 @@ if False:
|
||||
from typing import Any, Dict, List, Tuple, Dict, Optional # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
module_sig_re = re.compile(r'''^(?:([\w.]*)\.)? # module names
|
||||
|
@ -49,6 +49,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
Inventory = Dict[text_type, Dict[text_type, Tuple[text_type, text_type, text_type, text_type]]] # NOQA
|
||||
|
||||
|
@ -23,6 +23,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.writers.html import HTMLTranslator # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def html_visit_math(self, node):
|
||||
|
@ -20,6 +20,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Set # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class LinkcodeError(SphinxError):
|
||||
|
@ -26,6 +26,7 @@ if False:
|
||||
from typing import Any, Callable, List, Tuple # NOQA
|
||||
from docutils.writers.html4css1 import Writer # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class MathDirective(MathDirectiveBase):
|
||||
|
@ -26,6 +26,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.writers.html import HTMLTranslator # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def html_visit_math(self, node):
|
||||
|
@ -16,6 +16,7 @@ from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class Config:
|
||||
|
@ -25,6 +25,7 @@ if False:
|
||||
from typing import Any, Dict, List, Tuple, Type, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config as SphinxConfig # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
_directive_regex = re.compile(r'\.\. \S+::')
|
||||
|
@ -29,6 +29,7 @@ if False:
|
||||
from typing import Any, Dict, Iterable, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -29,6 +29,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -18,6 +18,7 @@ if False:
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -34,6 +34,7 @@ if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from pygments.formatter import Formatter # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -49,6 +49,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
docinfo_re = re.compile(':\\w+:.*?')
|
||||
|
||||
|
@ -28,6 +28,7 @@ if False:
|
||||
from jinja2.environment import Environment # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.theming import Theme # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
def _tobool(val):
|
||||
|
@ -23,6 +23,7 @@ from sphinx.deprecation import RemovedInSphinx30Warning
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class _TranslationProxy(UserString):
|
||||
|
@ -21,6 +21,7 @@ if False:
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.transforms import Transform # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class Parser(docutils.parsers.Parser):
|
||||
|
@ -20,6 +20,7 @@ from sphinx.util.osutil import SEP, relpath
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Dict, List, Set # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
EXCLUDE_PATHS = ['**/_sources', '.#*', '**/.#*', '*.lproj/**'] # type: List[unicode]
|
||||
|
@ -23,6 +23,7 @@ from sphinx.util import get_module_source, detect_encoding
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class ModuleAnalyzer:
|
||||
|
@ -22,6 +22,7 @@ from six import text_type
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
comment_re = re.compile(u'^\\s*#: ?(.*)\r?\n?$')
|
||||
indent_re = re.compile(u'^\\s*$')
|
||||
@ -143,7 +144,7 @@ class TokenProcessor:
|
||||
# type: (List[unicode]) -> None
|
||||
lines = iter(buffers)
|
||||
self.buffers = buffers
|
||||
self.tokens = tokenize.generate_tokens(lambda: next(lines)) # type: ignore # NOQA
|
||||
self.tokens = tokenize.generate_tokens(lambda: next(lines)) # type: ignore
|
||||
self.current = None # type: Token
|
||||
self.previous = None # type: Token
|
||||
|
||||
|
@ -43,7 +43,7 @@ if False:
|
||||
from sphinx.domains import Domain, Index # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.ext.autodoc import Documenter # NOQA
|
||||
from sphinx.util.typing import RoleFunction, TitleGetter # NOQA
|
||||
from sphinx.util.typing import RoleFunction, TitleGetter, unicode # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -26,7 +26,7 @@ if False:
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import RoleFunction # NOQA
|
||||
from sphinx.util.typing import RoleFunction, unicode # NOQA
|
||||
|
||||
|
||||
generic_docroles = {
|
||||
|
@ -26,6 +26,7 @@ if False:
|
||||
from typing import Any, Dict, IO, Iterable, List, Tuple, Type, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class SearchLanguage:
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
danish_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
german_stopwords = parse_stop_word(u'''
|
||||
|
@ -15,6 +15,7 @@ from sphinx.util.stemmer import get_stemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
english_stopwords = set(u"""
|
||||
a and are as at
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
spanish_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
finnish_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
french_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
hungarian_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
italian_stopwords = parse_stop_word(u'''
|
||||
|
@ -42,6 +42,7 @@ from sphinx.util import import_object
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
class BaseSplitter:
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
dutch_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
norwegian_stopwords = parse_stop_word(u'''
|
||||
|
@ -16,6 +16,7 @@ import snowballstemmer
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
from sphinx.util.typing import unicode # NOQA
|
||||
|
||||
|
||||
portuguese_stopwords = parse_stop_word(u'''
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user