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>
44 lines
1.3 KiB
Batchfile
44 lines
1.3 KiB
Batchfile
@echo off
|
|
REM Build script for Windows with CUDA support (falls back to CPU if no GPU)
|
|
|
|
echo Building Local Transcription for Windows...
|
|
echo ==========================================
|
|
echo.
|
|
echo This build includes CUDA support and works on both GPU and CPU systems.
|
|
echo.
|
|
|
|
REM Clean previous builds
|
|
echo Cleaning previous builds...
|
|
if exist build rmdir /s /q build
|
|
if exist dist rmdir /s /q dist
|
|
|
|
REM Sync dependencies (uses PyTorch CUDA from pyproject.toml)
|
|
echo Installing dependencies with CUDA support...
|
|
uv sync
|
|
|
|
REM Build with PyInstaller
|
|
REM Note: enum34 is excluded in local-transcription.spec
|
|
echo Running PyInstaller...
|
|
uv run pyinstaller local-transcription.spec
|
|
|
|
REM Check if build succeeded
|
|
if exist "dist\LocalTranscription" (
|
|
echo.
|
|
echo Build successful!
|
|
echo Executable location: dist\LocalTranscription\LocalTranscription.exe
|
|
echo.
|
|
echo CUDA Support: YES (automatically falls back to CPU if no GPU detected^)
|
|
echo.
|
|
echo To run the application:
|
|
echo cd dist\LocalTranscription
|
|
echo LocalTranscription.exe
|
|
echo.
|
|
echo To create a distributable package:
|
|
echo - Install 7-Zip or WinRAR
|
|
echo - Compress the dist\LocalTranscription folder to a ZIP file
|
|
) else (
|
|
echo.
|
|
echo Build failed!
|
|
exit /b 1
|
|
)
|