hook-setuptools.py 1.2 KB

12345678910111213141516171819202122232425262728
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2013-2021, PyInstaller Development Team.
  3. #
  4. # Distributed under the terms of the GNU General Public License (version 2
  5. # or later) with exception for distributing the bootloader.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10. #-----------------------------------------------------------------------------
  11. from PyInstaller.compat import is_darwin, is_unix
  12. from PyInstaller.utils.hooks import collect_submodules
  13. hiddenimports = [
  14. # Test case import/test_zipimport2 fails during importing pkg_resources or setuptools when module not present.
  15. 'distutils.command.build_ext',
  16. 'setuptools.msvc',
  17. ]
  18. # Necessary for setuptools on Mac/Unix
  19. if is_unix or is_darwin:
  20. hiddenimports.append('syslog')
  21. # setuptools >= 39.0.0 is "vendoring" its own direct dependencies from "_vendor" to "extern". This also requires
  22. # 'pre_safe_import_module/hook-setuptools.extern.six.moves.py' to make the moves defined in 'setuptools._vendor.six'
  23. # importable under 'setuptools.extern.six'.
  24. hiddenimports.extend(collect_submodules('setuptools._vendor'))