hook-kivy.py 1.1 KB

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