Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hooks: add hook for khmer-nltk and python-crfsuite #633

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/633.new.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``python-crfsuite``.
1 change: 1 addition & 0 deletions news/633.new.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``khmer-nltk``.
2 changes: 2 additions & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ simplemma==0.9.1
wordcloud==1.9.2
eng-to-ipa==0.0.2
python-mecab-ko==1.3.3
khmer-nltk==1.5
python-crfsuite==0.9.9

# ------------------- Platform (OS) specifics

Expand Down
16 changes: 16 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-khmernltk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 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 collect_data_files

datas = collect_data_files('khmernltk')
hiddenimports = ['sklearn_crfsuite']
13 changes: 13 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pycrfsuite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 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
# ------------------------------------------------------------------

hiddenimports = ['pycrfsuite._dumpparser', 'pycrfsuite._logparser', 'tempfile']
14 changes: 14 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1789,3 +1789,17 @@ def test_mecab(pyi_builder):

mecab.MeCab()
""")


@importorskip('khmernltk')
def test_khmernltk(pyi_builder):
pyi_builder.test_source("""
import khmernltk
""")


@importorskip('pycrfsuite')
def test_pycrfsuite(pyi_builder):
pyi_builder.test_source("""
import pycrfsuite
""")
Loading