hook-blib2to3.py 1.0 KB

1234567891011121314151617181920212223242526
  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. from _pyinstaller_hooks_contrib.utils.mypy import find_mypyc_module_for_dist
  14. hiddenimports = [
  15. # `black` (or rather, its `blib2to3` library) uses `mypy`, and includes a top-level module with
  16. # dynamically-generated name prefix; for example, `30fcd23745efe32ce681__mypyc`.
  17. *find_mypyc_module_for_dist('black'),
  18. 'dataclasses',
  19. 'pkgutil',
  20. 'tempfile',
  21. *collect_submodules('blib2to3')
  22. ]
  23. # Ensure that data files, such as `PatternGrammar.txt` and `Grammar.txt`, are collected.
  24. datas = collect_data_files('blib2to3')