From 3ca30e2edaf7a3eec2674e48d70eb5656892a7f1 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 11 Nov 2022 23:34:47 -0500 Subject: [PATCH 1/3] Run stubtest windows on colorama --- 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 e6c8d6cd46d2..4eb2e3c1f6cb 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 000000000000..7ecdad633a12 --- /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 de6579f75d05..6b4e7247cda2 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 59d1601e52d2..38825fa70863 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 From 1cf0f576e23a4553a401bca54b42f9ec380680e2 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 12 Nov 2022 14:39:56 -0500 Subject: [PATCH 2/3] CI test --- stubs/colorama/colorama/win32.pyi | 2 -- 1 file changed, 2 deletions(-) diff --git a/stubs/colorama/colorama/win32.pyi b/stubs/colorama/colorama/win32.pyi index 38825fa70863..59d1601e52d2 100644 --- a/stubs/colorama/colorama/win32.pyi +++ b/stubs/colorama/colorama/win32.pyi @@ -25,8 +25,6 @@ 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 From af0adf121ff918672a287ef785e1e576be6797d0 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sat, 12 Nov 2022 21:58:46 +0200 Subject: [PATCH 3/3] Revert "CI test" This reverts commit 1cf0f576e23a4553a401bca54b42f9ec380680e2. --- stubs/colorama/colorama/win32.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/colorama/colorama/win32.pyi b/stubs/colorama/colorama/win32.pyi index 59d1601e52d2..38825fa70863 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