hook-falcon.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2024 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.compat import is_py311
  13. from PyInstaller.utils.hooks import is_module_satisfies
  14. hiddenimports = [
  15. 'cgi',
  16. 'falcon.app_helpers',
  17. 'falcon.forwarded',
  18. 'falcon.media',
  19. 'falcon.request_helpers',
  20. 'falcon.responders',
  21. 'falcon.response_helpers',
  22. 'falcon.routing',
  23. 'falcon.vendor.mimeparse',
  24. 'falcon.vendor',
  25. 'uuid',
  26. 'xml.etree.ElementTree',
  27. 'xml.etree'
  28. ]
  29. # falcon v4.0.0 added couple of more cythonized modules that depend on the following stdlib modules.
  30. if is_module_satisfies('falcon >= 4.0.0'):
  31. hiddenimports += [
  32. 'dataclasses',
  33. 'json',
  34. ]
  35. # `wsgiref.types` is available (and thus referenced) only under python >= 3.11.
  36. if is_py311:
  37. hiddenimports += ['wsgiref.types']