build_runner.sh 967 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. # 在 Linux/macOS + Python 3.11 环境下,将 runner.py 编译为独立可执行文件
  3. set -euo pipefail
  4. cd "$(dirname "$0")"
  5. python3 -m pip install -r requirements.txt
  6. rm -rf runner.dist runner.build
  7. export NUITKA_CACHE_DIR="${TMPDIR:-/tmp}/nuitka-cache"
  8. python3 -m nuitka runner.py \
  9. --standalone \
  10. --jobs=1 \
  11. --lto=no \
  12. --assume-yes-for-downloads \
  13. --output-filename=api_runner \
  14. --include-package=cryptography \
  15. --include-package=numpy \
  16. --include-package=pandas \
  17. --include-package=scipy \
  18. --include-package=matplotlib \
  19. --enable-plugin=matplotlib \
  20. --include-module=numpy.testing \
  21. --nofollow-import-to=tkinter \
  22. --nofollow-import-to=matplotlib.tests \
  23. --nofollow-import-to=pandas.tests \
  24. --nofollow-import-to=scipy.tests \
  25. --include-data-files=entry*.so=entry*.so \
  26. --include-data-files=license.lic=license.lic \
  27. --include-data-files=public_key.pem=public_key.pem
  28. echo "编译完成: api_runner"