From 99a3cb00d6d77b438ee217fadb367ccf4989daf5 Mon Sep 17 00:00:00 2001 From: Mladen Milankovic Date: Fri, 30 Oct 2026 15:09:49 +0100 Subject: [PATCH] Bundle py_ecc metadata and pyunormalize tables in the frozen build py_ecc 7 and later read their version from the package metadata when imported, so the executable needs the dist-info; hooks-contrib before 2026.8 has no hook that copies it, and info on a card then crashed with "No package metadata was found for py_ecc". pyunormalize 18 loads its Unicode tables with importlib.import_module, which the analysis cannot follow, so they are collected explicitly. The six hidden import is dropped: nothing installs or imports it any more. Co-Authored-By: Claude Fable 5.1 --- setup.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.spec b/setup.spec index 59d8830..cc45517 100644 --- a/setup.spec +++ b/setup.spec @@ -2,7 +2,7 @@ import os import sys -from PyInstaller.utils.hooks import collect_all +from PyInstaller.utils.hooks import collect_all, collect_submodules, copy_metadata # Collect all submodules, data files, and binaries from cryptnox_sdk_py sdk_datas, sdk_binaries, sdk_hiddenimports = collect_all('cryptnox_sdk_py') @@ -15,9 +15,11 @@ a = Analysis( # Only include non-Python data files ('cryptnox_cli\\contract_abi\\*.json', 'cryptnox_cli\\contract_abi'), ('cryptnox_cli\\lib\\cryptos\\english.txt', 'cryptnox_cli\\lib\\cryptos') - ] + sdk_datas, - hiddenimports=sdk_hiddenimports + [ - 'six', + ] + sdk_datas + # py_ecc reads its version from its metadata; hooks-contrib before 2026.8 has no hook for it + + copy_metadata('py_ecc'), + # pyunormalize 18 loads its tables by computed name, so the analysis does not see them + hiddenimports=sdk_hiddenimports + collect_submodules('pyunormalize') + [ 'winsdk', 'winsdk.windows', 'winsdk.windows.security.credentials',