Skip to content

Commit

Permalink
hooks: sudachipy: add hiddenimports for v0.6.8
Browse files Browse the repository at this point in the history
`sudachipy˙ 0.6.8 added `sudachipy.config` and `sudachipy.errors`
modules, which are referenced from the binary extension.
  • Loading branch information
rokm committed Dec 18, 2023
1 parent 97800ab commit 6cb34e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/673.update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ``sudachipy`` hook for ``sudachipy`` 0.6.8.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import can_import_module, collect_data_files
from PyInstaller.utils.hooks import can_import_module, collect_data_files, is_module_satisfies

datas = collect_data_files('sudachipy')
hiddenimports = []

# In v0.6.8, `sudachipy.config` and `sudachipy.errors` modules were added, and are referenced from binary extension.
if is_module_satisfies('sudachipy >= 0.6.8'):
hiddenimports += [
'sudachipy.config',
'sudachipy.errors',
]

# Check which types of dictionary are installed
for sudachi_dict in ['sudachidict_small', 'sudachidict_core', 'sudachidict_full']:
if can_import_module(sudachi_dict):
Expand Down

0 comments on commit 6cb34e6

Please sign in to comment.