Fix some typing issues
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
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):
|
if sys.version_info < (3, 8):
|
||||||
from typing_extensions import Final, Literal, TypedDict
|
from typing_extensions import Final, Literal, TypedDict
|
||||||
@@ -26,9 +26,11 @@ __all__ = (
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
PopenBytes = subprocess.Popen[bytes]
|
PopenBytes = subprocess.Popen[bytes]
|
||||||
PathOrStr = Union[str, os.PathLike[str]]
|
PathOrStr = Union[str, os.PathLike[str]]
|
||||||
|
CompletedProcess = subprocess.CompletedProcess[Any]
|
||||||
else:
|
else:
|
||||||
PopenBytes = subprocess.Popen
|
PopenBytes = subprocess.Popen
|
||||||
PathOrStr = Union[str, "os.PathLike[str]"]
|
PathOrStr = Union[str, "os.PathLike[str]"]
|
||||||
|
CompletedProcess = subprocess.CompletedProcess
|
||||||
|
|
||||||
|
|
||||||
PlatformName = Literal["linux", "macos", "windows"]
|
PlatformName = Literal["linux", "macos", "windows"]
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from pathlib import Path
|
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 zipfile import ZipFile
|
||||||
|
|
||||||
from .architecture import Architecture
|
from .architecture import Architecture
|
||||||
from .environment import ParsedEnvironment
|
from .environment import ParsedEnvironment
|
||||||
from .logger import log
|
from .logger import log
|
||||||
from .typing import PathOrStr
|
from .typing import CompletedProcess, PathOrStr
|
||||||
from .util import (
|
from .util import (
|
||||||
BuildOptions,
|
BuildOptions,
|
||||||
BuildSelector,
|
BuildSelector,
|
||||||
@@ -27,7 +27,7 @@ def call(
|
|||||||
env: Optional[Dict[str, str]] = None,
|
env: Optional[Dict[str, str]] = None,
|
||||||
cwd: Optional[str] = None,
|
cwd: Optional[str] = None,
|
||||||
check: bool = True,
|
check: bool = True,
|
||||||
) -> subprocess.CompletedProcess[Any]:
|
) -> CompletedProcess:
|
||||||
print("+ " + " ".join(str(a) for a in args))
|
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
|
# we use shell=True here, even though we don't need a shell due to a bug
|
||||||
# https://bugs.python.org/issue8557
|
# https://bugs.python.org/issue8557
|
||||||
|
|||||||
Reference in New Issue
Block a user