forked from pypa/cibuildwheel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typing.py
50 lines (40 loc) 路 1.09 KB
/
typing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from __future__ import annotations
import os
import subprocess
import sys
from typing import TYPE_CHECKING, Union
if sys.version_info < (3, 8):
from typing_extensions import Final, Literal, OrderedDict, Protocol, TypedDict
else:
from typing import Final, Literal, OrderedDict, Protocol, TypedDict
if sys.version_info < (3, 11):
from typing_extensions import NotRequired, assert_never
else:
from typing import NotRequired, assert_never
__all__ = (
"Final",
"Literal",
"PLATFORMS",
"PathOrStr",
"PlatformName",
"Protocol",
"PLATFORMS",
"PopenBytes",
"Protocol",
"TypedDict",
"OrderedDict",
"assert_never",
"NotRequired",
)
if TYPE_CHECKING:
PopenBytes = subprocess.Popen[bytes]
PathOrStr = Union[str, os.PathLike[str]]
else:
PopenBytes = subprocess.Popen
PathOrStr = Union[str, "os.PathLike[str]"]
PlatformName = Literal["linux", "macos", "windows"]
PLATFORMS: Final[set[PlatformName]] = {"linux", "macos", "windows"}
class GenericPythonConfiguration(Protocol):
@property
def identifier(self) -> str:
...