mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.7'
This commit is contained in:
commit
f8bb40ab30
6
.codecov.yml
Normal file
6
.codecov.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
# allowed to drop X% and still result in a "success" commit status
|
||||||
|
threshold: 0.05
|
7
CHANGES
7
CHANGES
@ -60,6 +60,13 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #4608: epub: Invalid meta tag is generated
|
||||||
|
* #4260: autodoc: keyword only argument separator is not disappeared if it is
|
||||||
|
appeared at top of the argument list
|
||||||
|
* #4622: epub: :confval:`epub_scheme` does not effect to content.opf
|
||||||
|
* #4627: graphviz: Fit graphviz images to page
|
||||||
|
* #4617: quickstart: PROJECT_DIR argument is required
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ import os
|
|||||||
import warnings
|
import warnings
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
from .cmd import build
|
|
||||||
from .deprecation import RemovedInNextVersionWarning
|
from .deprecation import RemovedInNextVersionWarning
|
||||||
from .deprecation import RemovedInSphinx20Warning
|
from .deprecation import RemovedInSphinx20Warning
|
||||||
|
|
||||||
@ -72,6 +71,7 @@ if __version__.endswith('+'):
|
|||||||
|
|
||||||
def main(*args, **kwargs):
|
def main(*args, **kwargs):
|
||||||
# type: (Any, Any) -> int
|
# type: (Any, Any) -> int
|
||||||
|
from .cmd import build
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
'`sphinx.main()` has moved to `sphinx.cmd.build.main()`.',
|
'`sphinx.main()` has moved to `sphinx.cmd.build.main()`.',
|
||||||
RemovedInSphinx20Warning,
|
RemovedInSphinx20Warning,
|
||||||
@ -81,6 +81,7 @@ def main(*args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
from .cmd import build
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
'`sphinx` has moved to `sphinx.build`.',
|
'`sphinx` has moved to `sphinx.build`.',
|
||||||
RemovedInSphinx20Warning,
|
RemovedInSphinx20Warning,
|
||||||
|
@ -9,10 +9,11 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import List, Sequence # NOQA
|
from typing import List, Sequence # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import warnings
|
|||||||
from collections import deque
|
from collections import deque
|
||||||
from inspect import isclass
|
from inspect import isclass
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives, roles
|
from docutils.parsers.rst import Directive, directives, roles
|
||||||
@ -45,8 +46,7 @@ from sphinx.util.i18n import find_catalog_source_files
|
|||||||
from sphinx.util.osutil import abspath, ensuredir
|
from sphinx.util.osutil import abspath, ensuredir
|
||||||
from sphinx.util.tags import Tags
|
from sphinx.util.tags import Tags
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Tuple, Type, Union # NOQA
|
from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Tuple, Type, Union # NOQA
|
||||||
from docutils.parsers import Parser # NOQA
|
from docutils.parsers import Parser # NOQA
|
||||||
from docutils.transform import Transform # NOQA
|
from docutils.transform import Transform # NOQA
|
||||||
@ -136,9 +136,9 @@ class Sphinx(object):
|
|||||||
self.html_themes = {} # type: Dict[unicode, unicode]
|
self.html_themes = {} # type: Dict[unicode, unicode]
|
||||||
|
|
||||||
# validate provided directories
|
# validate provided directories
|
||||||
self.srcdir = abspath(srcdir)
|
self.srcdir = abspath(srcdir) # type: unicode
|
||||||
self.outdir = abspath(outdir)
|
self.outdir = abspath(outdir) # type: unicode
|
||||||
self.doctreedir = abspath(doctreedir)
|
self.doctreedir = abspath(doctreedir) # type: unicode
|
||||||
self.confdir = confdir
|
self.confdir = confdir
|
||||||
if self.confdir: # confdir is optional
|
if self.confdir: # confdir is optional
|
||||||
self.confdir = abspath(self.confdir)
|
self.confdir = abspath(self.confdir)
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
@ -32,8 +33,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
multiprocessing = None
|
multiprocessing = None
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple, Union # NOQA
|
from typing import Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config # NOQA
|
from sphinx.config import Config # NOQA
|
||||||
|
@ -13,6 +13,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile
|
from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
@ -34,8 +35,7 @@ except ImportError:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
Image = None
|
Image = None
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import plistlib
|
|||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
from os import path, environ
|
from os import path, environ
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from sphinx.config import string_classes
|
from sphinx.config import string_classes
|
||||||
@ -27,8 +28,7 @@ from sphinx.util.matching import Matcher
|
|||||||
from sphinx.util.osutil import copyfile, ensuredir, make_filename
|
from sphinx.util.osutil import copyfile, ensuredir, make_filename
|
||||||
from sphinx.util.pycompat import htmlescape
|
from sphinx.util.pycompat import htmlescape
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict # NOQA
|
from typing import Any, Dict # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
@ -24,8 +25,7 @@ from sphinx.util.fileutil import copy_asset_file
|
|||||||
from sphinx.util.osutil import ensuredir, os_path
|
from sphinx.util.osutil import ensuredir, os_path
|
||||||
from sphinx.util.pycompat import htmlescape
|
from sphinx.util.pycompat import htmlescape
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ from __future__ import absolute_import
|
|||||||
import gzip
|
import gzip
|
||||||
import re
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
@ -29,8 +30,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
import lxml.etree as etree # type: ignore
|
import lxml.etree as etree # type: ignore
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List # NOQA
|
from typing import Any, Dict, List # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.builders import Builder
|
from sphinx.builders import Builder
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Set # NOQA
|
from typing import Any, Dict, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx import package_dir
|
from sphinx import package_dir
|
||||||
from sphinx.builders import _epub_base
|
from sphinx.builders import _epub_base
|
||||||
@ -21,8 +22,7 @@ from sphinx.util.fileutil import copy_asset_file
|
|||||||
from sphinx.util.i18n import format_date
|
from sphinx.util.i18n import format_date
|
||||||
from sphinx.util.osutil import make_filename
|
from sphinx.util.osutil import make_filename
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterable, List # NOQA
|
from typing import Any, Dict, Iterable, List # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
@ -144,6 +144,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
|
|||||||
self.globalcontext['theme_writing_mode'] = THEME_WRITING_MODES.get(writing_mode)
|
self.globalcontext['theme_writing_mode'] = THEME_WRITING_MODES.get(writing_mode)
|
||||||
self.globalcontext['html_tag'] = self.html_tag
|
self.globalcontext['html_tag'] = self.html_tag
|
||||||
self.globalcontext['use_meta_charset'] = self.use_meta_charset
|
self.globalcontext['use_meta_charset'] = self.use_meta_charset
|
||||||
|
self.globalcontext['skip_ua_compatible'] = True
|
||||||
|
|
||||||
def build_navlist(self, navnodes):
|
def build_navlist(self, navnodes):
|
||||||
# type: (List[nodes.Node]) -> List[NavPoint]
|
# type: (List[nodes.Node]) -> List[NavPoint]
|
||||||
|
@ -16,6 +16,7 @@ from collections import defaultdict
|
|||||||
from datetime import datetime, tzinfo, timedelta
|
from datetime import datetime, tzinfo, timedelta
|
||||||
from os import path, walk, getenv
|
from os import path, walk, getenv
|
||||||
from time import time
|
from time import time
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from six import iteritems, StringIO
|
from six import iteritems, StringIO
|
||||||
@ -29,8 +30,7 @@ from sphinx.util.nodes import extract_messages, traverse_translatable_index
|
|||||||
from sphinx.util.osutil import safe_relpath, ensuredir, canon_path
|
from sphinx.util.osutil import safe_relpath, ensuredir, canon_path
|
||||||
from sphinx.util.tags import Tags
|
from sphinx.util.tags import Tags
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple # NOQA
|
from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.util.i18n import CatalogInfo # NOQA
|
from sphinx.util.i18n import CatalogInfo # NOQA
|
||||||
|
@ -16,6 +16,7 @@ import sys
|
|||||||
import warnings
|
import warnings
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import docutils
|
import docutils
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
@ -51,8 +52,7 @@ from sphinx.util.osutil import SEP, os_path, relative_uri, ensuredir, \
|
|||||||
movefile, copyfile
|
movefile, copyfile
|
||||||
from sphinx.writers.html import HTMLWriter, HTMLTranslator
|
from sphinx.writers.html import HTMLWriter, HTMLTranslator
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, IO, Iterable, Iterator, List, Type, Tuple, Union # NOQA
|
from typing import Any, Dict, IO, Iterable, Iterator, List, Type, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config # NOQA
|
from sphinx.config import Config # NOQA
|
||||||
@ -600,9 +600,9 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
doctree.settings = self.docsettings
|
doctree.settings = self.docsettings
|
||||||
|
|
||||||
self.secnumbers = self.env.toc_secnumbers.get(docname, {})
|
self.secnumbers = self.env.toc_secnumbers.get(docname, {})
|
||||||
self.fignumbers = self.env.toc_fignumbers.get(docname, {})
|
self.fignumbers = self.env.toc_fignumbers.get(docname, {}) # type: Dict[unicode, Dict[unicode, Tuple[int, ...]]] # NOQA
|
||||||
self.imgpath = relative_uri(self.get_target_uri(docname), '_images')
|
self.imgpath = relative_uri(self.get_target_uri(docname), '_images')
|
||||||
self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads')
|
self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads') # type: unicode
|
||||||
self.current_docname = docname
|
self.current_docname = docname
|
||||||
self.docwriter.write(doctree, destination)
|
self.docwriter.write(doctree, destination)
|
||||||
self.docwriter.assemble_parts()
|
self.docwriter.assemble_parts()
|
||||||
|
@ -14,6 +14,7 @@ from __future__ import print_function
|
|||||||
import codecs
|
import codecs
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
@ -24,8 +25,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.osutil import make_filename
|
from sphinx.util.osutil import make_filename
|
||||||
from sphinx.util.pycompat import htmlescape
|
from sphinx.util.pycompat import htmlescape
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.frontend import OptionParser
|
from docutils.frontend import OptionParser
|
||||||
@ -32,8 +33,7 @@ from sphinx.util.nodes import inline_all_toctrees
|
|||||||
from sphinx.util.osutil import SEP, make_filename
|
from sphinx.util.osutil import SEP, make_filename
|
||||||
from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
|
from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config # NOQA
|
from sphinx.config import Config # NOQA
|
||||||
|
@ -14,6 +14,7 @@ import re
|
|||||||
import socket
|
import socket
|
||||||
import threading
|
import threading
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
@ -37,8 +38,7 @@ from sphinx.util.console import ( # type: ignore
|
|||||||
)
|
)
|
||||||
from sphinx.util.requests import is_ssl_error
|
from sphinx.util.requests import is_ssl_error
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Set, Tuple, Union # NOQA
|
from typing import Any, Dict, List, Set, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.util.requests.requests import Response # NOQA
|
from sphinx.util.requests.requests import Response # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.frontend import OptionParser
|
from docutils.frontend import OptionParser
|
||||||
from docutils.io import FileOutput
|
from docutils.io import FileOutput
|
||||||
@ -24,8 +25,7 @@ from sphinx.util.nodes import inline_all_toctrees
|
|||||||
from sphinx.util.osutil import make_filename
|
from sphinx.util.osutil import make_filename
|
||||||
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
|
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Set, Union # NOQA
|
from typing import Any, Dict, List, Set, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import os
|
|||||||
import posixpath
|
import posixpath
|
||||||
import re
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from six import text_type
|
from six import text_type
|
||||||
@ -26,8 +27,7 @@ from sphinx.util import force_decode, logging
|
|||||||
from sphinx.util.osutil import make_filename
|
from sphinx.util.osutil import make_filename
|
||||||
from sphinx.util.pycompat import htmlescape
|
from sphinx.util.pycompat import htmlescape
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.frontend import OptionParser
|
from docutils.frontend import OptionParser
|
||||||
@ -30,8 +31,7 @@ from sphinx.util.nodes import inline_all_toctrees
|
|||||||
from sphinx.util.osutil import SEP, make_filename
|
from sphinx.util.osutil import SEP, make_filename
|
||||||
from sphinx.writers.texinfo import TexinfoWriter, TexinfoTranslator
|
from sphinx.writers.texinfo import TexinfoWriter, TexinfoTranslator
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.io import StringOutput
|
from docutils.io import StringOutput
|
||||||
|
|
||||||
@ -19,8 +20,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.osutil import ensuredir, os_path
|
from sphinx.util.osutil import ensuredir, os_path
|
||||||
from sphinx.writers.text import TextWriter, TextTranslator
|
from sphinx.writers.text import TextWriter, TextTranslator
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterator, Set, Tuple # NOQA
|
from typing import Any, Dict, Iterator, Set, Tuple # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if False:
|
from typing import TYPE_CHECKING
|
||||||
# For type annotation
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Dict # NOQA
|
from typing import Any, Dict # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.io import StringOutput
|
from docutils.io import StringOutput
|
||||||
@ -21,8 +22,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.osutil import ensuredir, os_path
|
from sphinx.util.osutil import ensuredir, os_path
|
||||||
from sphinx.writers.xml import XMLWriter, PseudoXMLWriter
|
from sphinx.writers.xml import XMLWriter, PseudoXMLWriter
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterator, Set # NOQA
|
from typing import Any, Dict, Iterator, Set # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import List # NOQA
|
from typing import List # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import time
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from io import open
|
from io import open
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
# try to import readline, unix specific enhancement
|
# try to import readline, unix specific enhancement
|
||||||
try:
|
try:
|
||||||
@ -43,8 +44,7 @@ from sphinx.util.console import ( # type: ignore
|
|||||||
from sphinx.util.osutil import ensuredir, make_filename
|
from sphinx.util.osutil import ensuredir, make_filename
|
||||||
from sphinx.util.template import SphinxRenderer
|
from sphinx.util.template import SphinxRenderer
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, List, Pattern, Union # NOQA
|
from typing import Any, Callable, Dict, List, Pattern, Union # NOQA
|
||||||
|
|
||||||
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
|
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
|
||||||
@ -533,7 +533,7 @@ Makefile to be used with sphinx-build.
|
|||||||
parser.add_argument('--version', action='version', dest='show_version',
|
parser.add_argument('--version', action='version', dest='show_version',
|
||||||
version='%%(prog)s %s' % __display_version__)
|
version='%%(prog)s %s' % __display_version__)
|
||||||
|
|
||||||
parser.add_argument('path', metavar='PROJECT_DIR', default='.',
|
parser.add_argument('path', metavar='PROJECT_DIR', default='.', nargs='?',
|
||||||
help='output path')
|
help='output path')
|
||||||
|
|
||||||
group = parser.add_argument_group('Structure options')
|
group = parser.add_argument_group('Structure options')
|
||||||
|
@ -15,6 +15,7 @@ import multiprocessing
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.utils import SystemMessage
|
from docutils.utils import SystemMessage
|
||||||
from six import text_type, binary_type
|
from six import text_type, binary_type
|
||||||
@ -27,8 +28,7 @@ from sphinx.util.console import red, nocolor, color_terminal # type: ignore
|
|||||||
from sphinx.util.docutils import docutils_namespace, patch_docutils
|
from sphinx.util.docutils import docutils_namespace, patch_docutils
|
||||||
from sphinx.util.pycompat import terminal_safe
|
from sphinx.util.pycompat import terminal_safe
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, IO, List, Union # NOQA
|
from typing import Any, IO, List, Union # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import re
|
|||||||
import traceback
|
import traceback
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from os import path, getenv
|
from os import path, getenv
|
||||||
from typing import Any, NamedTuple, Union
|
from typing import TYPE_CHECKING, Any, NamedTuple, Union
|
||||||
|
|
||||||
from six import PY2, PY3, iteritems, string_types, binary_type, text_type, integer_types
|
from six import PY2, PY3, iteritems, string_types, binary_type, text_type, integer_types
|
||||||
|
|
||||||
@ -24,8 +24,7 @@ from sphinx.util.i18n import format_date
|
|||||||
from sphinx.util.osutil import cd
|
from sphinx.util.osutil import cd
|
||||||
from sphinx.util.pycompat import execfile_, NoneType
|
from sphinx.util.pycompat import execfile_, NoneType
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
|
from typing import Any, Callable, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.util.tags import Tags # NOQA
|
from sphinx.util.tags import Tags # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives, roles
|
from docutils.parsers.rst import Directive, directives, roles
|
||||||
@ -29,8 +30,7 @@ from sphinx.directives.patches import ( # noqa
|
|||||||
Figure, Meta
|
Figure, Meta
|
||||||
)
|
)
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List # NOQA
|
from typing import Any, Dict, List # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
import codecs
|
import codecs
|
||||||
import sys
|
import sys
|
||||||
from difflib import unified_diff
|
from difflib import unified_diff
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -21,8 +22,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util import parselinenos
|
from sphinx.util import parselinenos
|
||||||
from sphinx.util.nodes import set_source_info
|
from sphinx.util.nodes import set_source_info
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config # NOQA
|
from sphinx.config import Config # NOQA
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
|
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
|
||||||
@ -21,8 +23,7 @@ from sphinx.util.matching import patfilter
|
|||||||
from sphinx.util.nodes import explicit_title_re, set_source_info, \
|
from sphinx.util.nodes import explicit_title_re, set_source_info, \
|
||||||
process_index_entry
|
process_index_entry
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import directives
|
from docutils.parsers.rst import directives
|
||||||
from docutils.parsers.rst.directives import images, html, tables
|
from docutils.parsers.rst.directives import images, html, tables
|
||||||
@ -14,8 +16,7 @@ from docutils.parsers.rst.directives import images, html, tables
|
|||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx.util.nodes import set_source_info
|
from sphinx.util.nodes import set_source_info
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, List, Tuple # NOQA
|
from typing import Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
from sphinx.errors import SphinxError
|
from sphinx.errors import SphinxError
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterable, List, Tuple, Type, Union # NOQA
|
from typing import Any, Callable, Dict, Iterable, List, Tuple, Type, Union # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from docutils.parsers.rst.states import Inliner # NOQA
|
from docutils.parsers.rst.states import Inliner # NOQA
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
@ -22,8 +23,7 @@ from sphinx.roles import XRefRole
|
|||||||
from sphinx.util.docfields import Field, TypedField
|
from sphinx.util.docfields import Field, TypedField
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -28,8 +29,7 @@ from sphinx.util.nodes import make_refnode
|
|||||||
from sphinx.util.pycompat import UnicodeMixin
|
from sphinx.util.pycompat import UnicodeMixin
|
||||||
|
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Match, Pattern, Tuple, Union # NOQA
|
from typing import Any, Callable, Dict, Iterator, List, Match, Pattern, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
|
|
||||||
@ -21,8 +23,7 @@ from sphinx.roles import XRefRole
|
|||||||
from sphinx.util.docfields import Field, GroupedField, TypedField
|
from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -24,8 +25,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.docfields import Field, GroupedField, TypedField
|
from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
|
from typing import Any, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
@ -20,8 +21,7 @@ from sphinx.locale import l_, _
|
|||||||
from sphinx.roles import XRefRole
|
from sphinx.roles import XRefRole
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -25,8 +26,7 @@ from sphinx.roles import XRefRole
|
|||||||
from sphinx.util import ws_re, logging, docname_join
|
from sphinx.util import ws_re, logging, docname_join
|
||||||
from sphinx.util.nodes import clean_astext, make_refnode
|
from sphinx.util.nodes import clean_astext, make_refnode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Type, Union # NOQA
|
from typing import Any, Callable, Dict, Iterator, List, Tuple, Type, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -18,6 +18,7 @@ import warnings
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.frontend import OptionParser
|
from docutils.frontend import OptionParser
|
||||||
from docutils.utils import Reporter, get_source_line
|
from docutils.utils import Reporter, get_source_line
|
||||||
@ -42,8 +43,7 @@ from sphinx.util.osutil import SEP, ensuredir
|
|||||||
from sphinx.util.parallel import ParallelTasks, parallel_available, make_chunks
|
from sphinx.util.parallel import ParallelTasks, parallel_available, make_chunks
|
||||||
from sphinx.util.websupport import is_commentable
|
from sphinx.util.websupport import is_commentable
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Pattern, Set, Tuple, Type, Union, Generator # NOQA
|
from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Pattern, Set, Tuple, Type, Union, Generator # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
@ -165,8 +165,8 @@ class BuildEnvironment(object):
|
|||||||
# type: (Sphinx) -> None
|
# type: (Sphinx) -> None
|
||||||
self.app = app
|
self.app = app
|
||||||
self.doctreedir = app.doctreedir
|
self.doctreedir = app.doctreedir
|
||||||
self.srcdir = app.srcdir
|
self.srcdir = app.srcdir # type: unicode
|
||||||
self.config = app.config
|
self.config = app.config # type: Config
|
||||||
|
|
||||||
# the method of doctree versioning; see set_versioning_method
|
# the method of doctree versioning; see set_versioning_method
|
||||||
self.versioning_condition = None # type: Union[bool, Callable]
|
self.versioning_condition = None # type: Union[bool, Callable]
|
||||||
@ -183,7 +183,7 @@ class BuildEnvironment(object):
|
|||||||
self._warnfunc = None # type: Callable
|
self._warnfunc = None # type: Callable
|
||||||
|
|
||||||
# this is to invalidate old pickles
|
# this is to invalidate old pickles
|
||||||
self.version = app.registry.get_envversion(app)
|
self.version = app.registry.get_envversion(app) # type: Dict[unicode, unicode]
|
||||||
|
|
||||||
# All "docnames" here are /-separated and relative and exclude
|
# All "docnames" here are /-separated and relative and exclude
|
||||||
# the source suffix.
|
# the source suffix.
|
||||||
@ -248,8 +248,8 @@ class BuildEnvironment(object):
|
|||||||
# lineno, module, descname, content)
|
# lineno, module, descname, content)
|
||||||
|
|
||||||
# these map absolute path -> (docnames, unique filename)
|
# these map absolute path -> (docnames, unique filename)
|
||||||
self.images = FilenameUniqDict()
|
self.images = FilenameUniqDict() # type: FilenameUniqDict
|
||||||
self.dlfiles = FilenameUniqDict()
|
self.dlfiles = FilenameUniqDict() # type: FilenameUniqDict
|
||||||
|
|
||||||
# the original URI for images
|
# the original URI for images
|
||||||
self.original_image_uri = {} # type: Dict[unicode, unicode]
|
self.original_image_uri = {} # type: Dict[unicode, unicode]
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if False:
|
from typing import TYPE_CHECKING
|
||||||
# For type annotation
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,14 +12,14 @@ import bisect
|
|||||||
import re
|
import re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import text_type, iteritems
|
from six import text_type, iteritems
|
||||||
|
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
from sphinx.util import split_into, logging
|
from sphinx.util import split_into, logging
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Pattern, List, Tuple # NOQA
|
from typing import Any, Dict, Pattern, List, Tuple # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
@ -16,8 +18,7 @@ from sphinx import addnodes
|
|||||||
from sphinx.util import url_re, logging
|
from sphinx.util import url_re, logging
|
||||||
from sphinx.util.nodes import clean_astext, process_only_nodes
|
from sphinx.util.nodes import clean_astext, process_only_nodes
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List # NOQA
|
from typing import Any, Dict, List # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -9,10 +9,11 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import itervalues
|
from six import itervalues
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, List, Set # NOQA
|
from typing import Dict, List, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.sphinx import Sphinx # NOQA
|
from sphinx.sphinx import Sphinx # NOQA
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
import os
|
import os
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.utils import relative_path
|
from docutils.utils import relative_path
|
||||||
@ -23,8 +24,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.i18n import get_image_filename_for_language, search_image_for_language
|
from sphinx.util.i18n import get_image_filename_for_language, search_image_for_language
|
||||||
from sphinx.util.images import guess_mimetype
|
from sphinx.util.images import guess_mimetype
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, List, Set, Tuple # NOQA
|
from typing import Dict, List, Set, Tuple # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.sphinx import Sphinx # NOQA
|
from sphinx.sphinx import Sphinx # NOQA
|
||||||
|
@ -10,14 +10,14 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.utils import relative_path
|
from docutils.utils import relative_path
|
||||||
|
|
||||||
from sphinx.environment.collectors import EnvironmentCollector
|
from sphinx.environment.collectors import EnvironmentCollector
|
||||||
from sphinx.util.osutil import getcwd, fs_encoding
|
from sphinx.util.osutil import getcwd, fs_encoding
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, Set # NOQA
|
from typing import Dict, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.sphinx import Sphinx # NOQA
|
from sphinx.sphinx import Sphinx # NOQA
|
||||||
|
@ -9,12 +9,13 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx.environment.collectors import EnvironmentCollector
|
from sphinx.environment.collectors import EnvironmentCollector
|
||||||
from sphinx.util import split_index_msg, logging
|
from sphinx.util import split_index_msg, logging
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, Set # NOQA
|
from typing import Dict, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.applicatin import Sphinx # NOQA
|
from sphinx.applicatin import Sphinx # NOQA
|
||||||
|
@ -9,12 +9,13 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
from sphinx.environment.collectors import EnvironmentCollector
|
from sphinx.environment.collectors import EnvironmentCollector
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, Set # NOQA
|
from typing import Dict, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.sphinx import Sphinx # NOQA
|
from sphinx.sphinx import Sphinx # NOQA
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
from sphinx.environment.collectors import EnvironmentCollector
|
from sphinx.environment.collectors import EnvironmentCollector
|
||||||
from sphinx.transforms import SphinxContentsFilter
|
from sphinx.transforms import SphinxContentsFilter
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, Set # NOQA
|
from typing import Dict, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.sphinx import Sphinx # NOQA
|
from sphinx.sphinx import Sphinx # NOQA
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
@ -18,8 +20,7 @@ from sphinx.environment.collectors import EnvironmentCollector
|
|||||||
from sphinx.transforms import SphinxContentsFilter
|
from sphinx.transforms import SphinxContentsFilter
|
||||||
from sphinx.util import url_re, logging
|
from sphinx.util import url_re, logging
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Set, Tuple # NOQA
|
from typing import Any, Dict, List, Set, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if False:
|
from typing import TYPE_CHECKING
|
||||||
# For type annotation
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from typing import Any # NOQA
|
from typing import Any # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,14 +13,14 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from collections import OrderedDict, defaultdict
|
from collections import OrderedDict, defaultdict
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import itervalues
|
from six import itervalues
|
||||||
|
|
||||||
from sphinx.errors import ExtensionError
|
from sphinx.errors import ExtensionError
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, List # NOQA
|
from typing import Any, Callable, Dict, List # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import binary_type
|
from six import binary_type
|
||||||
|
|
||||||
@ -31,8 +32,7 @@ from sphinx.cmd.quickstart import EXTENSIONS
|
|||||||
from sphinx.util import rst
|
from sphinx.util import rst
|
||||||
from sphinx.util.osutil import FileAvoidWrite, ensuredir, walk
|
from sphinx.util.osutil import FileAvoidWrite, ensuredir, walk
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, List, Tuple # NOQA
|
from typing import Any, List, Tuple # NOQA
|
||||||
|
|
||||||
# automodule options
|
# automodule options
|
||||||
|
@ -15,6 +15,7 @@ import inspect
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.statemachine import ViewList
|
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
|
||||||
@ -34,13 +35,13 @@ from sphinx.util.inspect import Signature, isdescriptor, safe_getmembers, \
|
|||||||
safe_getattr, object_description, is_builtin_class_method, \
|
safe_getattr, object_description, is_builtin_class_method, \
|
||||||
isenumattribute, isclassmethod, isstaticmethod, getdoc
|
isenumattribute, isclassmethod, isstaticmethod, getdoc
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from types import ModuleType # NOQA
|
from types import ModuleType # NOQA
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Sequence, Set, Tuple, Type, Union # NOQA
|
from typing import Any, Callable, Dict, Iterator, List, Sequence, Set, Tuple, Type, Union # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from docutils.utils import Reporter # NOQA
|
from docutils.utils import Reporter # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
from sphinx.ext.autodoc.directive import DocumenterBridge # NOQA
|
from sphinx.ext.autodoc.directive import DocumenterBridge # NOQA
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -281,7 +282,7 @@ class Documenter(object):
|
|||||||
def __init__(self, directive, name, indent=u''):
|
def __init__(self, directive, name, indent=u''):
|
||||||
# type: (DocumenterBridge, unicode, unicode) -> None
|
# type: (DocumenterBridge, unicode, unicode) -> None
|
||||||
self.directive = directive
|
self.directive = directive
|
||||||
self.env = directive.env
|
self.env = directive.env # type: BuildEnvironment
|
||||||
self.options = directive.genopt
|
self.options = directive.genopt
|
||||||
self.name = name
|
self.name = name
|
||||||
self.indent = indent
|
self.indent = indent
|
||||||
@ -745,7 +746,7 @@ class Documenter(object):
|
|||||||
# where the attribute documentation would actually be found in.
|
# where the attribute documentation would actually be found in.
|
||||||
# This is used for situations where you have a module that collects the
|
# This is used for situations where you have a module that collects the
|
||||||
# functions and classes of internal submodules.
|
# functions and classes of internal submodules.
|
||||||
self.real_modname = real_modname or self.get_real_modname()
|
self.real_modname = real_modname or self.get_real_modname() # type: str
|
||||||
|
|
||||||
# try to also get a source code analyzer for attribute docs
|
# try to also get a source code analyzer for attribute docs
|
||||||
try:
|
try:
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive
|
from docutils.parsers.rst import Directive
|
||||||
from docutils.statemachine import ViewList
|
from docutils.statemachine import ViewList
|
||||||
@ -17,8 +19,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.docutils import switch_source_input
|
from sphinx.util.docutils import switch_source_input
|
||||||
from sphinx.util.nodes import nested_parse_with_titles
|
from sphinx.util.nodes import nested_parse_with_titles
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Set, Type # NOQA
|
from typing import Any, Dict, List, Set, Type # NOQA
|
||||||
from docutils.statemachine import State, StateMachine, StringList # NOQA
|
from docutils.statemachine import State, StateMachine, StringList # NOQA
|
||||||
from docutils.utils import Reporter # NOQA
|
from docutils.utils import Reporter # NOQA
|
||||||
|
@ -15,14 +15,14 @@ import traceback
|
|||||||
import warnings
|
import warnings
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from types import FunctionType, MethodType, ModuleType
|
from types import FunctionType, MethodType, ModuleType
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import PY2
|
from six import PY2
|
||||||
|
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.inspect import isenumclass, safe_getattr
|
from sphinx.util.inspect import isenumclass, safe_getattr
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Generator, List, Optional # NOQA
|
from typing import Any, Callable, Dict, Generator, List, Optional # NOQA
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
import typing
|
import typing
|
||||||
import warnings
|
import warnings
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import StringIO, string_types
|
from six import StringIO, string_types
|
||||||
|
|
||||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
from sphinx.deprecation import RemovedInSphinx20Warning
|
||||||
from sphinx.util.inspect import object_description
|
from sphinx.util.inspect import object_description
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Tuple # NOQA
|
from typing import Any, Callable, Dict, Tuple # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
@ -22,7 +24,7 @@ if False:
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
# For type annotation
|
||||||
from typing import Any, Dict # NOQA
|
from typing import Any, Dict # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -59,6 +59,7 @@ import posixpath
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -75,8 +76,7 @@ from sphinx.ext.autodoc.importer import import_module
|
|||||||
from sphinx.pycode import ModuleAnalyzer, PycodeError
|
from sphinx.pycode import ModuleAnalyzer, PycodeError
|
||||||
from sphinx.util import import_object, rst, logging
|
from sphinx.util import import_object, rst, logging
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple, Type, Union # NOQA
|
from typing import Any, Dict, List, Tuple, Type, Union # NOQA
|
||||||
from docutils.utils import Inliner # NOQA
|
from docutils.utils import Inliner # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -25,6 +25,7 @@ import os
|
|||||||
import pydoc
|
import pydoc
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from jinja2 import FileSystemLoader, TemplateNotFound
|
from jinja2 import FileSystemLoader, TemplateNotFound
|
||||||
from jinja2.sandbox import SandboxedEnvironment
|
from jinja2.sandbox import SandboxedEnvironment
|
||||||
@ -38,8 +39,7 @@ from sphinx.util.inspect import safe_getattr
|
|||||||
from sphinx.util.osutil import ensuredir
|
from sphinx.util.osutil import ensuredir
|
||||||
from sphinx.util.rst import escape as rst_escape
|
from sphinx.util.rst import escape as rst_escape
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Tuple, List # NOQA
|
from typing import Any, Callable, Dict, Tuple, List # NOQA
|
||||||
from jinja2 import BaseLoader # NOQA
|
from jinja2 import BaseLoader # NOQA
|
||||||
from sphinx import addnodes # NOQA
|
from sphinx import addnodes # NOQA
|
||||||
|
@ -14,6 +14,7 @@ import glob
|
|||||||
import inspect
|
import inspect
|
||||||
import re
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
from six.moves import cPickle as pickle
|
from six.moves import cPickle as pickle
|
||||||
@ -23,8 +24,7 @@ from sphinx.builders import Builder
|
|||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.inspect import safe_getattr
|
from sphinx.util.inspect import safe_getattr
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, IO, List, Pattern, Set, Tuple # NOQA
|
from typing import Any, Callable, Dict, IO, List, Pattern, Set, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -32,8 +33,7 @@ from sphinx.util.console import bold # type: ignore
|
|||||||
from sphinx.util.nodes import set_source_info
|
from sphinx.util.nodes import set_source_info
|
||||||
from sphinx.util.osutil import fs_encoding
|
from sphinx.util.osutil import fs_encoding
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Sequence, Set, Tuple # NOQA
|
from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Sequence, Set, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import re
|
|||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
from os import path
|
from os import path
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -29,8 +30,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.i18n import search_image_for_language
|
from sphinx.util.i18n import search_image_for_language
|
||||||
from sphinx.util.osutil import ensuredir, ENOENT, EPIPE, EINVAL
|
from sphinx.util.osutil import ensuredir, ENOENT, EPIPE, EINVAL
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -20,14 +20,15 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive
|
from docutils.parsers.rst import Directive
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
from sphinx.util.nodes import set_source_info
|
from sphinx.util.nodes import set_source_info
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List # NOQA
|
from typing import Any, Dict, List # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.errors import ExtensionError
|
from sphinx.errors import ExtensionError
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
@ -16,8 +17,7 @@ from sphinx.transforms.post_transforms.images import ImageConverter
|
|||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.osutil import ENOENT, EPIPE, EINVAL
|
from sphinx.util.osutil import ENOENT, EPIPE, EINVAL
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict # NOQA
|
from typing import Any, Dict # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ import tempfile
|
|||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
from os import path
|
from os import path
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from six import text_type
|
from six import text_type
|
||||||
@ -31,8 +32,7 @@ from sphinx.util.osutil import ensuredir, ENOENT, cd
|
|||||||
from sphinx.util.png import read_png_depth, write_png_depth
|
from sphinx.util.png import read_png_depth, write_png_depth
|
||||||
from sphinx.util.pycompat import sys_encoding
|
from sphinx.util.pycompat import sys_encoding
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple # NOQA
|
from typing import Any, Dict, List, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -40,6 +40,7 @@ import inspect
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -52,8 +53,7 @@ from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
|
|||||||
from sphinx.pycode import ModuleAnalyzer
|
from sphinx.pycode import ModuleAnalyzer
|
||||||
from sphinx.util import force_decode
|
from sphinx.util import force_decode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple, Dict, Optional # NOQA
|
from typing import Any, Dict, List, Tuple, Dict, Optional # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -31,6 +31,7 @@ import posixpath
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.utils import relative_path
|
from docutils.utils import relative_path
|
||||||
@ -43,8 +44,7 @@ from sphinx.locale import _
|
|||||||
from sphinx.util import requests, logging
|
from sphinx.util import requests, logging
|
||||||
from sphinx.util.inventory import InventoryFile
|
from sphinx.util.inventory import InventoryFile
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, IO, List, Tuple, Union # NOQA
|
from typing import Any, Dict, IO, List, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config # NOQA
|
from sphinx.config import Config # NOQA
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
@ -16,8 +18,7 @@ from sphinx import addnodes
|
|||||||
from sphinx.errors import SphinxError
|
from sphinx.errors import SphinxError
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Set # NOQA
|
from typing import Any, Dict, Set # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes, utils
|
from docutils import nodes, utils
|
||||||
from docutils.nodes import make_id
|
from docutils.nodes import make_id
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
@ -20,8 +22,7 @@ from sphinx.roles import XRefRole
|
|||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.nodes import make_refnode, set_source_info
|
from sphinx.util.nodes import make_refnode, set_source_info
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterable, List, Tuple # NOQA
|
from typing import Any, Callable, Dict, Iterable, List, Tuple # NOQA
|
||||||
from docutils.parsers.rst.states import Inliner # NOQA
|
from docutils.parsers.rst.states import Inliner # NOQA
|
||||||
from docutils.writers.html4css1 import Writer # NOQA
|
from docutils.writers.html4css1 import Writer # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import PY2, iteritems
|
from six import PY2, iteritems
|
||||||
|
|
||||||
@ -17,8 +18,7 @@ import sphinx
|
|||||||
from sphinx.application import Sphinx
|
from sphinx.application import Sphinx
|
||||||
from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
|
from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List # NOQA
|
from typing import Any, Dict, List # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import collections
|
|||||||
import inspect
|
import inspect
|
||||||
import re
|
import re
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import string_types, u
|
from six import string_types, u
|
||||||
from six.moves import range
|
from six.moves import range
|
||||||
@ -22,8 +23,7 @@ from six.moves import range
|
|||||||
from sphinx.ext.napoleon.iterators import modify_iter
|
from sphinx.ext.napoleon.iterators import modify_iter
|
||||||
from sphinx.util.pycompat import UnicodeMixin
|
from sphinx.util.pycompat import UnicodeMixin
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, List, Tuple, Union # NOQA
|
from typing import Any, Callable, Dict, List, Tuple, Union # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config as SphinxConfig # NOQA
|
from sphinx.config import Config as SphinxConfig # NOQA
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Iterable # NOQA
|
from typing import Any, Iterable # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import tempfile
|
|||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
from os import path
|
from os import path
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from six import text_type
|
from six import text_type
|
||||||
@ -31,8 +32,7 @@ from sphinx.util.osutil import ensuredir, ENOENT, cd
|
|||||||
from sphinx.util.png import read_png_depth, write_png_depth
|
from sphinx.util.png import read_png_depth, write_png_depth
|
||||||
from sphinx.util.pycompat import sys_encoding
|
from sphinx.util.pycompat import sys_encoding
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Tuple # NOQA
|
from typing import Any, Dict, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.ext.mathbase import math as math_node, displaymath # NOQA
|
from sphinx.ext.mathbase import math as math_node, displaymath # NOQA
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive
|
from docutils.parsers.rst import Directive
|
||||||
from docutils.parsers.rst import directives
|
from docutils.parsers.rst import directives
|
||||||
@ -24,8 +26,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.nodes import set_source_info
|
from sphinx.util.nodes import set_source_info
|
||||||
from sphinx.util.texescape import tex_escape_map
|
from sphinx.util.texescape import tex_escape_map
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterable, List # NOQA
|
from typing import Any, Dict, Iterable, List # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from six import iteritems, text_type
|
from six import iteritems, text_type
|
||||||
@ -21,8 +22,7 @@ from sphinx.pycode import ModuleAnalyzer
|
|||||||
from sphinx.util import get_full_modname, logging, status_iterator
|
from sphinx.util import get_full_modname, logging, status_iterator
|
||||||
from sphinx.util.nodes import make_refnode
|
from sphinx.util.nodes import make_refnode
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, Iterable, Iterator, Set, Tuple # NOQA
|
from typing import Any, Dict, Iterable, Iterator, Set, Tuple # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -9,14 +9,15 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
from sphinx.errors import VersionRequirementError
|
from sphinx.errors import VersionRequirementError
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict # NOQA
|
from typing import Any, Dict # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
from sphinx.config import Config # NOQA
|
from sphinx.config import Config # NOQA
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from pygments import highlight
|
from pygments import highlight
|
||||||
from pygments.filters import ErrorToken
|
from pygments.filters import ErrorToken
|
||||||
from pygments.formatters import HtmlFormatter, LatexFormatter
|
from pygments.formatters import HtmlFormatter, LatexFormatter
|
||||||
@ -26,8 +28,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.pycompat import htmlescape
|
from sphinx.util.pycompat import htmlescape
|
||||||
from sphinx.util.texescape import tex_hl_escape_map_new
|
from sphinx.util.texescape import tex_hl_escape_map_new
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict # NOQA
|
from typing import Any, Dict # NOQA
|
||||||
from pygments.formatter import Formatter # NOQA
|
from pygments.formatter import Formatter # NOQA
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
import codecs
|
import codecs
|
||||||
import re
|
import re
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils.core import Publisher
|
from docutils.core import Publisher
|
||||||
from docutils.io import FileInput, NullOutput
|
from docutils.io import FileInput, NullOutput
|
||||||
@ -33,8 +34,7 @@ from sphinx.transforms.i18n import (
|
|||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.docutils import LoggingReporter
|
from sphinx.util.docutils import LoggingReporter
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple, Union # NOQA
|
from typing import Any, Dict, List, Tuple, Union # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from docutils.io import Input # NOQA
|
from docutils.io import Input # NOQA
|
||||||
@ -305,7 +305,7 @@ def read_doc(app, env, filename):
|
|||||||
source_class=SphinxDummySourceClass,
|
source_class=SphinxDummySourceClass,
|
||||||
destination=NullOutput())
|
destination=NullOutput())
|
||||||
pub.set_components(None, 'restructuredtext', None)
|
pub.set_components(None, 'restructuredtext', None)
|
||||||
pub.process_programmatic_settings(None, env.settings, None)
|
pub.process_programmatic_settings(None, env.settings, None) # type: ignore
|
||||||
pub.set_source(source, filename)
|
pub.set_source(source, filename)
|
||||||
pub.publish()
|
pub.publish()
|
||||||
return pub.document
|
return pub.document
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
from typing import Any, Callable, Iterator, Tuple # NOQA
|
from typing import TYPE_CHECKING, Any, Callable, Iterator, Tuple # NOQA
|
||||||
|
|
||||||
from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \
|
from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \
|
||||||
contextfunction
|
contextfunction
|
||||||
@ -22,8 +22,7 @@ from six import string_types
|
|||||||
from sphinx.application import TemplateBridge
|
from sphinx.application import TemplateBridge
|
||||||
from sphinx.util.osutil import mtimes_of_files
|
from sphinx.util.osutil import mtimes_of_files
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, List, Iterator, Tuple, Union # NOQA
|
from typing import Any, Callable, Dict, List, Iterator, Tuple, Union # NOQA
|
||||||
from jinja2.environment import Environment # NOQA
|
from jinja2.environment import Environment # NOQA
|
||||||
from sphinx.builders import Builder # NOQA
|
from sphinx.builders import Builder # NOQA
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import PY3, text_type
|
from six import PY3, text_type
|
||||||
from six.moves import UserString
|
from six.moves import UserString
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Tuple # NOQA
|
from typing import Any, Callable, Dict, Iterator, List, Tuple # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,14 +20,14 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
from sphinx import cmdline
|
from sphinx import cmdline
|
||||||
from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore
|
from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore
|
||||||
from sphinx.util.osutil import cd, rmtree
|
from sphinx.util.osutil import cd, rmtree
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import List # NOQA
|
from typing import List # NOQA
|
||||||
|
|
||||||
proj_name = os.getenv('SPHINXPROJ', '<project>')
|
proj_name = os.getenv('SPHINXPROJ', '<project>')
|
||||||
|
@ -9,14 +9,15 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import docutils.parsers
|
import docutils.parsers
|
||||||
import docutils.parsers.rst
|
import docutils.parsers.rst
|
||||||
from docutils.parsers.rst import states
|
from docutils.parsers.rst import states
|
||||||
from docutils.statemachine import StringList
|
from docutils.statemachine import StringList
|
||||||
from docutils.transforms.universal import SmartQuotes
|
from docutils.transforms.universal import SmartQuotes
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Type # NOQA
|
from typing import Any, Dict, List, Type # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from docutils.transforms import Transform # NOQA
|
from docutils.transforms import Transform # NOQA
|
||||||
|
@ -10,14 +10,15 @@
|
|||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems, BytesIO, StringIO
|
from six import iteritems, BytesIO, StringIO
|
||||||
|
|
||||||
from sphinx.errors import PycodeError
|
from sphinx.errors import PycodeError
|
||||||
from sphinx.pycode.parser import Parser
|
from sphinx.pycode.parser import Parser
|
||||||
from sphinx.util import get_module_source, detect_encoding
|
from sphinx.util import get_module_source, detect_encoding
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,11 +15,11 @@ import re
|
|||||||
import tokenize
|
import tokenize
|
||||||
from token import NAME, NEWLINE, INDENT, DEDENT, NUMBER, OP, STRING
|
from token import NAME, NEWLINE, INDENT, DEDENT, NUMBER, OP, STRING
|
||||||
from tokenize import COMMENT, NL
|
from tokenize import COMMENT, NL
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import PY2, text_type
|
from six import PY2, text_type
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||||
|
|
||||||
comment_re = re.compile(u'^\\s*#: ?(.*)\r?\n?$')
|
comment_re = re.compile(u'^\\s*#: ?(.*)\r?\n?$')
|
||||||
|
@ -12,6 +12,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
import warnings
|
import warnings
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from pkg_resources import iter_entry_points
|
from pkg_resources import iter_entry_points
|
||||||
from six import iteritems, itervalues
|
from six import iteritems, itervalues
|
||||||
@ -28,8 +29,7 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.console import bold # type: ignore
|
from sphinx.util.console import bold # type: ignore
|
||||||
from sphinx.util.docutils import directive_helper
|
from sphinx.util.docutils import directive_helper
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Type, Union # NOQA
|
from typing import Any, Callable, Dict, Iterator, List, Type, Union # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from docutils.io import Input # NOQA
|
from docutils.io import Input # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from docutils import nodes, utils
|
from docutils import nodes, utils
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
@ -21,8 +22,7 @@ from sphinx.util import ws_re
|
|||||||
from sphinx.util.nodes import split_explicit_title, process_index_entry, \
|
from sphinx.util.nodes import split_explicit_title, process_index_entry, \
|
||||||
set_role_source_info
|
set_role_source_info
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List, Tuple, Type # NOQA
|
from typing import Any, Dict, List, Tuple, Type # NOQA
|
||||||
from docutils.parsers.rst.states import Inliner # NOQA
|
from docutils.parsers.rst.states import Inliner # NOQA
|
||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems, itervalues, text_type, string_types
|
from six import iteritems, itervalues, text_type, string_types
|
||||||
from six.moves import cPickle as pickle
|
from six.moves import cPickle as pickle
|
||||||
@ -21,8 +22,7 @@ from sphinx.util import jsdump, rpartition
|
|||||||
from sphinx.util.pycompat import htmlescape
|
from sphinx.util.pycompat import htmlescape
|
||||||
from sphinx.search.jssplitter import splitter_code
|
from sphinx.search.jssplitter import splitter_code
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, IO, Iterable, List, Tuple, Type, Set # NOQA
|
from typing import Any, Dict, IO, Iterable, List, Tuple, Type, Set # NOQA
|
||||||
from docutils import nodes # NOQA
|
from docutils import nodes # NOQA
|
||||||
from sphinx.environment import BuildEnvironment # NOQA
|
from sphinx.environment import BuildEnvironment # NOQA
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,11 +9,12 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage
|
from sphinx.search import SearchLanguage
|
||||||
from sphinx.util.stemmer import get_stemmer
|
from sphinx.util.stemmer import get_stemmer
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict # NOQA
|
from typing import Dict # NOQA
|
||||||
|
|
||||||
english_stopwords = set(u"""
|
english_stopwords = set(u"""
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from six import iteritems, PY3
|
from six import iteritems, PY3
|
||||||
|
|
||||||
@ -39,8 +40,7 @@ from sphinx.errors import SphinxError, ExtensionError
|
|||||||
from sphinx.search import SearchLanguage
|
from sphinx.search import SearchLanguage
|
||||||
from sphinx.util import import_object
|
from sphinx.util import import_object
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Any, Dict, List # NOQA
|
from typing import Any, Dict, List # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage, parse_stop_word
|
from sphinx.search import SearchLanguage, parse_stop_word
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
@ -9,12 +9,13 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.search import SearchLanguage
|
from sphinx.search import SearchLanguage
|
||||||
|
|
||||||
import snowballstemmer
|
import snowballstemmer
|
||||||
|
|
||||||
if False:
|
if TYPE_CHECKING:
|
||||||
# For type annotation
|
|
||||||
from typing import Dict, Set # NOQA
|
from typing import Dict, Set # NOQA
|
||||||
|
|
||||||
js_stemmer = u"""
|
js_stemmer = 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