Skip to content

Commit 2b5d8ea

Browse files
authored
Update sklearn.neighbors hook to account for removed hidden import (#698)
Update hidden imports in `sklearn.neighbors` hook to account for the removal of `sklearn.neighbors._typedefs` module in `scikit-learn` >= 1.0.2.
1 parent e8db76b commit 2b5d8ea

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

news/698.update.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update the hook for ``sklearn.neighbors`` to account for removed hidden import ``neighbors._typedef``

src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sklearn.neighbors.py

100644100755
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@
1414

1515
hiddenimports = []
1616

17-
if is_module_satisfies("scikit_learn >= 0.22"):
18-
# 0.22 and later
17+
if is_module_satisfies("scikit_learn > 1.0.1"):
18+
# 1.0.2 and later
1919
hiddenimports += [
20-
'sklearn.neighbors._typedefs',
2120
'sklearn.neighbors._quad_tree',
2221
]
23-
else:
24-
# 0.21
22+
elif is_module_satisfies("scikit_learn < 0.22 "):
23+
# 0.21 and below
2524
hiddenimports += [
2625
'sklearn.neighbors.typedefs',
2726
'sklearn.neighbors.quad_tree',
2827
]
28+
else:
29+
# between and including 0.22 and 1.0.1
30+
hiddenimports += [
31+
'sklearn.neighbors._typedefs',
32+
'sklearn.neighbors._quad_tree',
33+
]
2934

3035
# The following hidden import must be added here
3136
# (as opposed to sklearn.tree)

0 commit comments

Comments
 (0)