Skip to content

Commit 2994467

Browse files
committed
hooks: update scikit-image hooks for compatibility with version 0.21.0
Add hooks for sub-packages that are now using `lazy_loader`; we need to collect the `__init__.pyi` and all submodules.
1 parent 7054833 commit 2994467

File tree

6 files changed

+78
-1
lines changed

6 files changed

+78
-1
lines changed

news/594.update.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update ``scikit-image`` hooks for compatibility with version 0.21.0.

requirements-test-libraries.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ exchangelib==5.0.3
124124
NBT==1.5.1
125125
minecraft-launcher-lib==5.3; python_version >= '3.8'
126126
scikit-learn==1.2.2; python_version >= '3.8'
127-
scikit-image==0.20.0; python_version >= '3.8'
127+
scikit-image==0.21.0; python_version >= '3.8'
128128
customtkinter==5.1.3
129129
fastparquet==2023.4.0; python_version >= '3.8'
130130
librosa==0.10.0.post2
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------------------------------------
2+
# Copyright (c) 2023 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.GPL.txt, distributed with
8+
# this software.
9+
#
10+
# SPDX-License-Identifier: GPL-2.0-or-later
11+
# ------------------------------------------------------------------
12+
13+
from PyInstaller.utils.hooks import is_module_satisfies, collect_data_files, collect_submodules
14+
15+
# As of scikit-image 0.21.0, we need to collect the __init__.pyi file for `lazy_loader`, as well as collect submodules
16+
# due to lazy loading.
17+
if is_module_satisfies("scikit-image >= 0.21.0"):
18+
datas = collect_data_files("skimage.color", includes=["*.pyi"])
19+
hiddenimports = collect_submodules('skimage.color', filter=lambda name: name != 'skimage.color.tests')
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------------------------------------
2+
# Copyright (c) 2023 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.GPL.txt, distributed with
8+
# this software.
9+
#
10+
# SPDX-License-Identifier: GPL-2.0-or-later
11+
# ------------------------------------------------------------------
12+
13+
from PyInstaller.utils.hooks import is_module_satisfies, collect_data_files, collect_submodules
14+
15+
# As of scikit-image 0.21.0, we need to collect the __init__.pyi file for `lazy_loader`, as well as collect submodules
16+
# due to lazy loading.
17+
if is_module_satisfies("scikit-image >= 0.21.0"):
18+
datas = collect_data_files("skimage.draw", includes=["*.pyi"])
19+
hiddenimports = collect_submodules('skimage.draw', filter=lambda name: name != 'skimage.draw.tests')
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------------------------------------
2+
# Copyright (c) 2023 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.GPL.txt, distributed with
8+
# this software.
9+
#
10+
# SPDX-License-Identifier: GPL-2.0-or-later
11+
# ------------------------------------------------------------------
12+
13+
from PyInstaller.utils.hooks import is_module_satisfies, collect_data_files, collect_submodules
14+
15+
# As of scikit-image 0.21.0, we need to collect the __init__.pyi file for `lazy_loader`, as well as collect submodules
16+
# due to lazy loading.
17+
if is_module_satisfies("scikit-image >= 0.21.0"):
18+
datas = collect_data_files("skimage.exposure", includes=["*.pyi"])
19+
hiddenimports = collect_submodules('skimage.exposure', filter=lambda name: name != 'skimage.exposure.tests')
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------------------------------------
2+
# Copyright (c) 2023 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.GPL.txt, distributed with
8+
# this software.
9+
#
10+
# SPDX-License-Identifier: GPL-2.0-or-later
11+
# ------------------------------------------------------------------
12+
13+
from PyInstaller.utils.hooks import is_module_satisfies, collect_data_files, collect_submodules
14+
15+
# As of scikit-image 0.21.0, we need to collect the __init__.pyi file for `lazy_loader`, as well as collect submodules
16+
# due to lazy loading.
17+
if is_module_satisfies("scikit-image >= 0.21.0"):
18+
datas = collect_data_files("skimage.future", includes=["*.pyi"])
19+
hiddenimports = collect_submodules('skimage.future', filter=lambda name: name != 'skimage.future.tests')

0 commit comments

Comments
 (0)