hook-sklearn.metrics.cluster.py 1.0 KB

123456789101112131415161718192021222324252627
  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. # Required by scikit-learn 0.21
  13. from PyInstaller.utils.hooks import is_module_satisfies
  14. if is_module_satisfies("scikit-learn < 0.22"):
  15. hiddenimports = [
  16. 'sklearn.utils.lgamma',
  17. 'sklearn.utils.weight_vector'
  18. ]
  19. else:
  20. # lgamma was removed and weight_vector privatised in 0.22.
  21. # https://github.com/scikit-learn/scikit-learn/commit/58be9a671b0b8fcb4b75f4ae99f4469ca33a2158#diff-dbca16040fd2b85a499ba59833b37f1785c58e52d2e89ce5cdfc7fff164bd5f3
  22. # https://github.com/scikit-learn/scikit-learn/commit/150e82b52bf28c88c5a8b1a10f9777d0452b3ef2
  23. hiddenimports = [
  24. 'sklearn.utils._weight_vector'
  25. ]