From 077e1a97c1996b6ad8e65b3390b77868a0117300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 2 May 2026 14:07:48 +0200 Subject: [PATCH] Update PyInstaller spec for the new package layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Drop the now-obsolete src/lib and src/py_func data entries (those paths no longer exist) - Add src/testium/py_func and src/testium/runtime as bundle-root data dirs: the py_func subprocess is launched with the *host* Python (not the frozen interpreter), so it needs the source files on disk at cwd=subproc_path() to find py_func/__main__.py and import from runtime.* - Hidden imports updated: libs.* → api.*, plus py_func.* explicitly declared so PyInstaller pulls them into the bundle even though they are loaded as data Smoke-tested: built binary runs `testium -b`, py_func subprocess works. Co-Authored-By: Claude Opus 4.7 --- package/pyinstaller/testium.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/pyinstaller/testium.spec b/package/pyinstaller/testium.spec index b330b66..f33d90d 100644 --- a/package/pyinstaller/testium.spec +++ b/package/pyinstaller/testium.spec @@ -5,8 +5,14 @@ a = Analysis( pathex=['../../src/testium', '../../src/testium/main_win/resources'], binaries=[], + # py_func/ and runtime/ are bundled at the _MEIPASS root because the + # py_func subprocess is launched with the *host* Python (not the + # frozen interpreter): it needs the source files on disk to find them + # via cwd=subproc_path() and `python3 py_func` + `from runtime.*`. datas=[('../../src/VERSION', '.'), - ('../../src/testium/lua_func', 'lua_func')], + ('../../src/testium/lua_func', 'lua_func'), + ('../../src/testium/py_func', 'py_func'), + ('../../src/testium/runtime', 'runtime')], hiddenimports=["git", "interpreter", "main_win",