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
9efaf18852
3
CHANGES
3
CHANGES
@ -87,6 +87,9 @@ Bugs fixed
|
||||
* #4701: viewcode: Misplaced ``<div>`` in viewcode html output
|
||||
* #4444: Don't require numfig to use :numref: on sections
|
||||
* #4727: Option clash for package textcomp
|
||||
* #4725: Sphinx does not work with python 3.5.0 and 3.5.1
|
||||
* #4716: Generation PDF file with TexLive on Windows, file not found error
|
||||
* #4574: vertical space before equation in latex
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
19
doc/intl.rst
19
doc/intl.rst
@ -113,12 +113,27 @@ This section describe an easy way to translate with sphinx-intl.
|
||||
#. make translated document.
|
||||
|
||||
You need a :confval:`language` parameter in ``conf.py`` or you may also
|
||||
specify the parameter on the command line:
|
||||
specify the parameter on the command line (for BSD/GNU make):
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ make -e SPHINXOPTS="-D language='de'" html
|
||||
|
||||
command line (for Windows cmd.exe):
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
> set SPHINXOPTS=-D language='de'
|
||||
> .\make.bat html
|
||||
|
||||
command line (for PowerShell):
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
> Set-Item env:SPHINXOPTS "-D language='de'"
|
||||
> .\make.bat html
|
||||
|
||||
|
||||
Congratulations! You got the translated documentation in the ``_build/html``
|
||||
directory.
|
||||
|
||||
@ -263,7 +278,7 @@ easy to fetch and push translations.
|
||||
...
|
||||
Done.
|
||||
|
||||
Invoke make html:
|
||||
Invoke make html (for BSD/GNU make):
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
@ -9,11 +9,10 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import List, Sequence # NOQA
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@ import warnings
|
||||
from collections import deque
|
||||
from inspect import isclass
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.parsers.rst import Directive, directives, roles
|
||||
from six import itervalues
|
||||
@ -47,11 +46,12 @@ from sphinx.util.i18n import find_catalog_source_files
|
||||
from sphinx.util.osutil import abspath, ensuredir
|
||||
from sphinx.util.tags import Tags
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Tuple, Type, Union # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.parsers import Parser # NOQA
|
||||
from docutils.transform import Transform # NOQA
|
||||
from docutils.transforms import Transform # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.domains import Domain, Index # NOQA
|
||||
from sphinx.environment.collectors import EnvironmentCollector # NOQA
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import warnings
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
@ -37,7 +36,8 @@ try:
|
||||
except ImportError:
|
||||
multiprocessing = None
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
|
@ -13,7 +13,6 @@ import os
|
||||
import re
|
||||
from collections import namedtuple
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
from zipfile import ZIP_DEFLATED, ZIP_STORED, ZipFile
|
||||
|
||||
from docutils import nodes
|
||||
@ -36,7 +35,8 @@ except ImportError:
|
||||
except ImportError:
|
||||
Image = None
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -16,7 +16,6 @@ import plistlib
|
||||
import shlex
|
||||
import subprocess
|
||||
from os import path, environ
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||
from sphinx.config import string_classes
|
||||
@ -29,7 +28,8 @@ from sphinx.util.matching import Matcher
|
||||
from sphinx.util.osutil import copyfile, ensuredir, make_filename
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import codecs
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems
|
||||
|
||||
@ -25,7 +24,8 @@ from sphinx.util.fileutil import copy_asset_file
|
||||
from sphinx.util.osutil import ensuredir, os_path
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -15,7 +15,6 @@ from __future__ import absolute_import
|
||||
import gzip
|
||||
import re
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
@ -31,7 +30,8 @@ try:
|
||||
except ImportError:
|
||||
import lxml.etree as etree # type: ignore
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -9,12 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.locale import __
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
from collections import namedtuple
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx import package_dir
|
||||
from sphinx.builders import _epub_base
|
||||
@ -23,7 +22,8 @@ from sphinx.util.fileutil import copy_asset_file
|
||||
from sphinx.util.i18n import format_date
|
||||
from sphinx.util.osutil import make_filename
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterable, List # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -16,7 +16,6 @@ from collections import defaultdict, OrderedDict
|
||||
from datetime import datetime, tzinfo, timedelta
|
||||
from os import path, walk, getenv
|
||||
from time import time
|
||||
from typing import TYPE_CHECKING
|
||||
from uuid import uuid4
|
||||
|
||||
from six import iteritems, StringIO
|
||||
@ -31,7 +30,8 @@ from sphinx.util.nodes import extract_messages, traverse_translatable_index
|
||||
from sphinx.util.osutil import safe_relpath, ensuredir, canon_path
|
||||
from sphinx.util.tags import Tags
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.util.i18n import CatalogInfo # NOQA
|
||||
|
@ -16,7 +16,6 @@ import sys
|
||||
import warnings
|
||||
from hashlib import md5
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import docutils
|
||||
from docutils import nodes
|
||||
@ -52,7 +51,8 @@ from sphinx.util.osutil import SEP, os_path, relative_uri, ensuredir, \
|
||||
movefile, copyfile
|
||||
from sphinx.writers.html import HTMLWriter, HTMLTranslator
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, Iterable, Iterator, List, Type, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
|
@ -14,7 +14,6 @@ from __future__ import print_function
|
||||
import codecs
|
||||
import os
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
@ -26,7 +25,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.osutil import make_filename
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import os
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.frontend import OptionParser
|
||||
@ -33,7 +32,8 @@ from sphinx.util.nodes import inline_all_toctrees
|
||||
from sphinx.util.osutil import SEP, make_filename
|
||||
from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
|
@ -14,7 +14,6 @@ import re
|
||||
import socket
|
||||
import threading
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from requests.exceptions import HTTPError
|
||||
@ -39,7 +38,8 @@ from sphinx.util.console import ( # type: ignore
|
||||
)
|
||||
from sphinx.util.requests import is_ssl_error
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Set, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.requests.requests import Response # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.frontend import OptionParser
|
||||
from docutils.io import FileOutput
|
||||
@ -26,7 +25,8 @@ from sphinx.util.nodes import inline_all_toctrees
|
||||
from sphinx.util.osutil import make_filename
|
||||
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Set, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -14,7 +14,6 @@ import os
|
||||
import posixpath
|
||||
import re
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from six import text_type
|
||||
@ -28,7 +27,8 @@ from sphinx.util import force_decode, logging
|
||||
from sphinx.util.osutil import make_filename
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import os
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.frontend import OptionParser
|
||||
@ -31,7 +30,8 @@ from sphinx.util.nodes import inline_all_toctrees
|
||||
from sphinx.util.osutil import SEP, make_filename
|
||||
from sphinx.writers.texinfo import TexinfoWriter, TexinfoTranslator
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from typing import Any, Dict, Iterable, List, Tuple, Union # NOQA
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import codecs
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.io import StringOutput
|
||||
|
||||
@ -21,7 +20,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.osutil import ensuredir, os_path
|
||||
from sphinx.writers.text import TextWriter, TextTranslator
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterator, Set, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -9,9 +9,8 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import codecs
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.io import StringOutput
|
||||
@ -23,7 +22,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.osutil import ensuredir, os_path
|
||||
from sphinx.writers.xml import XMLWriter, PseudoXMLWriter
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterator, Set # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -16,7 +16,6 @@ import multiprocessing
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.utils import SystemMessage
|
||||
from six import text_type, binary_type
|
||||
@ -31,7 +30,8 @@ from sphinx.util.console import red, nocolor, color_terminal # type: ignore
|
||||
from sphinx.util.docutils import docutils_namespace, patch_docutils
|
||||
from sphinx.util.pycompat import terminal_safe
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, IO, List, Union # NOQA
|
||||
|
||||
|
||||
|
@ -20,7 +20,6 @@ import time
|
||||
from collections import OrderedDict
|
||||
from io import open
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
# try to import readline, unix specific enhancement
|
||||
try:
|
||||
@ -47,7 +46,8 @@ from sphinx.util.console import ( # type: ignore
|
||||
from sphinx.util.osutil import ensuredir, make_filename
|
||||
from sphinx.util.template import SphinxRenderer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, List, Pattern, Union # NOQA
|
||||
|
||||
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
|
||||
|
@ -13,12 +13,12 @@ from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.cmd import build
|
||||
from sphinx.deprecation import RemovedInSphinx30Warning
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
import argparse # NOQA
|
||||
from typing import Any, IO, List, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -13,7 +13,7 @@ import re
|
||||
import traceback
|
||||
from collections import OrderedDict
|
||||
from os import path, getenv
|
||||
from typing import TYPE_CHECKING, Any, NamedTuple, Union
|
||||
from typing import Any, NamedTuple, Union
|
||||
|
||||
from six import PY2, PY3, iteritems, string_types, binary_type, text_type, integer_types
|
||||
|
||||
@ -24,7 +24,8 @@ from sphinx.util.i18n import format_date
|
||||
from sphinx.util.osutil import cd
|
||||
from sphinx.util.pycompat import execfile_, NoneType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.util.tags import Tags # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives, roles
|
||||
@ -30,7 +29,8 @@ from sphinx.directives.patches import ( # noqa
|
||||
Figure, Meta
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
import codecs
|
||||
import sys
|
||||
from difflib import unified_diff
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -23,7 +22,8 @@ from sphinx.util import logging
|
||||
from sphinx.util import parselinenos
|
||||
from sphinx.util.nodes import set_source_info
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
|
@ -7,8 +7,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
|
||||
@ -24,7 +22,8 @@ from sphinx.util.matching import patfilter
|
||||
from sphinx.util.nodes import explicit_title_re, set_source_info, \
|
||||
process_index_entry
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -7,8 +7,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import directives
|
||||
from docutils.parsers.rst.directives import images, html, tables
|
||||
@ -16,7 +14,8 @@ from docutils.parsers.rst.directives import images, html, tables
|
||||
from sphinx import addnodes
|
||||
from sphinx.util.nodes import set_source_info
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -11,14 +11,14 @@
|
||||
"""
|
||||
|
||||
import copy
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems
|
||||
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.locale import _
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterable, List, Tuple, Type, Union # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import re
|
||||
import string
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
@ -23,7 +22,8 @@ from sphinx.roles import XRefRole
|
||||
from sphinx.util.docfields import Field, TypedField
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
import re
|
||||
from copy import deepcopy
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -29,7 +28,8 @@ from sphinx.util.nodes import make_refnode
|
||||
from sphinx.util.pycompat import UnicodeMixin
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterator, List, Match, Pattern, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
|
||||
@ -23,7 +21,8 @@ from sphinx.roles import XRefRole
|
||||
from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -26,7 +25,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems
|
||||
|
||||
@ -21,7 +20,8 @@ from sphinx.locale import _
|
||||
from sphinx.roles import XRefRole
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterator, List, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -12,7 +12,6 @@
|
||||
import re
|
||||
import unicodedata
|
||||
from copy import copy
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -27,7 +26,8 @@ from sphinx.roles import XRefRole
|
||||
from sphinx.util import ws_re, logging, docname_join
|
||||
from sphinx.util.nodes import clean_astext, make_refnode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Type, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -18,7 +18,6 @@ import warnings
|
||||
from collections import defaultdict
|
||||
from copy import copy
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.frontend import OptionParser
|
||||
from docutils.utils import Reporter, get_source_line
|
||||
@ -42,7 +41,8 @@ from sphinx.util.nodes import is_translatable
|
||||
from sphinx.util.osutil import SEP, ensuredir
|
||||
from sphinx.util.websupport import is_commentable
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Pattern, Set, Tuple, Type, Union, Generator # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -9,9 +9,8 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
||||
|
||||
|
@ -12,14 +12,14 @@ import bisect
|
||||
import re
|
||||
import unicodedata
|
||||
from itertools import groupby
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import text_type, iteritems
|
||||
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.util import split_into, logging
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Pattern, List, Tuple # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from six import iteritems
|
||||
|
||||
@ -19,7 +17,8 @@ from sphinx.locale import __
|
||||
from sphinx.util import url_re, logging
|
||||
from sphinx.util.nodes import clean_astext, process_only_nodes
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -9,11 +9,10 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import itervalues
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, List, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
|
@ -12,7 +12,6 @@
|
||||
import os
|
||||
from glob import glob
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.utils import relative_path
|
||||
@ -25,7 +24,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.i18n import get_image_filename_for_language, search_image_for_language
|
||||
from sphinx.util.images import guess_mimetype
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, List, Set, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
|
@ -10,14 +10,14 @@
|
||||
"""
|
||||
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.utils import relative_path
|
||||
|
||||
from sphinx.environment.collectors import EnvironmentCollector
|
||||
from sphinx.util.osutil import getcwd, fs_encoding
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
|
@ -9,15 +9,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import text_type
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.environment.collectors import EnvironmentCollector
|
||||
from sphinx.util import split_index_msg, logging
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.applicatin import Sphinx # NOQA
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
from sphinx.environment.collectors import EnvironmentCollector
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
|
@ -9,14 +9,13 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
from sphinx.environment.collectors import EnvironmentCollector
|
||||
from sphinx.transforms import SphinxContentsFilter
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.sphinx import Sphinx # NOQA
|
||||
|
@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from six import iteritems
|
||||
|
||||
@ -21,7 +19,8 @@ from sphinx.locale import __
|
||||
from sphinx.transforms import SphinxContentsFilter
|
||||
from sphinx.util import url_re, logging
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Set, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -10,9 +10,8 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -13,14 +13,14 @@
|
||||
from __future__ import print_function
|
||||
|
||||
from collections import OrderedDict, defaultdict
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import itervalues
|
||||
|
||||
from sphinx.errors import ExtensionError
|
||||
from sphinx.locale import __
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, List # NOQA
|
||||
|
||||
|
||||
|
@ -24,7 +24,6 @@ import os
|
||||
import sys
|
||||
from fnmatch import fnmatch
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import binary_type
|
||||
|
||||
@ -35,7 +34,8 @@ from sphinx.locale import __
|
||||
from sphinx.util import rst
|
||||
from sphinx.util.osutil import FileAvoidWrite, ensuredir, walk
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, List, Tuple # NOQA
|
||||
|
||||
# automodule options
|
||||
|
@ -15,7 +15,6 @@ import inspect
|
||||
import re
|
||||
import sys
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.statemachine import ViewList
|
||||
from six import iteritems, itervalues, text_type, class_types, string_types
|
||||
@ -35,7 +34,8 @@ from sphinx.util.inspect import Signature, isdescriptor, safe_getmembers, \
|
||||
safe_getattr, object_description, is_builtin_class_method, \
|
||||
isenumattribute, isclassmethod, isstaticmethod, getdoc
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from types import ModuleType # NOQA
|
||||
from typing import Any, Callable, Dict, Iterator, List, Sequence, Set, Tuple, Type, Union # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
|
@ -7,8 +7,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive
|
||||
from docutils.statemachine import ViewList
|
||||
@ -19,7 +17,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.docutils import switch_source_input
|
||||
from sphinx.util.nodes import nested_parse_with_titles
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Set, Type # NOQA
|
||||
from docutils.statemachine import State, StateMachine, StringList # NOQA
|
||||
from docutils.utils import Reporter # NOQA
|
||||
|
@ -15,14 +15,14 @@ import traceback
|
||||
import warnings
|
||||
from collections import namedtuple
|
||||
from types import FunctionType, MethodType, ModuleType
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import PY2
|
||||
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.inspect import isenumclass, safe_getattr
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Generator, List, Optional # NOQA
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -11,14 +11,14 @@
|
||||
|
||||
import typing
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import StringIO, string_types
|
||||
|
||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
||||
from sphinx.util.inspect import object_description
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Tuple # NOQA
|
||||
|
||||
|
||||
|
@ -9,22 +9,21 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.nodes import clean_astext
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -60,7 +60,6 @@ import re
|
||||
import sys
|
||||
import warnings
|
||||
from types import ModuleType
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -81,7 +80,8 @@ from sphinx.pycode import ModuleAnalyzer, PycodeError
|
||||
from sphinx.util import import_object, rst, logging
|
||||
from sphinx.util.docutils import NullReporter, new_document
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple, Type, Union # NOQA
|
||||
from docutils.utils import Inliner # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -26,7 +26,6 @@ import os
|
||||
import pydoc
|
||||
import re
|
||||
import sys
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from jinja2 import FileSystemLoader, TemplateNotFound
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
@ -42,7 +41,8 @@ from sphinx.util.inspect import safe_getattr
|
||||
from sphinx.util.osutil import ensuredir
|
||||
from sphinx.util.rst import escape as rst_escape
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Tuple, List # NOQA
|
||||
from jinja2 import BaseLoader # NOQA
|
||||
from sphinx import addnodes # NOQA
|
||||
|
@ -14,7 +14,6 @@ import glob
|
||||
import inspect
|
||||
import re
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems
|
||||
from six.moves import cPickle as pickle
|
||||
@ -25,7 +24,8 @@ from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.inspect import safe_getattr
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, IO, List, Pattern, Set, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -17,7 +17,6 @@ import re
|
||||
import sys
|
||||
import time
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -33,7 +32,8 @@ from sphinx.util.console import bold # type: ignore
|
||||
from sphinx.util.nodes import set_source_info
|
||||
from sphinx.util.osutil import fs_encoding
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Sequence, Set, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -16,7 +16,6 @@ import re
|
||||
from hashlib import sha1
|
||||
from os import path
|
||||
from subprocess import Popen, PIPE
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -30,7 +29,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.i18n import search_image_for_language
|
||||
from sphinx.util.osutil import ensuredir, ENOENT, EPIPE, EINVAL
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -20,15 +20,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive
|
||||
|
||||
import sphinx
|
||||
from sphinx.util.nodes import set_source_info
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
import subprocess
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.errors import ExtensionError
|
||||
from sphinx.locale import __
|
||||
@ -17,7 +16,8 @@ from sphinx.transforms.post_transforms.images import ImageConverter
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.osutil import ENOENT, EPIPE, EINVAL
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -17,7 +17,6 @@ import tempfile
|
||||
from hashlib import sha1
|
||||
from os import path
|
||||
from subprocess import Popen, PIPE
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from six import text_type
|
||||
@ -32,7 +31,8 @@ from sphinx.util.osutil import ensuredir, ENOENT, cd
|
||||
from sphinx.util.png import read_png_depth, write_png_depth
|
||||
from sphinx.util.pycompat import sys_encoding
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -40,7 +40,6 @@ import inspect
|
||||
import re
|
||||
import sys
|
||||
from hashlib import md5
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -53,7 +52,8 @@ from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
|
||||
from sphinx.pycode import ModuleAnalyzer
|
||||
from sphinx.util import force_decode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple, Dict, Optional # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -32,7 +32,6 @@ import sys
|
||||
import time
|
||||
import warnings
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.utils import relative_path
|
||||
@ -46,7 +45,8 @@ from sphinx.locale import _, __
|
||||
from sphinx.util import requests, logging
|
||||
from sphinx.util.inventory import InventoryFile
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
|
@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
import sphinx
|
||||
@ -18,7 +16,8 @@ from sphinx import addnodes
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.locale import _
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Set # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes, utils
|
||||
from docutils.nodes import make_id
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
@ -22,7 +20,8 @@ from sphinx.roles import XRefRole
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.nodes import make_refnode, set_source_info
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterable, List, Tuple # NOQA
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
from docutils.writers.html4css1 import Writer # NOQA
|
||||
@ -87,6 +86,7 @@ class MathDomain(Domain):
|
||||
newnode['target'] = target
|
||||
return newnode
|
||||
else:
|
||||
# TODO: perhaps use rather a sphinx-core provided prefix here?
|
||||
node_id = make_id('equation-%s' % target)
|
||||
if env.config.math_numfig and env.config.numfig:
|
||||
if docname in env.toc_fignumbers:
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
import sys
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import PY2, iteritems
|
||||
|
||||
@ -18,7 +17,8 @@ import sphinx
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
|
||||
|
||||
|
@ -15,7 +15,6 @@ import collections
|
||||
import inspect
|
||||
import re
|
||||
from functools import partial
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import string_types, u
|
||||
from six.moves import range
|
||||
@ -23,7 +22,8 @@ from six.moves import range
|
||||
from sphinx.ext.napoleon.iterators import modify_iter
|
||||
from sphinx.util.pycompat import UnicodeMixin
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, List, Tuple, Union # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config as SphinxConfig # NOQA
|
||||
|
@ -12,9 +12,9 @@
|
||||
"""
|
||||
|
||||
import collections
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Iterable # NOQA
|
||||
|
||||
|
||||
|
@ -12,8 +12,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import Directive
|
||||
from docutils.parsers.rst import directives
|
||||
@ -26,7 +24,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.nodes import set_source_info
|
||||
from sphinx.util.texescape import tex_escape_map
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterable, List # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
import traceback
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from six import iteritems, text_type
|
||||
@ -22,7 +21,8 @@ from sphinx.pycode import ModuleAnalyzer
|
||||
from sphinx.util import get_full_modname, logging, status_iterator
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, Iterable, Iterator, Set, Tuple # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -9,15 +9,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems
|
||||
|
||||
from sphinx.errors import VersionRequirementError
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.config import Config # NOQA
|
||||
|
@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from pygments import highlight
|
||||
from pygments.filters import ErrorToken
|
||||
from pygments.formatters import HtmlFormatter, LatexFormatter
|
||||
@ -29,7 +27,8 @@ from sphinx.util import logging
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
from sphinx.util.texescape import tex_hl_escape_map_new
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict # NOQA
|
||||
from pygments.formatter import Formatter # NOQA
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
import codecs
|
||||
import re
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.core import Publisher
|
||||
from docutils.io import FileInput, NullOutput
|
||||
@ -35,7 +34,8 @@ from sphinx.transforms.i18n import (
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.docutils import LoggingReporter
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple, Union # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.io import Input # NOQA
|
||||
@ -306,7 +306,7 @@ def read_doc(app, env, filename):
|
||||
source_class=SphinxDummySourceClass,
|
||||
destination=NullOutput())
|
||||
pub.set_components(None, 'restructuredtext', None)
|
||||
pub.process_programmatic_settings(None, env.settings, None) # type: ignore
|
||||
pub.process_programmatic_settings(None, env.settings, None)
|
||||
pub.set_source(source, filename)
|
||||
pub.publish()
|
||||
return pub.document
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
from os import path
|
||||
from pprint import pformat
|
||||
from typing import TYPE_CHECKING, Any, Callable, Iterator, Tuple # NOQA
|
||||
from typing import Any, Callable, Iterator, Tuple # NOQA
|
||||
|
||||
from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \
|
||||
contextfunction
|
||||
@ -22,7 +22,8 @@ from six import string_types
|
||||
from sphinx.application import TemplateBridge
|
||||
from sphinx.util.osutil import mtimes_of_files
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, List, Iterator, Tuple, Union # NOQA
|
||||
from jinja2.environment import Environment # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
|
@ -14,14 +14,14 @@ import locale
|
||||
import warnings
|
||||
from collections import defaultdict
|
||||
from gettext import NullTranslations
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import text_type
|
||||
from six.moves import UserString
|
||||
|
||||
from sphinx.deprecation import RemovedInSphinx30Warning
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple # NOQA
|
||||
|
||||
|
||||
|
@ -20,14 +20,14 @@ import os
|
||||
import subprocess
|
||||
import sys
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import sphinx
|
||||
from sphinx.cmd.build import build_main
|
||||
from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore
|
||||
from sphinx.util.osutil import cd, rmtree
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import List # NOQA
|
||||
|
||||
proj_name = os.getenv('SPHINXPROJ', '<project>')
|
||||
@ -101,22 +101,34 @@ class Make(object):
|
||||
# type: () -> int
|
||||
if self.run_generic_build('latex') > 0:
|
||||
return 1
|
||||
with cd(self.builddir_join('latex')):
|
||||
return subprocess.call([self.makecmd, 'all-pdf'])
|
||||
try:
|
||||
with cd(self.builddir_join('latex')):
|
||||
return subprocess.call([self.makecmd, 'all-pdf'])
|
||||
except OSError:
|
||||
print('Error: Failed to run: %s' % self.makecmd)
|
||||
return 1
|
||||
|
||||
def build_latexpdfja(self):
|
||||
# type: () -> int
|
||||
if self.run_generic_build('latex') > 0:
|
||||
return 1
|
||||
with cd(self.builddir_join('latex')):
|
||||
return subprocess.call([self.makecmd, 'all-pdf-ja'])
|
||||
try:
|
||||
with cd(self.builddir_join('latex')):
|
||||
return subprocess.call([self.makecmd, 'all-pdf-ja'])
|
||||
except OSError:
|
||||
print('Error: Failed to run: %s' % self.makecmd)
|
||||
return 1
|
||||
|
||||
def build_info(self):
|
||||
# type: () -> int
|
||||
if self.run_generic_build('texinfo') > 0:
|
||||
return 1
|
||||
with cd(self.builddir_join('texinfo')):
|
||||
return subprocess.call([self.makecmd, 'info'])
|
||||
try:
|
||||
with cd(self.builddir_join('texinfo')):
|
||||
return subprocess.call([self.makecmd, 'info'])
|
||||
except OSError:
|
||||
print('Error: Failed to run: %s' % self.makecmd)
|
||||
return 1
|
||||
|
||||
def build_gettext(self):
|
||||
# type: () -> int
|
||||
|
@ -9,15 +9,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import docutils.parsers
|
||||
import docutils.parsers.rst
|
||||
from docutils.parsers.rst import states
|
||||
from docutils.statemachine import StringList
|
||||
from docutils.transforms.universal import SmartQuotes
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Type # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.transforms import Transform # NOQA
|
||||
|
@ -10,15 +10,14 @@
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems, BytesIO, StringIO
|
||||
|
||||
from sphinx.errors import PycodeError
|
||||
from sphinx.pycode.parser import Parser
|
||||
from sphinx.util import get_module_source, detect_encoding
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||
|
||||
|
||||
|
@ -15,11 +15,11 @@ import re
|
||||
import tokenize
|
||||
from token import NAME, NEWLINE, INDENT, DEDENT, NUMBER, OP, STRING
|
||||
from tokenize import COMMENT, NL
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import PY2, text_type
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, List, Tuple # NOQA
|
||||
|
||||
comment_re = re.compile(u'^\\s*#: ?(.*)\r?\n?$')
|
||||
|
@ -14,7 +14,6 @@ import traceback
|
||||
import warnings
|
||||
from inspect import isclass
|
||||
from types import MethodType
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils.parsers.rst import Directive
|
||||
from pkg_resources import iter_entry_points
|
||||
@ -32,12 +31,13 @@ from sphinx.util import logging
|
||||
from sphinx.util.console import bold # type: ignore
|
||||
from sphinx.util.docutils import directive_helper
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Type, Union # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.io import Input # NOQA
|
||||
from docutils.parsers import Parser # NOQA
|
||||
from docutils.transform import Transform # NOQA
|
||||
from docutils.transforms import Transform # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.builders import Builder # NOQA
|
||||
from sphinx.domains import Domain, Index # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes, utils
|
||||
from six import iteritems
|
||||
@ -22,7 +21,8 @@ from sphinx.util import ws_re
|
||||
from sphinx.util.nodes import split_explicit_title, process_index_entry, \
|
||||
set_role_source_info
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List, Tuple, Type # NOQA
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
@ -10,7 +10,6 @@
|
||||
"""
|
||||
import re
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems, itervalues, text_type, string_types
|
||||
from six.moves import cPickle as pickle
|
||||
@ -22,7 +21,8 @@ from sphinx.util import jsdump, rpartition
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
from sphinx.search.jssplitter import splitter_code
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, IO, Iterable, List, Tuple, Type, Set # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,12 +9,11 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
from sphinx.util.stemmer import get_stemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict # NOQA
|
||||
|
||||
english_stopwords = set(u"""
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import iteritems, PY3
|
||||
|
||||
@ -40,7 +39,8 @@ from sphinx.errors import SphinxError, ExtensionError
|
||||
from sphinx.search import SearchLanguage
|
||||
from sphinx.util import import_object
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Dict, List # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Dict, Set # NOQA
|
||||
|
||||
js_stemmer = u"""
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
@ -9,13 +9,12 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any
|
||||
|
||||
swedish_stopwords = parse_stop_word(u'''
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user