From 7ab56be2c7309a2d11d4ee28c71f8fb29da21ef7 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 26 Apr 2022 15:11:01 +0530 Subject: [PATCH] [build] Ensure `compat._legacy` is packed in executables Fixes https://github.com/yt-dlp/yt-dlp/commit/9196cbfe8bb7a6eb46037735b76f21963dfdc61a#commitcomment-72192406 --- pyinst.py | 1 + setup.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pyinst.py b/pyinst.py index 9e8128e09..c63d879a0 100644 --- a/pyinst.py +++ b/pyinst.py @@ -47,6 +47,7 @@ def main(): '--noconfirm', *dependency_options(), *opts, + '--collect-submodules=yt_dlp', 'yt_dlp/__main__.py', ] print(f'Running PyInstaller with {opts}') diff --git a/setup.py b/setup.py index 45f4d6b49..141cb238f 100644 --- a/setup.py +++ b/setup.py @@ -48,6 +48,8 @@ if sys.argv[1:2] == ['py2exe']: 'dist_dir': './dist', 'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'], + # Modules that are only imported dynamically must be added here + 'includes': ['yt_dlp.compat._legacy'], } }, 'zipfile': None