Merge pull request #4650 from tk0miya/use_typing.TYPE_CHECKING_in_master

Use typing.TYPE_CHECKING (in master)
This commit is contained in:
Takeshi KOMIYA 2018-02-19 23:43:30 +09:00 committed by GitHub
commit c95f538913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 31 additions and 42 deletions

View File

@ -24,6 +24,7 @@ from .deprecation import RemovedInSphinx20Warning
if False: if False:
# For type annotation # For type annotation
# note: Don't use typing.TYPE_CHECK here (for py27 and py34).
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -10,13 +10,12 @@
""" """
import warnings import warnings
from typing import TYPE_CHECKING
from sphinx.deprecation import RemovedInSphinx20Warning from sphinx.deprecation import RemovedInSphinx20Warning
from sphinx.ext.apidoc import main as _main from sphinx.ext.apidoc import main as _main
if TYPE_CHECKING:
if False:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA
from sphinx.application import Sphinx # NOQA from sphinx.application import Sphinx # NOQA

View File

@ -16,8 +16,7 @@ from docutils import nodes
from sphinx.util import logging from sphinx.util import logging
from sphinx.util.nodes import clean_astext from sphinx.util.nodes import clean_astext
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any, Dict # NOQA from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA from sphinx.application import Sphinx # NOQA

View File

@ -24,14 +24,15 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
from typing import TYPE_CHECKING
from docutils import nodes, utils from docutils import nodes, utils
from six import iteritems from six import iteritems
import sphinx import sphinx
from sphinx.util.nodes import split_explicit_title from sphinx.util.nodes import split_explicit_title
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any, Dict, List, Tuple # NOQA from typing import Any, Dict, List, Tuple # NOQA
from docutils.parsers.rst.states import Inliner # NOQA from docutils.parsers.rst.states import Inliner # NOQA
from sphinx.application import Sphinx # NOQA from sphinx.application import Sphinx # NOQA

View File

@ -10,11 +10,11 @@
""" """
import os import os
from typing import TYPE_CHECKING
import sphinx import sphinx
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any, Dict # NOQA from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA from sphinx.application import Sphinx # NOQA
from sphinx.environment import BuildEnvironment # NOQA from sphinx.environment import BuildEnvironment # NOQA

View File

@ -10,6 +10,8 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
from typing import TYPE_CHECKING
from docutils import nodes from docutils import nodes
import sphinx import sphinx
@ -19,8 +21,7 @@ from sphinx.ext.mathbase import setup_math as mathbase_setup
from sphinx.locale import _ from sphinx.locale import _
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any, Dict # NOQA from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA from sphinx.application import Sphinx # NOQA

View File

@ -11,6 +11,8 @@
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.
""" """
from typing import TYPE_CHECKING
from docutils import nodes from docutils import nodes
import sphinx 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.ext.mathbase import setup_math as mathbase_setup
from sphinx.locale import _ from sphinx.locale import _
if TYPE_CHECKING:
if False:
# For type annotation
from typing import Any, Dict # NOQA from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA from sphinx.application import Sphinx # NOQA

View File

@ -10,12 +10,12 @@
""" """
import warnings import warnings
from typing import TYPE_CHECKING
from sphinx.cmd.quickstart import main as _main from sphinx.cmd.quickstart import main as _main
from sphinx.deprecation import RemovedInSphinx20Warning from sphinx.deprecation import RemovedInSphinx20Warning
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any # NOQA from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer import snowballstemmer
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any from typing import Any
swedish_stopwords = parse_stop_word(u''' swedish_stopwords = parse_stop_word(u'''

View File

@ -10,11 +10,11 @@ import os
import shutil import shutil
import sys import sys
from io import open from io import open
from typing import TYPE_CHECKING
from six import PY2, text_type from six import PY2, text_type
if False: if TYPE_CHECKING:
# For type annotation
from typing import Any, Callable, IO, List # NOQA from typing import Any, Callable, IO, List # NOQA