hook-markdown.py 957 B

12345678910111213141516171819202122232425262728
  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. from PyInstaller.utils.hooks import (
  13. collect_submodules,
  14. copy_metadata,
  15. is_module_satisfies,
  16. )
  17. hiddenimports = collect_submodules('markdown.extensions')
  18. # Markdown 3.3 introduced markdown.htmlparser submodule with hidden
  19. # dependency on html.parser
  20. if is_module_satisfies("markdown >= 3.3"):
  21. hiddenimports += ['html.parser']
  22. # Extensions can be referenced by short names, e.g. "extra", through a mechanism
  23. # using entry-points. Thus we need to collect the package metadata as well.
  24. datas = copy_metadata("markdown")