Skip to content

Commit

Permalink
Add hook for patoolib
Browse files Browse the repository at this point in the history
  • Loading branch information
mtayeldev committed May 21, 2024
1 parent 6fc0361 commit 2a6b675
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ opentelemetry-sdk==1.24.0
xarray==2024.5.0; python_version >= '3.9'
tables==3.9.2; python_version >= '3.9'
schwifty==2024.5.3
patool==2.2.0

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

Expand Down
16 changes: 16 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-patoolib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#-----------------------------------------------------------------------------
# Copyright (c) 2017-2024, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------


"""
patoolib uses importlib and pyinstaller doesn't find it and add it to the list of needed modules
"""

from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('patoolib.programs')
11 changes: 11 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2097,3 +2097,14 @@ async def main():
asyncio.run(main())
""")


@importorskip('patoolib')
def test_patoolib(pyi_builder):
pyi_builder.test_source("""
import patoolib
patoolib.is_archive(".")
""")

0 comments on commit 2a6b675

Please sign in to comment.