hook-skimage.transform.py 1.1 KB

123456789101112131415161718192021222324
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2020 PyInstaller Development Team.
  3. #
  4. # This file is distributed under the terms of the GNU General Public
  5. # License (version 2.0 or later).
  6. #
  7. # The full license is available in LICENSE, distributed with
  8. # this software.
  9. #
  10. # SPDX-License-Identifier: GPL-2.0-or-later
  11. # ------------------------------------------------------------------
  12. from PyInstaller.utils.hooks import is_module_satisfies, collect_data_files, collect_submodules
  13. # Hook tested with scikit-image (skimage) 0.9.3 on Mac OS 10.9 and Windows 7 64-bit
  14. hiddenimports = ['skimage.draw.draw',
  15. 'skimage._shared.geometry',
  16. 'skimage._shared.transform',
  17. 'skimage.filters.rank.core_cy']
  18. # As of scikit-image 0.22.0, we need to collect the __init__.pyi file for `lazy_loader`, as well as collect submodules
  19. # due to lazy loading.
  20. if is_module_satisfies("scikit-image >= 0.22.0"):
  21. datas = collect_data_files("skimage.transform", includes=["*.pyi"])
  22. hiddenimports += collect_submodules('skimage.transform', filter=lambda name: name != 'skimage.transform.tests')