sync_python_deps.bat 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @echo off
  2. setlocal EnableExtensions
  3. pushd "%~dp0"
  4. echo Sync Python runtime deps to runner.dist (skip full Nuitka rebuild) ...
  5. if not exist "runner.dist\api_runner.exe" (
  6. echo ERROR: runner.dist\api_runner.exe not found.
  7. echo Run build_runner.bat once first, then use this for dependency updates.
  8. popd
  9. exit /b 1
  10. )
  11. where py >nul 2>&1
  12. if %errorlevel%==0 (
  13. set "PYTHON=py -3.11"
  14. ) else (
  15. set "PYTHON=python"
  16. )
  17. for /f "delims=" %%i in ('%PYTHON% -c "import site; print(site.getsitepackages()[0])"') do set "SITE=%%i"
  18. if not exist "%SITE%\sympy" (
  19. echo ERROR: sympy not installed. Run: python -m pip install -r requirements.txt
  20. popd
  21. exit /b 1
  22. )
  23. echo Copy sympy from %SITE% ...
  24. xcopy /E /I /Y /Q "%SITE%\sympy" "runner.dist\sympy\" >nul
  25. if exist "%SITE%\sympy-*.dist-info" (
  26. for /d %%d in ("%SITE%\sympy-*.dist-info") do xcopy /E /I /Y /Q "%%d" "runner.dist\%%~nxd\" >nul
  27. )
  28. if exist "%SITE%\mpmath" (
  29. echo Copy mpmath ...
  30. xcopy /E /I /Y /Q "%SITE%\mpmath" "runner.dist\mpmath\" >nul
  31. if exist "%SITE%\mpmath-*.dist-info" (
  32. for /d %%d in ("%SITE%\mpmath-*.dist-info") do xcopy /E /I /Y /Q "%%d" "runner.dist\%%~nxd\" >nul
  33. )
  34. )
  35. echo SUCCESS: sympy/mpmath synced to runner.dist
  36. echo Offline runtime ready. Next: npm run electron:build
  37. popd
  38. exit /b 0
  39. endlocal