mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove unneeded runtime typing imports (#13233)
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -10,6 +10,9 @@ from sphinx.cmd import make_mode
|
||||
from sphinx.cmd.build import get_parser
|
||||
from sphinx.cmd.make_mode import run_make_mode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
broken_argparse = (
|
||||
sys.version_info[:3] <= (3, 12, 6)
|
||||
or sys.version_info[:3] == (3, 13, 0)
|
||||
|
@@ -6,7 +6,10 @@ source file translated by test_build.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
|
@@ -38,9 +38,6 @@ from tests.test_util.intersphinx_data import (
|
||||
)
|
||||
from tests.utils import http_server
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import NoReturn
|
||||
|
||||
|
||||
class FakeList(list): # NoQA: FURB189
|
||||
def __iter__(self) -> NoReturn:
|
||||
@@ -744,6 +741,8 @@ def test_intersphinx_role(app):
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import NoReturn
|
||||
|
||||
from sphinx.ext.intersphinx._shared import InventoryCacheEntry
|
||||
|
||||
|
||||
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import time
|
||||
from io import StringIO
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -15,6 +15,7 @@ from sphinx.util.console import coloron, nocolor
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
warnfile = StringIO()
|
||||
|
||||
|
Reference in New Issue
Block a user