mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-12 08:25:01 -05:00
Merge pull request #4650 from tk0miya/use_typing.TYPE_CHECKING_in_master
Use typing.TYPE_CHECKING (in master)
This commit is contained in:
21 files changed
+31
-42
No files matched your search
@@ -24,6 +24,7 @@ from .deprecation import RemovedInSphinx20Warning
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
# note: Don't use typing.TYPE_CHECK here (for py27 and py34).
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+2
-3
@@ -10,13 +10,12 @@
|
||||
"""
|
||||
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
||||
from sphinx.ext.apidoc import main as _main
|
||||
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ from docutils import nodes
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.nodes import clean_astext
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
@@ -24,14 +24,15 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes, utils
|
||||
from six import iteritems
|
||||
|
||||
import sphinx
|
||||
from sphinx.util.nodes import split_explicit_title
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Dict, List, Tuple # NOQA
|
||||
from docutils.parsers.rst.states import Inliner # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import sphinx
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
import sphinx
|
||||
@@ -19,8 +21,7 @@ from sphinx.ext.mathbase import setup_math as mathbase_setup
|
||||
from sphinx.locale import _
|
||||
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
import sphinx
|
||||
@@ -19,9 +21,7 @@ from sphinx.ext.mathbase import get_node_equation_number
|
||||
from sphinx.ext.mathbase import setup_math as mathbase_setup
|
||||
from sphinx.locale import _
|
||||
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Dict # NOQA
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
"""
|
||||
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sphinx.cmd.quickstart import main as _main
|
||||
from sphinx.deprecation import RemovedInSphinx20Warning
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any # NOQA
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
import snowballstemmer
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
swedish_stopwords = parse_stop_word(u'''
|
||||
|
||||
@@ -10,11 +10,11 @@ import os
|
||||
import shutil
|
||||
import sys
|
||||
from io import open
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from six import PY2, text_type
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Callable, IO, List # NOQA
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user