mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Do isort
This commit is contained in:
parent
279e547860
commit
b718aef7d8
@ -19,7 +19,6 @@ from subprocess import PIPE
|
|||||||
|
|
||||||
from .deprecation import RemovedInNextVersionWarning
|
from .deprecation import RemovedInNextVersionWarning
|
||||||
|
|
||||||
|
|
||||||
# by default, all DeprecationWarning under sphinx package will be emit.
|
# by default, all DeprecationWarning under sphinx package will be emit.
|
||||||
# Users can avoid this by using environment variable: PYTHONWARNINGS=
|
# Users can avoid this by using environment variable: PYTHONWARNINGS=
|
||||||
if 'PYTHONWARNINGS' not in os.environ:
|
if 'PYTHONWARNINGS' not in os.environ:
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Any, Dict, List, Sequence
|
from typing import TYPE_CHECKING, Any, Dict, List, Sequence
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Element
|
from docutils.nodes import Element
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
import pickle
|
import pickle
|
||||||
import time
|
import time
|
||||||
from os import path
|
from os import path
|
||||||
from typing import Any, Dict, Iterable, List, Sequence, Set, Tuple, Type, Union
|
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Sequence, Set, Tuple, Type, Union
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Node
|
from docutils.nodes import Node
|
||||||
|
@ -13,7 +13,7 @@ from collections import OrderedDict, defaultdict
|
|||||||
from datetime import datetime, timedelta, tzinfo
|
from datetime import datetime, timedelta, tzinfo
|
||||||
from os import getenv, path, walk
|
from os import getenv, path, walk
|
||||||
from time import time
|
from time import time
|
||||||
from typing import Any, DefaultDict, Dict, Iterable, Generator, List, Set, Tuple, Union
|
from typing import Any, DefaultDict, Dict, Generator, Iterable, List, Set, Tuple, Union
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
@ -47,7 +47,6 @@ from sphinx.util.osutil import copyfile, ensuredir, movefile, os_path, relative_
|
|||||||
from sphinx.util.tags import Tags
|
from sphinx.util.tags import Tags
|
||||||
from sphinx.writers.html import HTMLTranslator, HTMLWriter
|
from sphinx.writers.html import HTMLTranslator, HTMLWriter
|
||||||
|
|
||||||
|
|
||||||
# HTML5 Writer is available or not
|
# HTML5 Writer is available or not
|
||||||
if is_html5_writer_available():
|
if is_html5_writer_available():
|
||||||
from sphinx.writers.html5 import HTML5Translator
|
from sphinx.writers.html5 import HTML5Translator
|
||||||
|
@ -23,7 +23,6 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.osutil import ensuredir, os_path
|
from sphinx.util.osutil import ensuredir, os_path
|
||||||
from sphinx.writers.xml import PseudoXMLWriter, XMLWriter
|
from sphinx.writers.xml import PseudoXMLWriter, XMLWriter
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
from difflib import unified_diff
|
from difflib import unified_diff
|
||||||
from typing import Any, Dict, List, Tuple
|
from typing import TYPE_CHECKING, Any, Dict, List, Tuple
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Element, Node
|
from docutils.nodes import Element, Node
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Any, Dict, Iterable, List, Tuple
|
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Tuple
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Node, system_message
|
from docutils.nodes import Node, system_message
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Any, Dict, Iterable, List, Tuple
|
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Tuple
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Element, Node, make_id, system_message
|
from docutils.nodes import Element, Node, make_id, system_message
|
||||||
|
@ -40,7 +40,6 @@ from sphinx.util.inspect import signature_from_str
|
|||||||
from sphinx.util.nodes import make_id, make_refnode
|
from sphinx.util.nodes import make_id, make_refnode
|
||||||
from sphinx.util.typing import TextlikeNode
|
from sphinx.util.typing import TextlikeNode
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Dict, List, Set
|
from typing import TYPE_CHECKING, Dict, List, Set
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ from sphinx.locale import __
|
|||||||
from sphinx.transforms import SphinxContentsFilter
|
from sphinx.transforms import SphinxContentsFilter
|
||||||
from sphinx.util import logging, url_re
|
from sphinx.util import logging, url_re
|
||||||
|
|
||||||
|
|
||||||
N = TypeVar('N')
|
N = TypeVar('N')
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
from typing import Any, Callable, Dict, List, NamedTuple, Tuple, Type
|
from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Tuple, Type
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from sphinx.errors import ExtensionError, SphinxError
|
from sphinx.errors import ExtensionError, SphinxError
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
|
@ -21,7 +21,6 @@ from sphinx.util import logging
|
|||||||
from sphinx.util.docutils import SphinxDirective, switch_source_input
|
from sphinx.util.docutils import SphinxDirective, switch_source_input
|
||||||
from sphinx.util.nodes import nested_parse_with_titles
|
from sphinx.util.nodes import nested_parse_with_titles
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ from sphinx.util.docutils import (NullReporter, SphinxDirective, SphinxRole, new
|
|||||||
from sphinx.util.matching import Matcher
|
from sphinx.util.matching import Matcher
|
||||||
from sphinx.writers.html import HTMLTranslator
|
from sphinx.writers.html import HTMLTranslator
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ from sphinx.util.inspect import safe_getattr
|
|||||||
from sphinx.util.osutil import ensuredir
|
from sphinx.util.osutil import ensuredir
|
||||||
from sphinx.util.template import SphinxTemplateLoader
|
from sphinx.util.template import SphinxTemplateLoader
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ import sys
|
|||||||
import time
|
import time
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from os import path
|
from os import path
|
||||||
from typing import Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple, Type
|
from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple,
|
||||||
from typing import TYPE_CHECKING
|
Type)
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Element, Node, TextElement
|
from docutils.nodes import Element, Node, TextElement
|
||||||
|
@ -22,7 +22,6 @@ from sphinx.ext.napoleon.iterators import modify_iter
|
|||||||
from sphinx.locale import _, __
|
from sphinx.locale import _, __
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
_directive_regex = re.compile(r'\.\. \S+::')
|
_directive_regex = re.compile(r'\.\. \S+::')
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Any, Dict
|
from typing import TYPE_CHECKING, Any, Dict
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from sphinx.config import Config
|
from sphinx.config import Config
|
||||||
from sphinx.errors import VersionRequirementError
|
from sphinx.errors import VersionRequirementError
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
import codecs
|
import codecs
|
||||||
from typing import Any, List, Type
|
from typing import TYPE_CHECKING, Any, List, Type
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.core import Publisher
|
from docutils.core import Publisher
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
|
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Tuple, Union
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from jinja2 import BaseLoader, FileSystemLoader, TemplateNotFound, contextfunction
|
from jinja2 import BaseLoader, FileSystemLoader, TemplateNotFound, contextfunction
|
||||||
from jinja2.environment import Environment
|
from jinja2.environment import Environment
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
from typing import Any, Dict, List, Type, Union
|
from typing import TYPE_CHECKING, Any, Dict, List, Type, Union
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
import docutils.parsers
|
import docutils.parsers
|
||||||
import docutils.parsers.rst
|
import docutils.parsers.rst
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
import traceback
|
import traceback
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from types import MethodType
|
from types import MethodType
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Type, Union
|
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Tuple, Type, Union
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.io import Input
|
from docutils.io import Input
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from typing import Any, Dict, List, Tuple, Type
|
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Type
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes, utils
|
from docutils import nodes, utils
|
||||||
from docutils.nodes import Element, Node, TextElement, system_message
|
from docutils.nodes import Element, Node, TextElement, system_message
|
||||||
|
@ -13,8 +13,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from os import path
|
from os import path
|
||||||
from typing import Any, Dict, List
|
from typing import TYPE_CHECKING, Any, Dict, List
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from typing import Any, Dict, Generator, List, Tuple
|
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Tuple
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.nodes import Element, Node, Text
|
from docutils.nodes import Element, Node, Text
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
from textwrap import indent
|
from textwrap import indent
|
||||||
from typing import Any, Dict, List, Tuple, Type, TypeVar
|
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Type, TypeVar
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.io import StringInput
|
from docutils.io import StringInput
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Any, Dict
|
from typing import TYPE_CHECKING, Any, Dict
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils.transforms.references import DanglingReferences
|
from docutils.transforms.references import DanglingReferences
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ from typing import (IO, TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator,
|
|||||||
Set, Tuple, Type)
|
Set, Tuple, Type)
|
||||||
from urllib.parse import parse_qsl, quote_plus, urlencode, urlsplit, urlunsplit
|
from urllib.parse import parse_qsl, quote_plus, urlencode, urlsplit, urlunsplit
|
||||||
|
|
||||||
|
|
||||||
from sphinx.deprecation import RemovedInSphinx50Warning
|
from sphinx.deprecation import RemovedInSphinx50Warning
|
||||||
from sphinx.errors import ExtensionError, FiletypeNotFoundError, SphinxParallelError
|
from sphinx.errors import ExtensionError, FiletypeNotFoundError, SphinxParallelError
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
@ -42,7 +41,6 @@ from sphinx.util.osutil import (SEP, copyfile, copytimes, ensuredir, make_filena
|
|||||||
movefile, mtimes_of_files, os_path, relative_uri)
|
movefile, mtimes_of_files, os_path, relative_uri)
|
||||||
from sphinx.util.typing import PathMatcher
|
from sphinx.util.typing import PathMatcher
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from sphinx.application import Sphinx
|
from sphinx.application import Sphinx
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Any, Dict
|
from typing import TYPE_CHECKING, Any, Dict
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from sphinx.application import Sphinx
|
from sphinx.application import Sphinx
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
from typing import Callable, Dict
|
from typing import TYPE_CHECKING, Callable, Dict
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from docutils.utils import relative_path
|
from docutils.utils import relative_path
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from os import path
|
from os import path
|
||||||
from typing import Callable, Generator, List, NamedTuple, Tuple, Union
|
from typing import TYPE_CHECKING, Callable, Generator, List, NamedTuple, Tuple, Union
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
import babel.dates
|
import babel.dates
|
||||||
from babel.messages.mofile import write_mo
|
from babel.messages.mofile import write_mo
|
||||||
|
@ -13,7 +13,6 @@ from typing import Any, Callable
|
|||||||
|
|
||||||
from sphinx.deprecation import RemovedInSphinx60Warning
|
from sphinx.deprecation import RemovedInSphinx60Warning
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Python 2/3 compatibility
|
# Python 2/3 compatibility
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@ import pickle
|
|||||||
from itertools import product, zip_longest
|
from itertools import product, zip_longest
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from os import path
|
from os import path
|
||||||
from typing import Any, Dict, Iterator
|
from typing import TYPE_CHECKING, Any, Dict, Iterator
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from docutils.nodes import Node
|
from docutils.nodes import Node
|
||||||
|
Loading…
Reference in New Issue
Block a user