hook-saml2.py 1.1 KB

12345678910111213141516171819202122232425
  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. # Hook for https://github.com/IdentityPython/pysaml2
  13. from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_submodules
  14. datas = copy_metadata("pysaml2")
  15. # The library contains a bunch of XSD schemas that are loaded by the code:
  16. # https://github.com/IdentityPython/pysaml2/blob/7cb4f09dce87a7e8098b9c7552ebab8bc77bc896/src/saml2/xml/schema/__init__.py#L23
  17. # On the other hand, runtime tools are not needed.
  18. datas += collect_data_files("saml2", excludes=["**/tools"])
  19. # Submodules are loaded dynamically by:
  20. # https://github.com/IdentityPython/pysaml2/blob/7cb4f09dce87a7e8098b9c7552ebab8bc77bc896/src/saml2/attribute_converter.py#L52
  21. hiddenimports = collect_submodules("saml2.attributemaps")