diff --git a/news/29.new.rst b/news/29.new.rst new file mode 100644 index 00000000..1b8f831a --- /dev/null +++ b/news/29.new.rst @@ -0,0 +1 @@ +Add a hook for ``pyav(av)`` which has hidden imports. diff --git a/requirements-test.txt b/requirements-test.txt index 162af11b..dacdf68d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -31,6 +31,7 @@ pyzmq==19.0.0 Unidecode==1.1.1 zeep==3.4.0 sentry-sdk==0.15.1 +av==8.0.2 # ------------------- Python Version/Platform (OS) specifics # These libraries only support python above 3.5 diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-av.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-av.py new file mode 100644 index 00000000..493c353e --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-av.py @@ -0,0 +1,14 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2020 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_submodules + +hiddenimports = ['fractions'] + collect_submodules("av") diff --git a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py index 4e8eecb8..591835a8 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py @@ -303,3 +303,10 @@ def test_iminuit(pyi_builder): pyi_builder.test_source(""" from iminuit import Minuit """) + + +@importorskip('av') +def test_av(pyi_builder): + pyi_builder.test_source(""" + import av + """)