hook-IPython.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2020 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. # Tested with IPython 4.0.0.
  13. from PyInstaller.compat import is_win, is_darwin
  14. from PyInstaller.utils.hooks import collect_data_files
  15. # Ignore 'matplotlib'. IPython contains support for matplotlib.
  16. # Ignore GUI libraries. IPython supports integration with GUI frameworks.
  17. # Assume that it will be imported by any other module when the user really
  18. # uses it.
  19. excludedimports = [
  20. 'gtk',
  21. 'matplotlib',
  22. 'PySide',
  23. 'PyQt4',
  24. 'PySide2',
  25. 'PyQt5',
  26. 'PySide6',
  27. 'PyQt6',
  28. ]
  29. # IPython uses 'tkinter' for clipboard access on Linux/Unix. Exclude it on Windows and OS X.
  30. if is_win or is_darwin:
  31. excludedimports.append('tkinter')
  32. datas = collect_data_files('IPython')
  33. # IPython imports extensions by changing to the extensions directory and using
  34. # importlib.import_module, so we need to copy over the extensions as if they
  35. # were data files.
  36. datas += collect_data_files('IPython.extensions', include_py_files=True)