From 084e50b060e338118ab9b44dba11d52f08b903b9 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 8 May 2021 19:24:40 +0100 Subject: [PATCH] Fix some typing issues --- cibuildwheel/typing.py | 4 +++- cibuildwheel/windows.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cibuildwheel/typing.py b/cibuildwheel/typing.py index b8e91764..68b5c770 100644 --- a/cibuildwheel/typing.py +++ b/cibuildwheel/typing.py @@ -1,7 +1,7 @@ import os import subprocess import sys -from typing import TYPE_CHECKING, NoReturn, Set, Union +from typing import TYPE_CHECKING, Any, NoReturn, Set, Union if sys.version_info < (3, 8): from typing_extensions import Final, Literal, TypedDict @@ -26,9 +26,11 @@ __all__ = ( if TYPE_CHECKING: PopenBytes = subprocess.Popen[bytes] PathOrStr = Union[str, os.PathLike[str]] + CompletedProcess = subprocess.CompletedProcess[Any] else: PopenBytes = subprocess.Popen PathOrStr = Union[str, "os.PathLike[str]"] + CompletedProcess = subprocess.CompletedProcess PlatformName = Literal["linux", "macos", "windows"] diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 304919ed..5bec98db 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -4,13 +4,13 @@ import subprocess import sys import tempfile from pathlib import Path -from typing import Any, Dict, List, NamedTuple, Optional, Sequence, Set +from typing import Dict, List, NamedTuple, Optional, Sequence, Set from zipfile import ZipFile from .architecture import Architecture from .environment import ParsedEnvironment from .logger import log -from .typing import PathOrStr +from .typing import CompletedProcess, PathOrStr from .util import ( BuildOptions, BuildSelector, @@ -27,7 +27,7 @@ def call( env: Optional[Dict[str, str]] = None, cwd: Optional[str] = None, check: bool = True, -) -> subprocess.CompletedProcess[Any]: +) -> CompletedProcess: print("+ " + " ".join(str(a) for a in args)) # we use shell=True here, even though we don't need a shell due to a bug # https://bugs.python.org/issue8557