hook-librosa.py 1.2 KB

12345678910111213141516171819202122232425
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2023 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_data_files, collect_submodules
  13. # Collect all data files from the package. These include:
  14. # - package's and subpackages' .pyi files for `lazy_loader`
  15. # - example data in librosa/util, required by `librosa.util.files`
  16. # - librosa/core/intervals.msgpack, required by `librosa.core.intervals`
  17. #
  18. # We explicitly exclude `__pycache__` because it might contain .nbi and .nbc files from `numba` cache, which are not
  19. # re-used by `numba` codepaths in the frozen application and are instead re-compiled in user-global cache directory.
  20. datas = collect_data_files("librosa", excludes=['**/__pycache__'])
  21. # And because modules are lazily loaded, we need to collect them all.
  22. hiddenimports = collect_submodules("librosa")