hook-black.py 1.0 KB

1234567891011121314151617181920212223242526272829
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2025 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 collect_submodules, collect_data_files
  13. # These are all imported from cythonized extensions.
  14. hiddenimports = [
  15. 'json',
  16. 'platform',
  17. 'click',
  18. 'mypy_extensions',
  19. 'pathspec',
  20. '_black_version',
  21. 'platformdirs',
  22. *collect_submodules('black'),
  23. # blib2to3.pytree, blib2to3.pygen, various submodules from blib2to3.pgen2; best to just collect all submodules.
  24. *collect_submodules('blib2to3'),
  25. ]
  26. # Ensure that `black/resources/black.schema.json` is collected, in case someone tries to call `black.schema.get_schema`.
  27. datas = collect_data_files('black')