mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '3.x'
This commit is contained in:
commit
279e547860
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
tool: [docslint, flake8, mypy, twine]
|
||||
tool: [docslint, flake8, isort, mypy, twine]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
4
Makefile
4
Makefile
@ -66,11 +66,11 @@ doclinter:
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@$(PYTHON) -m pytest -v $(TEST)
|
||||
@$(PYTHON) -X dev -m pytest -v $(TEST)
|
||||
|
||||
.PHONY: covertest
|
||||
covertest:
|
||||
@$(PYTHON) -m pytest -v --cov=sphinx --junitxml=.junit.xml $(TEST)
|
||||
@$(PYTHON) -X dev -m pytest -v --cov=sphinx --junitxml=.junit.xml $(TEST)
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
|
@ -4,7 +4,6 @@ import re
|
||||
|
||||
import sphinx
|
||||
|
||||
|
||||
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
|
||||
'sphinx.ext.autosummary', 'sphinx.ext.extlinks',
|
||||
'sphinx.ext.intersphinx',
|
||||
|
@ -4,8 +4,7 @@ from docutils.parsers.rst import directives
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.directives import ObjectDescription
|
||||
from sphinx.domains import Domain
|
||||
from sphinx.domains import Index
|
||||
from sphinx.domains import Domain, Index
|
||||
from sphinx.roles import XRefRole
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
|
@ -39,6 +39,9 @@ extension =
|
||||
paths =
|
||||
.
|
||||
|
||||
[isort]
|
||||
line_length = 95
|
||||
|
||||
[mypy]
|
||||
python_version = 3.6
|
||||
disallow_incomplete_defs = True
|
||||
|
7
setup.py
7
setup.py
@ -43,7 +43,7 @@ extras_require = {
|
||||
],
|
||||
'lint': [
|
||||
'flake8>=3.5.0',
|
||||
'flake8-import-order',
|
||||
'isort',
|
||||
'mypy>=0.790',
|
||||
'docutils-stubs',
|
||||
],
|
||||
@ -76,9 +76,10 @@ class Tee:
|
||||
|
||||
|
||||
try:
|
||||
from babel.messages.pofile import read_po
|
||||
from babel.messages.frontend import compile_catalog
|
||||
from json import dump
|
||||
|
||||
from babel.messages.frontend import compile_catalog
|
||||
from babel.messages.pofile import read_po
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
|
@ -17,8 +17,7 @@ import sys
|
||||
from collections import deque
|
||||
from io import StringIO
|
||||
from os import path
|
||||
from typing import Any, Callable, Dict, IO, List, Optional, Tuple, Type, Union
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import IO, TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, TextElement
|
||||
@ -28,7 +27,7 @@ from docutils.transforms import Transform
|
||||
from pygments.lexer import Lexer
|
||||
|
||||
import sphinx
|
||||
from sphinx import package_dir, locale
|
||||
from sphinx import locale, package_dir
|
||||
from sphinx.config import Config
|
||||
from sphinx.domains import Domain, Index
|
||||
from sphinx.environment import BuildEnvironment
|
||||
@ -42,9 +41,7 @@ from sphinx.project import Project
|
||||
from sphinx.registry import SphinxComponentRegistry
|
||||
from sphinx.roles import XRefRole
|
||||
from sphinx.theming import Theme
|
||||
from sphinx.util import docutils
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import progress_message
|
||||
from sphinx.util import docutils, logging, progress_message
|
||||
from sphinx.util.build_phase import BuildPhase
|
||||
from sphinx.util.console import bold # type: ignore
|
||||
from sphinx.util.i18n import CatalogRepository
|
||||
@ -54,6 +51,8 @@ from sphinx.util.tags import Tags
|
||||
from sphinx.util.typing import RoleFunction, TitleGetter
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from docutils.nodes import Node # NOQA
|
||||
|
||||
from sphinx.builders import Builder
|
||||
|
||||
|
||||
@ -1068,7 +1067,7 @@ class Sphinx:
|
||||
.. versionadded:: 1.1
|
||||
"""
|
||||
logger.debug('[app] adding search language: %r', cls)
|
||||
from sphinx.search import languages, SearchLanguage
|
||||
from sphinx.search import SearchLanguage, languages
|
||||
assert issubclass(cls, SearchLanguage)
|
||||
languages[cls.lang] = cls
|
||||
|
||||
|
@ -18,26 +18,24 @@ from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
|
||||
from sphinx.config import Config
|
||||
from sphinx.environment import BuildEnvironment, CONFIG_OK, CONFIG_CHANGED_REASON
|
||||
from sphinx.environment import CONFIG_CHANGED_REASON, CONFIG_OK, BuildEnvironment
|
||||
from sphinx.environment.adapters.asset import ImageAdapter
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.events import EventManager
|
||||
from sphinx.io import read_doc
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import import_object, logging, rst, progress_message, status_iterator
|
||||
from sphinx.util import import_object, logging, progress_message, rst, status_iterator
|
||||
from sphinx.util.build_phase import BuildPhase
|
||||
from sphinx.util.console import bold # type: ignore
|
||||
from sphinx.util.docutils import sphinx_domains
|
||||
from sphinx.util.i18n import CatalogInfo, CatalogRepository, docname_to_domain
|
||||
from sphinx.util.osutil import SEP, ensuredir, relative_uri, relpath
|
||||
from sphinx.util.parallel import ParallelTasks, SerialTasks, make_chunks, \
|
||||
parallel_available
|
||||
from sphinx.util.parallel import ParallelTasks, SerialTasks, make_chunks, parallel_available
|
||||
from sphinx.util.tags import Tags
|
||||
|
||||
# side effect: registers roles and directives
|
||||
from sphinx import roles # noqa
|
||||
from sphinx import directives # noqa
|
||||
|
||||
from sphinx import directives # NOQA isort:skip
|
||||
from sphinx import roles # NOQA isort:skip
|
||||
try:
|
||||
import multiprocessing
|
||||
except ImportError:
|
||||
|
@ -22,11 +22,10 @@ from docutils.utils import smartquotes
|
||||
from sphinx import addnodes
|
||||
from sphinx.builders.html import BuildInfo, StandaloneHTMLBuilder
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import status_iterator
|
||||
from sphinx.util import logging, status_iterator
|
||||
from sphinx.util.fileutil import copy_asset_file
|
||||
from sphinx.util.i18n import format_date
|
||||
from sphinx.util.osutil import ensuredir, copyfile
|
||||
from sphinx.util.osutil import copyfile, ensuredir
|
||||
|
||||
try:
|
||||
from PIL import Image
|
||||
|
@ -10,8 +10,7 @@
|
||||
|
||||
import html
|
||||
from os import path
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Tuple, cast
|
||||
|
||||
from sphinx import package_dir
|
||||
from sphinx.application import Sphinx
|
||||
@ -24,7 +23,6 @@ from sphinx.util.console import bold # type: ignore
|
||||
from sphinx.util.fileutil import copy_asset_file
|
||||
from sphinx.util.osutil import ensuredir, os_path
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ from typing import Any, Dict, List, NamedTuple, Set, Tuple
|
||||
from sphinx import package_dir
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import _epub_base
|
||||
from sphinx.config import Config, ENUM
|
||||
from sphinx.config import ENUM, Config
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging, xmlname_checker
|
||||
from sphinx.util.fileutil import copy_asset_file
|
||||
|
@ -9,9 +9,9 @@
|
||||
"""
|
||||
|
||||
from codecs import open
|
||||
from collections import defaultdict, OrderedDict
|
||||
from datetime import datetime, tzinfo, timedelta
|
||||
from os import path, walk, getenv
|
||||
from collections import OrderedDict, defaultdict
|
||||
from datetime import datetime, timedelta, tzinfo
|
||||
from os import getenv, path, walk
|
||||
from time import time
|
||||
from typing import Any, DefaultDict, Dict, Iterable, Generator, List, Set, Tuple, Union
|
||||
from uuid import uuid4
|
||||
@ -19,18 +19,17 @@ from uuid import uuid4
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx import package_dir
|
||||
from sphinx import addnodes, package_dir
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.domains.python import pairindextypes
|
||||
from sphinx.errors import ThemeError
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import split_index_msg, logging, status_iterator
|
||||
from sphinx.util import logging, split_index_msg, status_iterator
|
||||
from sphinx.util.console import bold # type: ignore
|
||||
from sphinx.util.i18n import CatalogInfo, docname_to_domain
|
||||
from sphinx.util.nodes import extract_messages, traverse_translatable_index
|
||||
from sphinx.util.osutil import ensuredir, canon_path, relpath
|
||||
from sphinx.util.osutil import canon_path, ensuredir, relpath
|
||||
from sphinx.util.tags import Tags
|
||||
from sphinx.util.template import SphinxRenderer
|
||||
|
||||
|
@ -14,7 +14,7 @@ import re
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from os import path
|
||||
from typing import Any, Dict, IO, Iterable, Iterator, List, Set, Tuple, Type
|
||||
from typing import IO, Any, Dict, Iterable, Iterator, List, Set, Tuple, Type
|
||||
from urllib.parse import quote
|
||||
|
||||
from docutils import nodes
|
||||
@ -24,10 +24,10 @@ from docutils.io import DocTreeInput, StringOutput
|
||||
from docutils.nodes import Node
|
||||
from docutils.utils import relative_path
|
||||
|
||||
from sphinx import package_dir, __display_version__
|
||||
from sphinx import __display_version__, package_dir
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.config import Config, ENUM
|
||||
from sphinx.config import ENUM, Config
|
||||
from sphinx.domains import Domain, Index, IndexEntry
|
||||
from sphinx.environment.adapters.asset import ImageAdapter
|
||||
from sphinx.environment.adapters.indexentries import IndexEntries
|
||||
@ -37,15 +37,15 @@ from sphinx.highlighting import PygmentsBridge
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.search import js_index
|
||||
from sphinx.theming import HTMLThemeFactory
|
||||
from sphinx.util import logging, progress_message, status_iterator, md5
|
||||
from sphinx.util import logging, md5, progress_message, status_iterator
|
||||
from sphinx.util.docutils import is_html5_writer_available, new_document
|
||||
from sphinx.util.fileutil import copy_asset
|
||||
from sphinx.util.i18n import format_date
|
||||
from sphinx.util.inventory import InventoryFile
|
||||
from sphinx.util.matching import patmatch, Matcher, DOTFILES
|
||||
from sphinx.util.osutil import os_path, relative_uri, ensuredir, movefile, copyfile
|
||||
from sphinx.util.matching import DOTFILES, Matcher, patmatch
|
||||
from sphinx.util.osutil import copyfile, ensuredir, movefile, os_path, relative_uri
|
||||
from sphinx.util.tags import Tags
|
||||
from sphinx.writers.html import HTMLWriter, HTMLTranslator
|
||||
from sphinx.writers.html import HTMLTranslator, HTMLWriter
|
||||
|
||||
|
||||
# HTML5 Writer is available or not
|
||||
@ -1184,10 +1184,11 @@ def validate_html_favicon(app: Sphinx, config: Config) -> None:
|
||||
config.html_favicon = None # type: ignore
|
||||
|
||||
|
||||
# for compatibility; RemovedInSphinx40Warning
|
||||
# for compatibility
|
||||
import sphinxcontrib.serializinghtml # NOQA
|
||||
|
||||
import sphinx.builders.dirhtml # NOQA
|
||||
import sphinx.builders.singlehtml # NOQA
|
||||
import sphinxcontrib.serializinghtml # NOQA
|
||||
|
||||
|
||||
def setup(app: Sphinx) -> Dict[str, Any]:
|
||||
|
@ -17,18 +17,18 @@ from docutils.frontend import OptionParser
|
||||
from docutils.nodes import Node
|
||||
|
||||
import sphinx.builders.latex.nodes # NOQA # Workaround: import this before writer to avoid ImportError
|
||||
from sphinx import package_dir, addnodes, highlighting
|
||||
from sphinx import addnodes, highlighting, package_dir
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.builders.latex.constants import ADDITIONAL_SETTINGS, DEFAULT_SETTINGS, SHORTHANDOFF
|
||||
from sphinx.builders.latex.theming import Theme, ThemeFactory
|
||||
from sphinx.builders.latex.util import ExtBabel
|
||||
from sphinx.config import Config, ENUM
|
||||
from sphinx.config import ENUM, Config
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
from sphinx.environment.adapters.asset import ImageAdapter
|
||||
from sphinx.errors import NoUri, SphinxError
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.util import texescape, logging, progress_message, status_iterator
|
||||
from sphinx.util import logging, progress_message, status_iterator, texescape
|
||||
from sphinx.util.console import bold, darkgreen # type: ignore
|
||||
from sphinx.util.docutils import SphinxFileOutput, new_document
|
||||
from sphinx.util.fileutil import copy_asset_file
|
||||
@ -36,11 +36,10 @@ from sphinx.util.i18n import format_date
|
||||
from sphinx.util.nodes import inline_all_toctrees
|
||||
from sphinx.util.osutil import SEP, make_filename_from_project
|
||||
from sphinx.util.template import LaTeXRenderer
|
||||
from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
|
||||
from sphinx.writers.latex import LaTeXTranslator, LaTeXWriter
|
||||
|
||||
# load docutils.nodes after loading sphinx.builders.latex.nodes
|
||||
from docutils import nodes # NOQA
|
||||
|
||||
from docutils import nodes # isort:skip
|
||||
|
||||
XINDY_LANG_OPTIONS = {
|
||||
# language codes from docutils.writers.latex2e.Babel
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
|
||||
PDFLATEX_DEFAULT_FONTPKG = r'''
|
||||
\usepackage{times}
|
||||
\expandafter\ifx\csname T@LGR\endcsname\relax
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Set, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Set, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
@ -17,9 +16,8 @@ from docutils.transforms.references import Substitutions
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders.latex.nodes import (
|
||||
captioned_literal_block, footnotemark, footnotetext, math_reference, thebibliography
|
||||
)
|
||||
from sphinx.builders.latex.nodes import (captioned_literal_block, footnotemark, footnotetext,
|
||||
math_reference, thebibliography)
|
||||
from sphinx.domains.citation import CitationDomain
|
||||
from sphinx.transforms import SphinxTransform
|
||||
from sphinx.transforms.post_transforms import SphinxPostTransform
|
||||
|
@ -25,14 +25,11 @@ from requests.exceptions import HTTPError
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import encode_uri, requests, logging
|
||||
from sphinx.util.console import ( # type: ignore
|
||||
purple, red, darkgreen, darkgray, turquoise
|
||||
)
|
||||
from sphinx.util import encode_uri, logging, requests
|
||||
from sphinx.util.console import darkgray, darkgreen, purple, red, turquoise # type: ignore
|
||||
from sphinx.util.nodes import get_node_line
|
||||
from sphinx.util.requests import is_ssl_error
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
uri_re = re.compile('([a-z]+:)?//') # matches to foo:// and // (a protocol relative URL)
|
||||
|
@ -20,13 +20,11 @@ from sphinx.builders import Builder
|
||||
from sphinx.config import Config
|
||||
from sphinx.errors import NoUri
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import progress_message
|
||||
from sphinx.util import logging, progress_message
|
||||
from sphinx.util.console import darkgreen # type: ignore
|
||||
from sphinx.util.nodes import inline_all_toctrees
|
||||
from sphinx.util.osutil import ensuredir, make_filename_from_project
|
||||
from sphinx.writers.manpage import ManualPageWriter, ManualPageTranslator
|
||||
|
||||
from sphinx.writers.manpage import ManualPageTranslator, ManualPageWriter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -19,8 +19,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder
|
||||
from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
|
||||
from sphinx.environment.adapters.toctree import TocTree
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import progress_message
|
||||
from sphinx.util import logging, progress_message
|
||||
from sphinx.util.console import darkgreen # type: ignore
|
||||
from sphinx.util.nodes import inline_all_toctrees
|
||||
|
||||
|
@ -16,23 +16,20 @@ from docutils import nodes
|
||||
from docutils.frontend import OptionParser
|
||||
from docutils.io import FileOutput
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx import package_dir
|
||||
from sphinx import addnodes, package_dir
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.config import Config
|
||||
from sphinx.environment.adapters.asset import ImageAdapter
|
||||
from sphinx.errors import NoUri
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import progress_message, status_iterator
|
||||
from sphinx.util import logging, progress_message, status_iterator
|
||||
from sphinx.util.console import darkgreen # type: ignore
|
||||
from sphinx.util.docutils import new_document
|
||||
from sphinx.util.fileutil import copy_asset_file
|
||||
from sphinx.util.nodes import inline_all_toctrees
|
||||
from sphinx.util.osutil import SEP, ensuredir, make_filename_from_project
|
||||
from sphinx.writers.texinfo import TexinfoWriter, TexinfoTranslator
|
||||
|
||||
from sphinx.writers.texinfo import TexinfoTranslator, TexinfoWriter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
template_dir = os.path.join(package_dir, 'templates', 'texinfo')
|
||||
|
@ -19,7 +19,7 @@ from sphinx.builders import Builder
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.osutil import ensuredir, os_path
|
||||
from sphinx.writers.text import TextWriter, TextTranslator
|
||||
from sphinx.writers.text import TextTranslator, TextWriter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -21,7 +21,7 @@ from sphinx.builders import Builder
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.osutil import ensuredir, os_path
|
||||
from sphinx.writers.xml import XMLWriter, PseudoXMLWriter
|
||||
from sphinx.writers.xml import PseudoXMLWriter, XMLWriter
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -16,7 +16,7 @@ import os
|
||||
import pdb
|
||||
import sys
|
||||
import traceback
|
||||
from typing import Any, IO, List
|
||||
from typing import IO, Any, List
|
||||
|
||||
from docutils.utils import SystemMessage
|
||||
|
||||
@ -26,7 +26,7 @@ from sphinx.application import Sphinx
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import Tee, format_exception_cut_frames, save_traceback
|
||||
from sphinx.util.console import red, nocolor, color_terminal, terminal_safe # type: ignore
|
||||
from sphinx.util.console import color_terminal, nocolor, red, terminal_safe # type: ignore
|
||||
from sphinx.util.docutils import docutils_namespace, patch_docutils
|
||||
|
||||
|
||||
|
@ -22,10 +22,9 @@ from typing import List
|
||||
|
||||
import sphinx
|
||||
from sphinx.cmd.build import build_main
|
||||
from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore
|
||||
from sphinx.util.console import blue, bold, color_terminal, nocolor # type: ignore
|
||||
from sphinx.util.osutil import cd, rmtree
|
||||
|
||||
|
||||
BUILDERS = [
|
||||
("", "html", "to make standalone HTML files"),
|
||||
("", "dirhtml", "to make HTML files named index.html in directories"),
|
||||
|
@ -34,7 +34,7 @@ from docutils.utils import column_width
|
||||
import sphinx.locale
|
||||
from sphinx import __display_version__, package_dir
|
||||
from sphinx.locale import __
|
||||
from sphinx.util.console import colorize, bold, red, nocolor, color_terminal # type: ignore
|
||||
from sphinx.util.console import bold, color_terminal, colorize, nocolor, red # type: ignore
|
||||
from sphinx.util.osutil import ensuredir
|
||||
from sphinx.util.template import SphinxRenderer
|
||||
|
||||
|
@ -12,11 +12,9 @@ import re
|
||||
import traceback
|
||||
import types
|
||||
from collections import OrderedDict
|
||||
from os import path, getenv
|
||||
from typing import (
|
||||
Any, Callable, Dict, Generator, Iterator, List, NamedTuple, Set, Tuple, Union
|
||||
)
|
||||
from typing import TYPE_CHECKING
|
||||
from os import getenv, path
|
||||
from typing import (TYPE_CHECKING, Any, Callable, Dict, Generator, Iterator, List, NamedTuple,
|
||||
Set, Tuple, Union)
|
||||
|
||||
from sphinx.errors import ConfigError, ExtensionError
|
||||
from sphinx.locale import _, __
|
||||
|
@ -9,8 +9,7 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
|
@ -19,8 +19,7 @@ from docutils.statemachine import StringList
|
||||
from sphinx import addnodes
|
||||
from sphinx.config import Config
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import parselinenos
|
||||
from sphinx.util import logging, parselinenos
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -7,8 +7,7 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import Any, Dict, List
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
@ -20,7 +19,7 @@ from docutils.parsers.rst.directives.misc import Include as BaseInclude
|
||||
from sphinx import addnodes
|
||||
from sphinx.domains.changeset import VersionChange # NOQA # for compatibility
|
||||
from sphinx.locale import _
|
||||
from sphinx.util import url_re, docname_join
|
||||
from sphinx.util import docname_join, url_re
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
from sphinx.util.matching import Matcher, patfilter
|
||||
from sphinx.util.nodes import explicit_title_re
|
||||
|
@ -7,13 +7,12 @@
|
||||
"""
|
||||
|
||||
import warnings
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node, make_id, system_message
|
||||
from docutils.parsers.rst import directives
|
||||
from docutils.parsers.rst.directives import images, html, tables
|
||||
from docutils.parsers.rst.directives import html, images, tables
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.deprecation import RemovedInSphinx60Warning
|
||||
|
@ -10,8 +10,8 @@
|
||||
"""
|
||||
|
||||
import copy
|
||||
from typing import Any, Callable, Dict, Iterable, List, NamedTuple, Tuple, Type, Union
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterable, List, NamedTuple, Tuple,
|
||||
Type, Union, cast)
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, system_message
|
||||
|
@ -9,9 +9,8 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import (
|
||||
Any, Callable, cast, Dict, Generator, Iterator, List, Type, TypeVar, Tuple, Union
|
||||
)
|
||||
from typing import (Any, Callable, Dict, Generator, Iterator, List, Tuple, Type, TypeVar,
|
||||
Union, cast)
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, TextElement, system_message
|
||||
@ -30,15 +29,13 @@ from sphinx.roles import SphinxRole, XRefRole
|
||||
from sphinx.transforms import SphinxTransform
|
||||
from sphinx.transforms.post_transforms import ReferencesResolver
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.cfamily import (
|
||||
NoOldIdError, ASTBaseBase, ASTAttribute, ASTBaseParenExprList,
|
||||
verify_description_mode, StringifyTransform,
|
||||
BaseParser, DefinitionError, UnsupportedMultiCharacterCharLiteral,
|
||||
identifier_re, anon_identifier_re, integer_literal_re, octal_literal_re,
|
||||
hex_literal_re, binary_literal_re, integers_literal_suffix_re,
|
||||
float_literal_re, float_literal_suffix_re,
|
||||
char_literal_re
|
||||
)
|
||||
from sphinx.util.cfamily import (ASTAttribute, ASTBaseBase, ASTBaseParenExprList, BaseParser,
|
||||
DefinitionError, NoOldIdError, StringifyTransform,
|
||||
UnsupportedMultiCharacterCharLiteral, anon_identifier_re,
|
||||
binary_literal_re, char_literal_re, float_literal_re,
|
||||
float_literal_suffix_re, hex_literal_re, identifier_re,
|
||||
integer_literal_re, integers_literal_suffix_re,
|
||||
octal_literal_re, verify_description_mode)
|
||||
from sphinx.util.docfields import Field, TypedField
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, NamedTuple
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
@ -19,7 +18,6 @@ from sphinx.domains import Domain
|
||||
from sphinx.locale import _
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.environment import BuildEnvironment
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Set, Tuple
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Set, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element
|
||||
|
@ -9,9 +9,8 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import (
|
||||
Any, Callable, Dict, Generator, Iterator, List, Tuple, Type, TypeVar, Union, Optional
|
||||
)
|
||||
from typing import (Any, Callable, Dict, Generator, Iterator, List, Optional, Tuple, Type,
|
||||
TypeVar, Union)
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, TextElement, system_message
|
||||
@ -30,20 +29,17 @@ from sphinx.roles import SphinxRole, XRefRole
|
||||
from sphinx.transforms import SphinxTransform
|
||||
from sphinx.transforms.post_transforms import ReferencesResolver
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.cfamily import (
|
||||
NoOldIdError, ASTBaseBase, ASTAttribute, ASTBaseParenExprList,
|
||||
verify_description_mode, StringifyTransform,
|
||||
BaseParser, DefinitionError, UnsupportedMultiCharacterCharLiteral,
|
||||
identifier_re, anon_identifier_re, integer_literal_re, octal_literal_re,
|
||||
hex_literal_re, binary_literal_re, integers_literal_suffix_re,
|
||||
float_literal_re, float_literal_suffix_re,
|
||||
char_literal_re
|
||||
)
|
||||
from sphinx.util.cfamily import (ASTAttribute, ASTBaseBase, ASTBaseParenExprList, BaseParser,
|
||||
DefinitionError, NoOldIdError, StringifyTransform,
|
||||
UnsupportedMultiCharacterCharLiteral, anon_identifier_re,
|
||||
binary_literal_re, char_literal_re, float_literal_re,
|
||||
float_literal_suffix_re, hex_literal_re, identifier_re,
|
||||
integer_literal_re, integers_literal_suffix_re,
|
||||
octal_literal_re, verify_description_mode)
|
||||
from sphinx.util.docfields import Field, GroupedField
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
T = TypeVar('T')
|
||||
|
||||
|
@ -18,8 +18,7 @@ from docutils.parsers.rst import directives
|
||||
from sphinx import addnodes
|
||||
from sphinx.domains import Domain
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import split_index_msg
|
||||
from sphinx.util import logging, split_index_msg
|
||||
from sphinx.util.docutils import ReferenceRole, SphinxDirective
|
||||
from sphinx.util.nodes import process_index_entry
|
||||
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, Iterator, List, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, Iterator, List, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
@ -30,7 +29,6 @@ from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
from sphinx.util.nodes import make_id, make_refnode
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -12,8 +12,7 @@ from typing import Any, Dict, Iterable, List, Tuple
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, system_message
|
||||
from docutils.nodes import make_id
|
||||
from docutils.nodes import Element, Node, make_id, system_message
|
||||
|
||||
from sphinx.addnodes import pending_xref
|
||||
from sphinx.domains import Domain
|
||||
|
@ -15,23 +15,23 @@ import sys
|
||||
import typing
|
||||
import warnings
|
||||
from inspect import Parameter
|
||||
from typing import Any, Dict, Iterable, Iterator, List, NamedTuple, Tuple, Type
|
||||
from typing import cast
|
||||
from typing import Any, Dict, Iterable, Iterator, List, NamedTuple, Tuple, Type, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
from docutils.parsers.rst import directives
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.addnodes import pending_xref, desc_signature
|
||||
from sphinx.addnodes import desc_signature, pending_xref
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
from sphinx.directives import ObjectDescription
|
||||
from sphinx.domains import Domain, ObjType, Index, IndexEntry
|
||||
from sphinx.domains import Domain, Index, IndexEntry, ObjType
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.pycode.ast import ast, parse as ast_parse
|
||||
from sphinx.pycode.ast import ast
|
||||
from sphinx.pycode.ast import parse as ast_parse
|
||||
from sphinx.roles import XRefRole
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.docfields import Field, GroupedField, TypedField
|
||||
|
@ -9,8 +9,7 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import Any, Dict, Iterator, List, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, Iterator, List, Tuple, cast
|
||||
|
||||
from docutils.nodes import Element
|
||||
from docutils.parsers.rst import directives
|
||||
@ -27,7 +26,6 @@ from sphinx.roles import XRefRole
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.nodes import make_id, make_refnode
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$')
|
||||
|
@ -12,8 +12,8 @@ import re
|
||||
import unicodedata
|
||||
import warnings
|
||||
from copy import copy
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Type, Union
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional,
|
||||
Tuple, Type, Union, cast)
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, system_message
|
||||
@ -27,7 +27,7 @@ from sphinx.directives import ObjectDescription
|
||||
from sphinx.domains import Domain, ObjType
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.roles import XRefRole
|
||||
from sphinx.util import ws_re, logging, docname_join
|
||||
from sphinx.util import docname_join, logging, ws_re
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
from sphinx.util.nodes import clean_astext, make_id, make_refnode
|
||||
from sphinx.util.typing import RoleFunction
|
||||
|
@ -14,8 +14,8 @@ from collections import defaultdict
|
||||
from copy import copy
|
||||
from datetime import datetime
|
||||
from os import path
|
||||
from typing import Any, Callable, Dict, Generator, Iterator, List, Set, Tuple, Union
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import (TYPE_CHECKING, Any, Callable, Dict, Generator, Iterator, List, Set, Tuple,
|
||||
Union)
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
@ -24,13 +24,12 @@ from sphinx import addnodes
|
||||
from sphinx.config import Config
|
||||
from sphinx.domains import Domain
|
||||
from sphinx.environment.adapters.toctree import TocTree
|
||||
from sphinx.errors import SphinxError, BuildEnvironmentError, DocumentError, ExtensionError
|
||||
from sphinx.errors import BuildEnvironmentError, DocumentError, ExtensionError, SphinxError
|
||||
from sphinx.events import EventManager
|
||||
from sphinx.locale import __
|
||||
from sphinx.project import Project
|
||||
from sphinx.transforms import SphinxTransformer
|
||||
from sphinx.util import DownloadFiles, FilenameUniqDict
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import DownloadFiles, FilenameUniqDict, logging
|
||||
from sphinx.util.docutils import LoggingReporter
|
||||
from sphinx.util.i18n import CatalogRepository, docname_to_domain
|
||||
from sphinx.util.nodes import is_translatable
|
||||
|
@ -11,16 +11,14 @@
|
||||
import re
|
||||
import unicodedata
|
||||
from itertools import groupby
|
||||
from typing import Any, Dict, Pattern, List, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Pattern, Tuple, cast
|
||||
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.domains.index import IndexDomain
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.errors import NoUri
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.util import split_into, logging
|
||||
|
||||
from sphinx.util import logging, split_into
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -8,15 +8,14 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Iterable, List
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING, Any, Iterable, List, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import url_re, logging
|
||||
from sphinx.util import logging, url_re
|
||||
from sphinx.util.matching import Matcher
|
||||
from sphinx.util.nodes import clean_astext, process_only_nodes
|
||||
|
||||
|
@ -26,7 +26,6 @@ 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
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Set
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Set, cast
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Set, Tuple, Type, TypeVar
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Set, Tuple, Type, TypeVar, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
@ -21,7 +20,7 @@ from sphinx.environment.adapters.toctree import TocTree
|
||||
from sphinx.environment.collectors import EnvironmentCollector
|
||||
from sphinx.locale import __
|
||||
from sphinx.transforms import SphinxContentsFilter
|
||||
from sphinx.util import url_re, logging
|
||||
from sphinx.util import logging, url_re
|
||||
|
||||
|
||||
N = TypeVar('N')
|
||||
|
@ -15,29 +15,26 @@ import re
|
||||
import warnings
|
||||
from inspect import Parameter, Signature
|
||||
from types import ModuleType
|
||||
from typing import (
|
||||
Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union
|
||||
)
|
||||
from typing import TYPE_CHECKING, get_type_hints
|
||||
from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Sequence,
|
||||
Set, Tuple, Type, TypeVar, Union, get_type_hints)
|
||||
|
||||
from docutils.statemachine import StringList
|
||||
|
||||
import sphinx
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.config import Config, ENUM
|
||||
from sphinx.config import ENUM, Config
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.ext.autodoc.importer import import_object, get_module_members, get_object_members
|
||||
from sphinx.ext.autodoc.importer import get_module_members, get_object_members, import_object
|
||||
from sphinx.ext.autodoc.mock import mock
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.pycode import ModuleAnalyzer, PycodeError
|
||||
from sphinx.util import inspect
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import inspect, logging
|
||||
from sphinx.util.docstrings import extract_metadata, prepare_docstring
|
||||
from sphinx.util.inspect import (
|
||||
evaluate_signature, getdoc, object_description, safe_getattr, stringify_signature
|
||||
)
|
||||
from sphinx.util.typing import restify, stringify as stringify_typehint
|
||||
from sphinx.util.inspect import (evaluate_signature, getdoc, object_description, safe_getattr,
|
||||
stringify_signature)
|
||||
from sphinx.util.typing import restify
|
||||
from sphinx.util.typing import stringify as stringify_typehint
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from sphinx.ext.autodoc.directive import DocumenterBridge
|
||||
|
@ -9,8 +9,7 @@
|
||||
"""
|
||||
|
||||
from inspect import Parameter, Signature, getsource
|
||||
from typing import Any, Dict, List
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, cast
|
||||
|
||||
import sphinx
|
||||
from sphinx.application import Sphinx
|
||||
@ -18,8 +17,7 @@ from sphinx.locale import __
|
||||
from sphinx.pycode.ast import ast
|
||||
from sphinx.pycode.ast import parse as ast_parse
|
||||
from sphinx.pycode.ast import unparse as ast_unparse
|
||||
from sphinx.util import inspect
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import inspect, logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -10,8 +10,7 @@
|
||||
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, Iterable
|
||||
from typing import cast
|
||||
from typing import Any, Dict, Iterable, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict
|
||||
from typing import cast
|
||||
from typing import Any, Dict, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
@ -20,7 +19,6 @@ from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.nodes import clean_astext
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -60,8 +60,7 @@ import sys
|
||||
import warnings
|
||||
from os import path
|
||||
from types import ModuleType
|
||||
from typing import Any, Dict, List, Tuple, Type
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Tuple, Type, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, system_message
|
||||
@ -76,16 +75,15 @@ from sphinx.config import Config
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.environment.adapters.toctree import TocTree
|
||||
from sphinx.ext.autodoc import Documenter, INSTANCEATTR
|
||||
from sphinx.ext.autodoc import INSTANCEATTR, Documenter
|
||||
from sphinx.ext.autodoc.directive import DocumenterBridge, Options
|
||||
from sphinx.ext.autodoc.importer import import_module
|
||||
from sphinx.ext.autodoc.mock import mock
|
||||
from sphinx.locale import __
|
||||
from sphinx.pycode import ModuleAnalyzer, PycodeError
|
||||
from sphinx.util import rst, logging
|
||||
from sphinx.util.docutils import (
|
||||
NullReporter, SphinxDirective, SphinxRole, new_document, switch_source_input
|
||||
)
|
||||
from sphinx.util import logging, rst
|
||||
from sphinx.util.docutils import (NullReporter, SphinxDirective, SphinxRole, new_document,
|
||||
switch_source_input)
|
||||
from sphinx.util.matching import Matcher
|
||||
from sphinx.writers.html import HTMLTranslator
|
||||
|
||||
|
@ -34,20 +34,17 @@ from jinja2 import TemplateNotFound
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
|
||||
import sphinx.locale
|
||||
from sphinx import __display_version__
|
||||
from sphinx import package_dir
|
||||
from sphinx import __display_version__, package_dir
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.config import Config
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
from sphinx.ext.autodoc import Documenter
|
||||
from sphinx.ext.autosummary import import_by_name, import_ivar_by_name, get_documenter
|
||||
from sphinx.ext.autosummary import get_documenter, import_by_name, import_ivar_by_name
|
||||
from sphinx.locale import __
|
||||
from sphinx.pycode import ModuleAnalyzer, PycodeError
|
||||
from sphinx.registry import SphinxComponentRegistry
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import rst
|
||||
from sphinx.util import split_full_qualified_name
|
||||
from sphinx.util import logging, rst, split_full_qualified_name
|
||||
from sphinx.util.inspect import safe_getattr
|
||||
from sphinx.util.osutil import ensuredir
|
||||
from sphinx.util.template import SphinxTemplateLoader
|
||||
@ -85,13 +82,13 @@ class AutosummaryEntry(NamedTuple):
|
||||
|
||||
|
||||
def setup_documenters(app: Any) -> None:
|
||||
from sphinx.ext.autodoc import (
|
||||
ModuleDocumenter, ClassDocumenter, ExceptionDocumenter, DataDocumenter,
|
||||
FunctionDocumenter, MethodDocumenter, AttributeDocumenter,
|
||||
InstanceAttributeDocumenter, DecoratorDocumenter, PropertyDocumenter,
|
||||
SlotsAttributeDocumenter, DataDeclarationDocumenter, GenericAliasDocumenter,
|
||||
SingledispatchFunctionDocumenter,
|
||||
)
|
||||
from sphinx.ext.autodoc import (AttributeDocumenter, ClassDocumenter,
|
||||
DataDeclarationDocumenter, DataDocumenter,
|
||||
DecoratorDocumenter, ExceptionDocumenter,
|
||||
FunctionDocumenter, GenericAliasDocumenter,
|
||||
InstanceAttributeDocumenter, MethodDocumenter,
|
||||
ModuleDocumenter, PropertyDocumenter,
|
||||
SingledispatchFunctionDocumenter, SlotsAttributeDocumenter)
|
||||
documenters = [
|
||||
ModuleDocumenter, ClassDocumenter, ExceptionDocumenter, DataDocumenter,
|
||||
FunctionDocumenter, MethodDocumenter, AttributeDocumenter,
|
||||
|
@ -15,7 +15,7 @@ import pickle
|
||||
import re
|
||||
from importlib import import_module
|
||||
from os import path
|
||||
from typing import Any, Dict, IO, List, Pattern, Set, Tuple
|
||||
from typing import IO, Any, Dict, List, Pattern, Set, Tuple
|
||||
|
||||
import sphinx
|
||||
from sphinx.application import Sphinx
|
||||
|
@ -21,7 +21,7 @@ from typing import TYPE_CHECKING
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node, TextElement
|
||||
from docutils.parsers.rst import directives
|
||||
from packaging.specifiers import SpecifierSet, InvalidSpecifier
|
||||
from packaging.specifiers import InvalidSpecifier, SpecifierSet
|
||||
from packaging.version import Version
|
||||
|
||||
import sphinx
|
||||
|
@ -11,8 +11,7 @@
|
||||
from datetime import datetime, timedelta
|
||||
from itertools import islice
|
||||
from operator import itemgetter
|
||||
from typing import Any, Dict, List
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, cast
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
|
@ -13,7 +13,7 @@ import posixpath
|
||||
import re
|
||||
import subprocess
|
||||
from os import path
|
||||
from subprocess import CalledProcessError, PIPE
|
||||
from subprocess import PIPE, CalledProcessError
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
from docutils import nodes
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from subprocess import CalledProcessError, PIPE
|
||||
from subprocess import PIPE, CalledProcessError
|
||||
from typing import Any, Dict
|
||||
|
||||
from sphinx.application import Sphinx
|
||||
@ -19,7 +19,6 @@ from sphinx.locale import __
|
||||
from sphinx.transforms.post_transforms.images import ImageConverter
|
||||
from sphinx.util import logging
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from os import path
|
||||
from subprocess import CalledProcessError, PIPE
|
||||
from subprocess import PIPE, CalledProcessError
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
from docutils import nodes
|
||||
|
@ -39,8 +39,7 @@ import builtins
|
||||
import inspect
|
||||
import re
|
||||
from importlib import import_module
|
||||
from typing import Any, Dict, Iterable, List, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, Iterable, List, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
@ -50,17 +49,14 @@ import sphinx
|
||||
from sphinx import addnodes
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.ext.graphviz import (
|
||||
graphviz, figure_wrapper,
|
||||
render_dot_html, render_dot_latex, render_dot_texinfo
|
||||
)
|
||||
from sphinx.ext.graphviz import (figure_wrapper, graphviz, render_dot_html, render_dot_latex,
|
||||
render_dot_texinfo)
|
||||
from sphinx.util import md5
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
from sphinx.writers.html import HTMLTranslator
|
||||
from sphinx.writers.latex import LaTeXTranslator
|
||||
from sphinx.writers.texinfo import TexinfoTranslator
|
||||
|
||||
|
||||
module_sig_re = re.compile(r'''^(?:([\w.]*)\.)? # module names
|
||||
(\w+) \s* $ # class/final module name
|
||||
''', re.VERBOSE)
|
||||
|
@ -29,7 +29,7 @@ import posixpath
|
||||
import sys
|
||||
import time
|
||||
from os import path
|
||||
from typing import Any, Dict, IO, List, Tuple
|
||||
from typing import IO, Any, Dict, List, Tuple
|
||||
from urllib.parse import urlsplit, urlunsplit
|
||||
|
||||
from docutils import nodes
|
||||
@ -42,11 +42,10 @@ from sphinx.builders.html import INVENTORY_FILENAME
|
||||
from sphinx.config import Config
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.util import requests, logging
|
||||
from sphinx.util import logging, requests
|
||||
from sphinx.util.inventory import InventoryFile
|
||||
from sphinx.util.typing import Inventory
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -11,8 +11,7 @@
|
||||
"""
|
||||
|
||||
import json
|
||||
from typing import Any, Dict
|
||||
from typing import cast
|
||||
from typing import Any, Dict, cast
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
|
@ -443,8 +443,8 @@ def _skip_member(app: Sphinx, what: str, name: str, obj: Any,
|
||||
if cls_path:
|
||||
try:
|
||||
if '.' in cls_path:
|
||||
import importlib
|
||||
import functools
|
||||
import importlib
|
||||
|
||||
mod = importlib.import_module(obj.__module__)
|
||||
mod_path = cls_path.split('.')
|
||||
|
@ -11,8 +11,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Tuple, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element, Node
|
||||
|
@ -23,7 +23,6 @@ from sphinx.pycode import ModuleAnalyzer
|
||||
from sphinx.util import get_full_modname, logging, status_iterator
|
||||
from sphinx.util.nodes import make_refnode
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -17,18 +17,16 @@ from pygments.filters import ErrorToken
|
||||
from pygments.formatter import Formatter
|
||||
from pygments.formatters import HtmlFormatter, LatexFormatter
|
||||
from pygments.lexer import Lexer
|
||||
from pygments.lexers import get_lexer_by_name, guess_lexer
|
||||
from pygments.lexers import PythonLexer, Python3Lexer, PythonConsoleLexer, \
|
||||
CLexer, TextLexer, RstLexer
|
||||
from pygments.lexers import (CLexer, Python3Lexer, PythonConsoleLexer, PythonLexer, RstLexer,
|
||||
TextLexer, get_lexer_by_name, guess_lexer)
|
||||
from pygments.style import Style
|
||||
from pygments.styles import get_style_by_name
|
||||
from pygments.util import ClassNotFound
|
||||
|
||||
from sphinx.locale import __
|
||||
from sphinx.pygments_styles import SphinxStyle, NoneStyle
|
||||
from sphinx.pygments_styles import NoneStyle, SphinxStyle
|
||||
from sphinx.util import logging, texescape
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
lexers = {} # type: Dict[str, Lexer]
|
||||
|
13
sphinx/io.py
13
sphinx/io.py
@ -24,15 +24,12 @@ from docutils.writers import UnfilteredWriter
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.transforms import (
|
||||
AutoIndexUpgrader, DoctreeReadEvent, FigureAligner, SphinxTransformer
|
||||
)
|
||||
from sphinx.transforms.i18n import (
|
||||
PreserveTranslatableMessages, Locale, RemoveTranslatableInline,
|
||||
)
|
||||
from sphinx.transforms import (AutoIndexUpgrader, DoctreeReadEvent, FigureAligner,
|
||||
SphinxTransformer)
|
||||
from sphinx.transforms.i18n import (Locale, PreserveTranslatableMessages,
|
||||
RemoveTranslatableInline)
|
||||
from sphinx.transforms.references import SphinxDomains
|
||||
from sphinx.util import logging, get_filetype
|
||||
from sphinx.util import UnicodeDecodeErrorHandler
|
||||
from sphinx.util import UnicodeDecodeErrorHandler, get_filetype, logging
|
||||
from sphinx.util.docutils import LoggingReporter
|
||||
from sphinx.versioning import UIDTransform
|
||||
|
||||
|
@ -13,7 +13,7 @@ from pprint import pformat
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, contextfunction
|
||||
from jinja2 import BaseLoader, FileSystemLoader, TemplateNotFound, contextfunction
|
||||
from jinja2.environment import Environment
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from jinja2.utils import open_if_exists
|
||||
|
@ -24,6 +24,7 @@ from sphinx.util.rst import append_epilog, prepend_prolog
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from docutils.transforms import Transform # NOQA
|
||||
|
||||
from sphinx.application import Sphinx
|
||||
|
||||
|
||||
|
@ -13,9 +13,7 @@ from glob import glob
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import get_matching_files
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import path_stabilize
|
||||
from sphinx.util import get_matching_files, logging, path_stabilize
|
||||
from sphinx.util.matching import compile_matchers
|
||||
from sphinx.util.osutil import SEP, relpath
|
||||
|
||||
|
@ -15,7 +15,7 @@ from importlib import import_module
|
||||
from inspect import Signature
|
||||
from io import StringIO
|
||||
from os import path
|
||||
from typing import Any, Dict, IO, List, Tuple, Optional
|
||||
from typing import IO, Any, Dict, List, Optional, Tuple
|
||||
from zipfile import ZipFile
|
||||
|
||||
from sphinx.errors import PycodeError
|
||||
|
@ -9,8 +9,7 @@
|
||||
"""
|
||||
|
||||
import sys
|
||||
from typing import Dict, List, Type, Optional
|
||||
from typing import overload
|
||||
from typing import Dict, List, Optional, Type, overload
|
||||
|
||||
if sys.version_info > (3, 8):
|
||||
import ast
|
||||
|
@ -13,14 +13,13 @@ import re
|
||||
import tokenize
|
||||
from collections import OrderedDict
|
||||
from inspect import Signature
|
||||
from token import NAME, NEWLINE, INDENT, DEDENT, NUMBER, OP, STRING
|
||||
from token import DEDENT, INDENT, NAME, NEWLINE, NUMBER, OP, STRING
|
||||
from tokenize import COMMENT, NL
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from sphinx.pycode.ast import ast # for py37 or older
|
||||
from sphinx.pycode.ast import parse, unparse
|
||||
|
||||
|
||||
comment_re = re.compile('^\\s*#: ?(.*)\r?\n?$')
|
||||
indent_re = re.compile('^\\s*$')
|
||||
emptyline_re = re.compile('^\\s*(#.*)?$')
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
from pygments.style import Style
|
||||
from pygments.styles.friendly import FriendlyStyle
|
||||
from pygments.token import Generic, Comment, Number, Whitespace, Keyword, \
|
||||
Operator, Name, String, Error
|
||||
from pygments.token import (Comment, Error, Generic, Keyword, Name, Number, Operator, String,
|
||||
Whitespace)
|
||||
|
||||
|
||||
class NoneStyle(Style):
|
||||
|
@ -10,16 +10,14 @@
|
||||
import html
|
||||
import pickle
|
||||
import re
|
||||
import warnings
|
||||
from importlib import import_module
|
||||
from os import path
|
||||
from typing import Any, Dict, IO, Iterable, List, Tuple, Set, Type
|
||||
from typing import IO, Any, Dict, Iterable, List, Set, Tuple, Type
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx import package_dir
|
||||
from sphinx import addnodes, package_dir
|
||||
from sphinx.environment import BuildEnvironment
|
||||
from sphinx.search.jssplitter import splitter_code
|
||||
from sphinx.util import jsdump
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
danish_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/danish/stop.txt
|
||||
og | and
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
german_stopwords = parse_stop_word('''
|
||||
|source: http://snowball.tartarus.org/algorithms/german/stop.txt
|
||||
aber | but
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
spanish_stopwords = parse_stop_word('''
|
||||
|source: http://snowball.tartarus.org/algorithms/spanish/stop.txt
|
||||
de | from, of
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
finnish_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/finnish/stop.txt
|
||||
| forms of BE
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
french_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/french/stop.txt
|
||||
au | a + le
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
hungarian_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/hungarian/stop.txt
|
||||
| prepared by Anna Tordai
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
italian_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/italian/stop.txt
|
||||
ad | a (to) before vowel
|
||||
|
@ -33,7 +33,7 @@ try:
|
||||
except ImportError:
|
||||
janome_module = False
|
||||
|
||||
from sphinx.errors import SphinxError, ExtensionError
|
||||
from sphinx.errors import ExtensionError, SphinxError
|
||||
from sphinx.search import SearchLanguage
|
||||
from sphinx.util import import_object
|
||||
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
dutch_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/dutch/stop.txt
|
||||
de | the
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
norwegian_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/norwegian/stop.txt
|
||||
og | and
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
portuguese_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/portuguese/stop.txt
|
||||
de | of, from
|
||||
|
File diff suppressed because one or more lines are too long
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
russian_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/russian/stop.txt
|
||||
и | and
|
||||
|
@ -14,7 +14,6 @@ import snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
|
||||
swedish_stopwords = parse_stop_word('''
|
||||
| source: http://snowball.tartarus.org/algorithms/swedish/stop.txt
|
||||
och | and
|
||||
|
File diff suppressed because one or more lines are too long
@ -14,13 +14,13 @@
|
||||
import os
|
||||
import sys
|
||||
from distutils.cmd import Command
|
||||
from distutils.errors import DistutilsOptionError, DistutilsExecError
|
||||
from distutils.errors import DistutilsExecError, DistutilsOptionError
|
||||
from io import StringIO
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.cmd.build import handle_exception
|
||||
from sphinx.util.console import nocolor, color_terminal
|
||||
from sphinx.util.console import color_terminal, nocolor
|
||||
from sphinx.util.docutils import docutils_namespace, patch_docutils
|
||||
from sphinx.util.osutil import abspath
|
||||
|
||||
|
@ -20,7 +20,6 @@ import pytest
|
||||
from sphinx.testing import util
|
||||
from sphinx.testing.util import SphinxTestApp, SphinxTestAppWrapperForSkipBuilding
|
||||
|
||||
|
||||
DEFAULT_ENABLED_MARKERS = [
|
||||
(
|
||||
'sphinx(builder, testroot=None, freshenv=False, confoverrides=None, tags=None,'
|
||||
|
@ -11,11 +11,10 @@ import os
|
||||
import shutil
|
||||
import sys
|
||||
import warnings
|
||||
from typing import Any, Callable, IO, List
|
||||
from typing import IO, Any, Callable, List
|
||||
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
|
||||
|
||||
FILESYSTEMENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding()
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ import re
|
||||
import sys
|
||||
import warnings
|
||||
from io import StringIO
|
||||
from typing import Any, Dict, Generator, IO, List, Pattern
|
||||
from typing import IO, Any, Dict, Generator, List, Pattern
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from docutils import nodes
|
||||
@ -25,7 +25,6 @@ from sphinx.pycode import ModuleAnalyzer
|
||||
from sphinx.testing.path import path
|
||||
from sphinx.util.osutil import relpath
|
||||
|
||||
|
||||
__all__ = [
|
||||
'Struct', 'SphinxTestApp', 'SphinxTestAppWrapperForSkipBuilding',
|
||||
]
|
||||
|
@ -23,8 +23,7 @@ from docutils.utils.smartquotes import smartchars
|
||||
from sphinx import addnodes
|
||||
from sphinx.config import Config
|
||||
from sphinx.locale import _, __
|
||||
from sphinx.util import docutils
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import docutils, logging
|
||||
from sphinx.util.docutils import new_document
|
||||
from sphinx.util.i18n import format_date
|
||||
from sphinx.util.nodes import NodeMatcher, apply_source_workaround, is_smartquotable
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Node
|
||||
|
@ -21,14 +21,13 @@ from docutils.utils import relative_path
|
||||
from sphinx import addnodes
|
||||
from sphinx.config import Config
|
||||
from sphinx.domains.std import make_glossary_term, split_term_classifiers
|
||||
from sphinx.locale import __, init as init_locale
|
||||
from sphinx.locale import __
|
||||
from sphinx.locale import init as init_locale
|
||||
from sphinx.transforms import SphinxTransform
|
||||
from sphinx.util import split_index_msg, logging, get_filetype
|
||||
from sphinx.util import get_filetype, logging, split_index_msg
|
||||
from sphinx.util.i18n import docname_to_domain
|
||||
from sphinx.util.nodes import (
|
||||
LITERAL_TYPE_NODES, IMAGE_TYPE_NODES, NodeMatcher,
|
||||
extract_messages, is_pending_meta, traverse_translatable_index,
|
||||
)
|
||||
from sphinx.util.nodes import (IMAGE_TYPE_NODES, LITERAL_TYPE_NODES, NodeMatcher,
|
||||
extract_messages, is_pending_meta, traverse_translatable_index)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from sphinx.application import Sphinx
|
||||
|
@ -8,8 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Tuple, Type
|
||||
from typing import cast
|
||||
from typing import Any, Dict, List, Tuple, Type, cast
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.nodes import Element
|
||||
@ -25,7 +24,6 @@ from sphinx.util import logging
|
||||
from sphinx.util.docutils import SphinxTranslator
|
||||
from sphinx.util.nodes import process_only_nodes
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -18,12 +18,10 @@ from docutils import nodes
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.locale import __
|
||||
from sphinx.transforms import SphinxTransform
|
||||
from sphinx.util import epoch_to_rfc1123, rfc1123_to_epoch, sha1
|
||||
from sphinx.util import logging, requests
|
||||
from sphinx.util.images import guess_mimetype, get_image_extension, parse_data_uri
|
||||
from sphinx.util import epoch_to_rfc1123, logging, requests, rfc1123_to_epoch, sha1
|
||||
from sphinx.util.images import get_image_extension, guess_mimetype, parse_data_uri
|
||||
from sphinx.util.osutil import ensuredir, movefile
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
MAX_FILENAME_LEN = 32
|
||||
|
@ -22,27 +22,25 @@ from datetime import datetime
|
||||
from importlib import import_module
|
||||
from os import path
|
||||
from time import mktime, strptime
|
||||
from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Pattern, Set, Tuple, Type
|
||||
from typing import TYPE_CHECKING
|
||||
from urllib.parse import urlsplit, urlunsplit, quote_plus, parse_qsl, urlencode
|
||||
from typing import (IO, TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Pattern,
|
||||
Set, Tuple, Type)
|
||||
from urllib.parse import parse_qsl, quote_plus, urlencode, urlsplit, urlunsplit
|
||||
|
||||
|
||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||
from sphinx.errors import SphinxParallelError, ExtensionError, FiletypeNotFoundError
|
||||
from sphinx.errors import ExtensionError, FiletypeNotFoundError, SphinxParallelError
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.console import strip_colors, colorize, bold, term_width_line # type: ignore
|
||||
from sphinx.util.typing import PathMatcher
|
||||
from sphinx.util import smartypants # noqa
|
||||
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.console import bold, colorize, strip_colors, term_width_line # type: ignore
|
||||
from sphinx.util.matching import patfilter # noqa
|
||||
from sphinx.util.nodes import (caption_ref_re, explicit_title_re, # noqa
|
||||
nested_parse_with_titles, split_explicit_title)
|
||||
# import other utilities; partly for backwards compatibility, so don't
|
||||
# prune unused ones indiscriminately
|
||||
from sphinx.util.osutil import ( # noqa
|
||||
SEP, os_path, relative_uri, ensuredir, mtimes_of_files, movefile,
|
||||
copyfile, copytimes, make_filename)
|
||||
from sphinx.util.nodes import ( # noqa
|
||||
nested_parse_with_titles, split_explicit_title, explicit_title_re,
|
||||
caption_ref_re)
|
||||
from sphinx.util.matching import patfilter # noqa
|
||||
from sphinx.util.osutil import (SEP, copyfile, copytimes, ensuredir, make_filename, # noqa
|
||||
movefile, mtimes_of_files, os_path, relative_uri)
|
||||
from sphinx.util.typing import PathMatcher
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@ -218,10 +216,12 @@ _DEBUG_HEADER = '''\
|
||||
|
||||
def save_traceback(app: "Sphinx") -> str:
|
||||
"""Save the current exception's traceback in a temporary file."""
|
||||
import sphinx
|
||||
import jinja2
|
||||
import docutils
|
||||
import platform
|
||||
|
||||
import docutils
|
||||
import jinja2
|
||||
|
||||
import sphinx
|
||||
exc = sys.exc_info()[1]
|
||||
if isinstance(exc, SphinxParallelError):
|
||||
exc_format = '(Error in parallel process)\n' + exc.traceback
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user