diff options
author | François Freitag <mail@franek.fr> | 2020-11-11 14:00:27 +0300 |
---|---|---|
committer | François Freitag <mail@franek.fr> | 2020-11-11 15:19:05 +0300 |
commit | 0949735210abaa05b6448e531984f159403053f4 (patch) | |
tree | 3561f378bc9fa97a73ad5b298e4bcd669827a044 /sphinx/transforms | |
parent | e2c969c4955662a8c5e4da8b77672aaaa7729359 (diff) |
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.
The isort project has more feature and is more active than the
flake8-import-order plugin.
Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
Diffstat (limited to 'sphinx/transforms')
-rw-r--r-- | sphinx/transforms/__init__.py | 8 | ||||
-rw-r--r-- | sphinx/transforms/compact_bullet_list.py | 3 | ||||
-rw-r--r-- | sphinx/transforms/i18n.py | 12 | ||||
-rw-r--r-- | sphinx/transforms/post_transforms/__init__.py | 4 | ||||
-rw-r--r-- | sphinx/transforms/post_transforms/code.py | 1 | ||||
-rw-r--r-- | sphinx/transforms/post_transforms/images.py | 6 |
6 files changed, 13 insertions, 21 deletions
diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py index beb983f2a..f854f1772 100644 --- a/sphinx/transforms/__init__.py +++ b/sphinx/transforms/__init__.py @@ -23,8 +23,7 @@ from sphinx import addnodes from sphinx.config import Config from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias 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 @@ -401,9 +400,8 @@ class ManpageLink(SphinxTransform): node.attributes.update(info) -from sphinx.domains.citation import ( # NOQA - CitationDefinitionTransform, CitationReferenceTransform -) +from sphinx.domains.citation import CitationDefinitionTransform # NOQA +from sphinx.domains.citation import CitationReferenceTransform # NOQA deprecated_alias('sphinx.transforms', { diff --git a/sphinx/transforms/compact_bullet_list.py b/sphinx/transforms/compact_bullet_list.py index 1cde3b1f0..e30efa92b 100644 --- a/sphinx/transforms/compact_bullet_list.py +++ b/sphinx/transforms/compact_bullet_list.py @@ -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 diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index c935ab195..bffcb511d 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -20,18 +20,18 @@ 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 False: # For type annotation from typing import Type # for python3.5.1 + from sphinx.application import Sphinx diff --git a/sphinx/transforms/post_transforms/__init__.py b/sphinx/transforms/post_transforms/__init__.py index 6633d6434..f9feab2a6 100644 --- a/sphinx/transforms/post_transforms/__init__.py +++ b/sphinx/transforms/post_transforms/__init__.py @@ -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__) diff --git a/sphinx/transforms/post_transforms/code.py b/sphinx/transforms/post_transforms/code.py index 2012d6e11..d306b5c80 100644 --- a/sphinx/transforms/post_transforms/code.py +++ b/sphinx/transforms/post_transforms/code.py @@ -20,7 +20,6 @@ from sphinx.application import Sphinx from sphinx.ext import doctest from sphinx.transforms import SphinxTransform - HighlightSetting = NamedTuple('HighlightSetting', [('language', str), ('force', bool), ('lineno_threshold', int)]) diff --git a/sphinx/transforms/post_transforms/images.py b/sphinx/transforms/post_transforms/images.py index 949c09dde..4865aa615 100644 --- a/sphinx/transforms/post_transforms/images.py +++ b/sphinx/transforms/post_transforms/images.py @@ -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 |