From 1649c5e412e02f5ebee4c542093064c8ba1c96bb Mon Sep 17 00:00:00 2001 From: Rok Mandeljc Date: Fri, 9 Apr 2021 13:52:55 +0200 Subject: [PATCH] hooks: update scikit-learn hooks for compatibility with 0.24.x series --- news/108.update.rst | 1 + .../stdhooks/hook-sklearn.linear_model.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 news/108.update.rst create mode 100644 src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sklearn.linear_model.py diff --git a/news/108.update.rst b/news/108.update.rst new file mode 100644 index 00000000..ea308a3a --- /dev/null +++ b/news/108.update.rst @@ -0,0 +1 @@ +Update ``scikit-learn`` hooks for compatibility with 0.24.x series. diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sklearn.linear_model.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sklearn.linear_model.py new file mode 100644 index 00000000..b3abf1a7 --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sklearn.linear_model.py @@ -0,0 +1,18 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2021 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +from PyInstaller.utils.hooks import is_module_satisfies + +# sklearn.linear_model in scikit-learn 0.24.x has a hidden import of +# sklearn.utils._weight_vector +if is_module_satisfies("sklearn >= 0.24"): + hiddenimports = ['sklearn.utils._weight_vector', ]