Skip to content

Bundle py_ecc metadata and pyunormalize tables in the frozen build - #100

Merged
mmlado merged 1 commit into
mainfrom
fix/frozen-build-imports
Oct 30, 2026
Merged

mmlado merged 1 commit into
mainfrom
fix/frozen-build-imports

Conversation

@mmlado

@mmlado mmlado commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Three changes to setup.spec, the PyInstaller spec of the Windows executable:

  • copy_metadata('py_ecc') in datas. py_ecc 7 and later read their own version from the package metadata at import time (web3 → eth_account → eth_keyfile → py_ecc). A build with pyinstaller-hooks-contrib before 2026.8 has no hook for it, and info on a card then ends in the crash handler with No package metadata was found for py_ecc. dev-requirements.txt pins 2026.9, which has the hook; the entry makes the build independent of it.
  • collect_submodules('pyunormalize') in hiddenimports. pyunormalize 18 loads its eight Unicode table modules through importlib.import_module, so the analysis leaves them out and web3's ENS name handling would end in ModuleNotFoundError in the executable. No CLI argument reaches that path today, since addresses are checked to be hex first.
  • six removed from hiddenimports: no dependency installs it and nothing imports it; it only produced ERROR: Hidden import 'six' not found in every build.

Checked on Windows (main ea38046, Python 3.12, PyInstaller 6.11.1, hooks-contrib 2024.10): info on a card crashed as described, and ran with copy_metadata('py_ecc') added; that executable passed the card-less checks, the demo-card commands, the PIN prompt test in both consoles and the NSIS installer. Checked on Linux (PyInstaller 6.22.3, hooks-contrib 2026.9) with this spec: the eight pyunormalize._internal modules and py_ecc-8.0.0.dist-info are in the bundle, the only ERROR lines are the Windows-only winsdk imports, and the 15 card-less checks and the license-file check pass.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@mmlado
mmlado merged commit 6f12bf8 into main Oct 30, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant