Skip to content

Commit

Permalink
hooks: update imageio_ffmpeg hook for compatibility with imageio-ffmp…
Browse files Browse the repository at this point in the history
…eg >= 0.5.0

Starting with imageio-ffmpeg 0.5.0, `imageio_ffmpeg.binaries` is
a package that is acccessed via `importlib.resources`. Since it is
not directly imported anywhere, we need to add it to hidden imports.
  • Loading branch information
rokm committed Jul 18, 2024

Unverified

This user has not yet uploaded their public signing key.
1 parent e5ff5d0 commit 8670c21
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion _pyinstaller_hooks_contrib/stdhooks/hook-imageio_ffmpeg.py
Original file line number Diff line number Diff line change
@@ -12,6 +12,11 @@

# Hook for imageio: http://imageio.github.io/

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

datas = collect_data_files('imageio_ffmpeg', subdir="binaries")

# Starting with imageio_ffmpeg 0.5.0, `imageio_ffmpeg.binaries` is a package accessed via `importlib.resources`. Since
# it is not directly imported anywhere, we need to add it to hidden imports.
if is_module_satisfies('imageio_ffmpeg >= 0.5.0'):
hiddenimports = ['imageio_ffmpeg.binaries']
2 changes: 2 additions & 0 deletions news/766.update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update ``imageio_ffmpeg`` hook for compatibility with ``imageio-ffmpeg``
0.5.0 and later.

0 comments on commit 8670c21

Please # to comment.