Remove unneeded runtime typing imports (#13233)

This commit is contained in:
Adam Turner
2025-01-12 01:04:14 +00:00
committed by GitHub
parent d29c2c1ff3
commit 72ce43619c
102 changed files with 265 additions and 149 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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()