From 24277cedf41e802b3e23f03933ba0cce1fa40f8a Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 12 Nov 2022 19:14:15 -0500 Subject: [PATCH] Run stubtest on windows for colorama (#9168) --- stubs/colorama/@tests/stubtest_allowlist.txt | 7 ------- stubs/colorama/@tests/stubtest_allowlist_linux.txt | 8 ++++++++ stubs/colorama/METADATA.toml | 1 + stubs/colorama/colorama/win32.pyi | 2 ++ 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 stubs/colorama/@tests/stubtest_allowlist_linux.txt diff --git a/stubs/colorama/@tests/stubtest_allowlist.txt b/stubs/colorama/@tests/stubtest_allowlist.txt index e6c8d6cd4..4eb2e3c1f 100644 --- a/stubs/colorama/@tests/stubtest_allowlist.txt +++ b/stubs/colorama/@tests/stubtest_allowlist.txt @@ -44,13 +44,6 @@ colorama.initialise.wrapped_stdout # These are re-exports that are implementation detail: colorama.ansitowin32.BEL -colorama.ansitowin32.windll -colorama.winterm.get_osfhandle - -# These are only available on Windows: -colorama.winterm.WinColor -colorama.winterm.WinStyle -colorama.winterm.WinTerm # Not planning on writing stubs for tests: colorama.tests.* diff --git a/stubs/colorama/@tests/stubtest_allowlist_linux.txt b/stubs/colorama/@tests/stubtest_allowlist_linux.txt new file mode 100644 index 000000000..7ecdad633 --- /dev/null +++ b/stubs/colorama/@tests/stubtest_allowlist_linux.txt @@ -0,0 +1,8 @@ +# These are only available on Windows: +colorama.winterm.WinColor +colorama.winterm.WinStyle +colorama.winterm.WinTerm + +# These are re-exports that are implementation detail: +colorama.ansitowin32.windll +colorama.winterm.get_osfhandle diff --git a/stubs/colorama/METADATA.toml b/stubs/colorama/METADATA.toml index de6579f75..6b4e7247c 100644 --- a/stubs/colorama/METADATA.toml +++ b/stubs/colorama/METADATA.toml @@ -2,3 +2,4 @@ version = "0.4.*" [tool.stubtest] ignore_missing_stub = false +platforms = ["win32", "linux"] diff --git a/stubs/colorama/colorama/win32.pyi b/stubs/colorama/colorama/win32.pyi index 59d1601e5..38825fa70 100644 --- a/stubs/colorama/colorama/win32.pyi +++ b/stubs/colorama/colorama/win32.pyi @@ -25,6 +25,8 @@ if sys.platform == "win32": def FillConsoleOutputCharacter(stream_id: int, char: str, length: int, start: COORD) -> int: ... def FillConsoleOutputAttribute(stream_id: int, attr: int, length: int, start: COORD) -> wintypes.BOOL: ... def SetConsoleTitle(title: str) -> wintypes.BOOL: ... + def GetConsoleMode(handle: int) -> int: ... + def SetConsoleMode(handle: int, mode: int) -> None: ... else: windll: None