hook-kivy.py 1.1 KB

123456789101112131415161718192021222324252627
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2015-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. from PyInstaller.utils.hooks import is_module_satisfies
  12. from PyInstaller import log as logging
  13. if is_module_satisfies('kivy >= 1.9.1'):
  14. from kivy.tools.packaging.pyinstaller_hooks import (
  15. add_dep_paths, excludedimports, datas, get_deps_all,
  16. get_factory_modules, kivy_modules)
  17. add_dep_paths()
  18. hiddenimports = get_deps_all()['hiddenimports']
  19. hiddenimports = list(set(get_factory_modules() + kivy_modules +
  20. hiddenimports))
  21. else:
  22. logger = logging.getLogger(__name__)
  23. logger.warning('Hook disabled because of Kivy version < 1.9.1')