From 0140617b6ad544b04fd858f7735d62574530c110 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 15 Jun 2026 16:41:04 -0400 Subject: [PATCH 1/2] PyInstaller expose Splash._check_tcl_tk_compatibility --- .../pyinstaller/@tests/stubtest_allowlist.txt | 1 - .../PyInstaller/building/splash.pyi | 4 ++++ .../PyInstaller/utils/hooks/tcl_tk.pyi | 21 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi diff --git a/stubs/pyinstaller/@tests/stubtest_allowlist.txt b/stubs/pyinstaller/@tests/stubtest_allowlist.txt index 626c29c3ef15..f04987c54a02 100644 --- a/stubs/pyinstaller/@tests/stubtest_allowlist.txt +++ b/stubs/pyinstaller/@tests/stubtest_allowlist.txt @@ -43,7 +43,6 @@ PyInstaller.utils.hooks.django PyInstaller.utils.hooks.gi PyInstaller.utils.hooks.qt PyInstaller.utils.hooks.setuptools -PyInstaller.utils.hooks.tcl_tk PyInstaller.utils.misc PyInstaller.utils.osx PyInstaller.utils.run_tests diff --git a/stubs/pyinstaller/PyInstaller/building/splash.pyi b/stubs/pyinstaller/PyInstaller/building/splash.pyi index 506def4b1888..d7723bc76f53 100644 --- a/stubs/pyinstaller/PyInstaller/building/splash.pyi +++ b/stubs/pyinstaller/PyInstaller/building/splash.pyi @@ -1,6 +1,7 @@ from _typeshed import StrPath from PyInstaller.building.datastruct import Target, _TOCTuple +from PyInstaller.utils.hooks.tcl_tk import TclTkInfo # Referenced in https://pyinstaller.org/en/stable/spec-files.html#example-merge-spec-file # Not to be imported during runtime, but is the type reference for spec files which are executed as python code @@ -42,4 +43,7 @@ class Splash(Target): always_on_top: bool = True, ) -> None: ... def assemble(self) -> None: ... + # This private method is the only way to match Splash Screen support validation without triggering an actual build + @staticmethod + def _check_tcl_tk_compatibility(tcltk_info: TclTkInfo) -> None: ... def generate_script(self) -> str: ... diff --git a/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi b/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi new file mode 100644 index 000000000000..abfbc752b04a --- /dev/null +++ b/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi @@ -0,0 +1,21 @@ +from typing import Final + +class TclTkInfo: + TCL_ROOTNAME: Final = "_tcl_data" + TK_ROOTNAME: Final = "_tk_data" + def __init__(self) -> None: ... + def __getattr__(self, name): ... + available: bool + tkinter_extension_file: str | None + tcl_version: tuple[int, int] | None + tk_version: tuple[int, int] | None + tcl_threaded: bool + tcl_data_dir: str | None + tk_data_dir: str | None + tcl_module_dir: str | None + is_macos_system_framework: bool + tcl_shared_library: str | None + tk_shared_library: str | None + data_files: list[tuple[str, str, str]] + +tcltk_info: TclTkInfo From 3c4ab0df95eea1bb955adc7fb0efa57e31941170 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 15 Jun 2026 17:06:17 -0400 Subject: [PATCH 2/2] No `__getattr__`, we exposed all the possible values --- stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi b/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi index abfbc752b04a..1a3f196f8f02 100644 --- a/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi +++ b/stubs/pyinstaller/PyInstaller/utils/hooks/tcl_tk.pyi @@ -4,7 +4,6 @@ class TclTkInfo: TCL_ROOTNAME: Final = "_tcl_data" TK_ROOTNAME: Final = "_tk_data" def __init__(self) -> None: ... - def __getattr__(self, name): ... available: bool tkinter_extension_file: str | None tcl_version: tuple[int, int] | None