hook-scipy.py 1.3 KB

123456789101112131415161718192021222324252627282930
  1. # -----------------------------------------------------------------------------
  2. # Copyright (c) 2013-2021, PyInstaller Development Team.
  3. #
  4. # Distributed under the terms of the GNU General Public License (version 2
  5. # or later) with exception for distributing the bootloader.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10. # -----------------------------------------------------------------------------
  11. import glob
  12. import os
  13. from PyInstaller.compat import is_win
  14. from PyInstaller.utils.hooks import get_module_file_attribute
  15. binaries = []
  16. # Package the DLL bundle that official scipy wheels for Windows ship The DLL bundle will either be in extra-dll on
  17. # windows proper and in .libs if installed on a virtualenv created from MinGW (Git-Bash for example)
  18. if is_win:
  19. extra_dll_locations = ['extra-dll', '.libs']
  20. for location in extra_dll_locations:
  21. dll_glob = os.path.join(os.path.dirname(get_module_file_attribute('scipy')), location, "*.dll")
  22. if glob.glob(dll_glob):
  23. binaries.append((dll_glob, "."))
  24. # collect library-wide utility extension modules
  25. hiddenimports = ['scipy._lib.%s' % m for m in ['messagestream', "_ccallback_c", "_fpumode"]]