Skip to content

Commit

Permalink
hooks: update scikit-image hooks for compatibility with 0.19.x series
Browse files Browse the repository at this point in the history
Update the `skimage.filters` hook to account for the lazy module
loading within this module.
  • Loading branch information
rokm committed Mar 31, 2023
1 parent ae6e7d3 commit 2a9eb40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions news/565.update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update ``scikit-image`` hooks for compatibility with the 0.19.x series;
account for lazy module loading in ``skimage.filters``.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import is_module_satisfies
from PyInstaller.utils.hooks import is_module_satisfies, collect_submodules

# The following missing module prevents import of skimage.feature
# with skimage 0.18.x.
if is_module_satisfies("scikit_image >= 0.18.0"):
if is_module_satisfies("scikit_image >= 0.19.0"):
# In scikit-image 0.19.0, `skimage.filters` switched to lazy module loading, so we need to collect all submodules.
hiddenimports = collect_submodules('skimage.filters', filter=lambda name: name != 'skimage.filters.tests')
elif is_module_satisfies("scikit_image >= 0.18.0"):
# The following missing module prevents import of skimage.feature with skimage 0.18.x.
hiddenimports = ['skimage.filters.rank.core_cy_3d', ]

0 comments on commit 2a9eb40

Please sign in to comment.