Add workflow stubtests for macos (#5384)

* Add macos to stubtest

* Add general darwin stubtest exception file

* Adding exceptions and platform ifs
This commit is contained in:
hatal175
2021-05-09 23:24:00 +03:00
committed by GitHub
parent 933787d5fe
commit 244fc622e6
15 changed files with 117 additions and 41 deletions

View File

@@ -81,7 +81,7 @@ class Error(Exception): ...
def setlocale(category: int, locale: Union[_str, Iterable[_str], None] = ...) -> _str: ...
def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ...
def nl_langinfo(option: int) -> _str: ...
def nl_langinfo(__key: int) -> _str: ...
def getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> Tuple[Optional[_str], Optional[_str]]: ...
def getlocale(category: int = ...) -> Sequence[_str]: ...
def getpreferredencoding(do_setlocale: bool = ...) -> _str: ...

View File

@@ -9,11 +9,13 @@ ACCESS_COPY: int
ALLOCATIONGRANULARITY: int
if sys.platform == "linux":
MAP_DENYWRITE: int
MAP_EXECUTABLE: int
if sys.platform != "win32":
MAP_ANON: int
MAP_ANONYMOUS: int
MAP_DENYWRITE: int
MAP_EXECUTABLE: int
MAP_PRIVATE: int
MAP_SHARED: int
PROT_EXEC: int

View File

@@ -117,6 +117,8 @@ if sys.platform != "win32":
RTLD_LOCAL: int
RTLD_NODELETE: int
RTLD_NOLOAD: int
if sys.platform == "linux":
RTLD_DEEPBIND: int
SEEK_SET: int
@@ -791,8 +793,9 @@ else:
def spawnvp(mode: int, file: AnyPath, args: _ExecVArgs) -> int: ...
def spawnvpe(mode: int, file: AnyPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...
def wait() -> Tuple[int, int]: ... # Unix only
from posix import waitid_result
def waitid(idtype: int, ident: int, options: int) -> waitid_result: ...
if sys.platform != "darwin":
from posix import waitid_result
def waitid(idtype: int, ident: int, options: int) -> waitid_result: ...
def wait3(options: int) -> Tuple[int, int, Any]: ...
def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ...
def WCOREDUMP(__status: int) -> bool: ...
@@ -808,14 +811,15 @@ if sys.platform != "win32":
from posix import sched_param
def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix
def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix
def sched_setscheduler(pid: int, policy: int, param: sched_param) -> None: ... # some flavors of Unix
def sched_getscheduler(pid: int) -> int: ... # some flavors of Unix
def sched_setparam(pid: int, param: sched_param) -> None: ... # some flavors of Unix
def sched_getparam(pid: int) -> sched_param: ... # some flavors of Unix
def sched_rr_get_interval(pid: int) -> float: ... # some flavors of Unix
def sched_yield() -> None: ... # some flavors of Unix
def sched_setaffinity(pid: int, mask: Iterable[int]) -> None: ... # some flavors of Unix
def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix
if sys.platform != "darwin":
def sched_setscheduler(pid: int, policy: int, param: sched_param) -> None: ... # some flavors of Unix
def sched_getscheduler(pid: int) -> int: ... # some flavors of Unix
def sched_rr_get_interval(pid: int) -> float: ... # some flavors of Unix
def sched_setparam(pid: int, param: sched_param) -> None: ... # some flavors of Unix
def sched_getparam(pid: int) -> sched_param: ... # some flavors of Unix
def sched_setaffinity(pid: int, mask: Iterable[int]) -> None: ... # some flavors of Unix
def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix
def cpu_count() -> Optional[int]: ...

View File

@@ -16,12 +16,13 @@ class times_result(NamedTuple):
children_system: float
elapsed: float
class waitid_result(NamedTuple):
si_pid: int
si_uid: int
si_signo: int
si_status: int
si_code: int
if sys.platform != "darwin":
class waitid_result(NamedTuple):
si_pid: int
si_uid: int
si_signo: int
si_status: int
si_code: int
class sched_param(NamedTuple):
sched_priority: int
@@ -59,8 +60,9 @@ F_TEST: int
F_TLOCK: int
F_ULOCK: int
GRND_NONBLOCK: int
GRND_RANDOM: int
if sys.platform == "linux":
GRND_NONBLOCK: int
GRND_RANDOM: int
NGROUPS_MAX: int
O_APPEND: int
@@ -84,12 +86,13 @@ O_SYNC: int
O_TRUNC: int
O_WRONLY: int
POSIX_FADV_DONTNEED: int
POSIX_FADV_NOREUSE: int
POSIX_FADV_NORMAL: int
POSIX_FADV_RANDOM: int
POSIX_FADV_SEQUENTIAL: int
POSIX_FADV_WILLNEED: int
if sys.platform != "darwin":
POSIX_FADV_DONTNEED: int
POSIX_FADV_NOREUSE: int
POSIX_FADV_NORMAL: int
POSIX_FADV_RANDOM: int
POSIX_FADV_SEQUENTIAL: int
POSIX_FADV_WILLNEED: int
PRIO_PGRP: int
PRIO_PROCESS: int
@@ -99,7 +102,8 @@ P_ALL: int
P_PGID: int
P_PID: int
RTLD_DEEPBIND: int
if sys.platform == "linux":
RTLD_DEEPBIND: int
RTLD_GLOBAL: int
RTLD_LAZY: int
RTLD_LOCAL: int
@@ -107,13 +111,16 @@ RTLD_NODELETE: int
RTLD_NOLOAD: int
RTLD_NOW: int
SCHED_BATCH: int
SCHED_FIFO: int
SCHED_IDLE: int
SCHED_OTHER: int
SCHED_RESET_ON_FORK: int
SCHED_RR: int
if sys.platform == "linux":
SCHED_BATCH: int
SCHED_IDLE: int
if sys.platform != "darwin":
SCHED_RESET_ON_FORK: int
SEEK_DATA: int
SEEK_HOLE: int

View File

@@ -54,11 +54,11 @@ def normpath(path: PathLike[AnyStr]) -> AnyStr: ...
@overload
def normpath(path: AnyStr) -> AnyStr: ...
if sys.platform == "win32":
if sys.version_info >= (3, 10):
@overload
def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
def realpath(filename: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ...
@overload
def realpath(path: AnyStr) -> AnyStr: ...
def realpath(filename: AnyStr, *, strict: bool = ...) -> AnyStr: ...
else:
@overload

View File

@@ -41,6 +41,8 @@ if sys.platform != "win32":
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
if sys.platform == "linux":
class EpollSelector(BaseSelector):
def fileno(self) -> int: ...
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...

View File

@@ -137,7 +137,7 @@ if sys.platform == "win32":
CTRL_C_EVENT: int
CTRL_BREAK_EVENT: int
if sys.platform != "win32":
if sys.platform != "win32" and sys.platform != "darwin":
class struct_siginfo(Tuple[int, int, int, int, int, int, int]):
def __init__(self, sequence: Iterable[int]) -> None: ...
@property
@@ -189,6 +189,7 @@ def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ...
if sys.platform != "win32":
def sigpending() -> Any: ...
def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: ...
def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ...
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ...
if sys.platform != "darwin":
def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: ...
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ...

View File

@@ -14,7 +14,8 @@ timezone: int
tzname: Tuple[str, str]
if sys.version_info >= (3, 7) and sys.platform != "win32":
CLOCK_BOOTTIME: int # Linux
if sys.platform == "linux":
CLOCK_BOOTTIME: int
CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD
CLOCK_UPTIME: int # FreeBSD, OpenBSD