Fix enum34 error by excluding it in PyInstaller spec

The previous approach of uninstalling enum34 before PyInstaller didn't
work because 'uv run' re-syncs dependencies. The proper solution is to
exclude enum34 directly in the PyInstaller spec file.

Changes:
- Added hooks/hook-enum34.py: Custom PyInstaller hook to exclude enum34
- Updated local-transcription.spec:
  - Added 'hooks' to hookspath
  - Added 'enum34' to excludes list
- Updated build.sh and build.bat:
  - Removed enum34 uninstall step (no longer needed)
  - Added comment explaining enum34 is excluded in spec

Why this works:
- PyInstaller's excludes list prevents enum34 from being bundled
- The custom hook provides documentation and explicit exclusion
- enum34 can remain installed in venv (won't break anything)
- Works regardless of 'uv run' re-syncing dependencies

enum34 is an obsolete Python 2.7/3.3 backport that's incompatible with
PyInstaller and unnecessary on Python 3.4+ (enum is in stdlib).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-28 19:32:23 -08:00
parent aad7ab0713
commit 9b7f2e1d69
4 changed files with 14 additions and 10 deletions

10
hooks/hook-enum34.py Normal file
View File

@@ -0,0 +1,10 @@
"""
PyInstaller hook to exclude enum34.
enum34 is an obsolete backport of Python's enum module for Python 2.7 and 3.3.
It is incompatible with Python 3.4+ and PyInstaller.
Since we require Python 3.9+, enum is part of the stdlib and enum34 is not needed.
"""
# Exclude enum34 completely from the build
excludedimports = ['enum34']