chore: use if TYPE_CHECKING: blocks (#2866)

This commit is contained in:
Matthieu Darbois
2026-05-27 18:20:08 -04:00
committed by GitHub
parent 2380f52783
commit e3e7cc9e07
79 changed files with 566 additions and 168 deletions
+5 -2
View File
@@ -1,7 +1,7 @@
from __future__ import annotations
import contextlib
import sys
from collections.abc import Generator
from pathlib import Path
import pytest
import setuptools._distutils.util
@@ -11,6 +11,9 @@ from cibuildwheel.errors import FatalError
from cibuildwheel.platforms.windows import PythonConfiguration, setup_setuptools_cross_compile
TYPE_CHECKING = False
if TYPE_CHECKING:
from collections.abc import Generator
from pathlib import Path
# monkeypatching os.name is too flaky. E.g. It works on my machine, but fails in pipeline
if not sys.platform.startswith("win") and not TYPE_CHECKING: