hook-setuptools.py 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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_unix, is_darwin
  12. from PyInstaller.utils.hooks import collect_submodules
  13. hiddenimports = [
  14. # Test case import/test_zipimport2 fails during importing
  15. # pkg_resources or setuptools when module not present.
  16. 'distutils.command.build_ext',
  17. 'setuptools.msvc',
  18. ]
  19. # Necessary for setuptools on Mac/Unix
  20. if is_unix or is_darwin:
  21. hiddenimports.append('syslog')
  22. # setuptools >= 39.0.0 is "vendoring" its own direct dependencies from
  23. # "_vendor" to "extern". This also requires
  24. # 'pre_safe_import_module/hook-setuptools.extern.six.moves.py' to make the
  25. # moves defined in 'setuptools._vendor.six' importable under
  26. # 'setuptools.extern.six'.
  27. hiddenimports.extend(collect_submodules('setuptools._vendor'))