aboutsummaryrefslogtreecommitdiffstats
path: root/pyinst.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2023-02-09 01:12:08 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2023-02-09 01:46:56 +0530
commitacb1042a9ffa8769fe691beac1011d6da1fcf321 (patch)
treed3ff03d3a3c04dcda0316537f87e08e060b7b2db /pyinst.py
parentf40e32fb1ac67be5bdbc8e32a3c235abfc4be260 (diff)
downloadhypervideo-pre-acb1042a9ffa8769fe691beac1011d6da1fcf321.tar.lz
hypervideo-pre-acb1042a9ffa8769fe691beac1011d6da1fcf321.tar.xz
hypervideo-pre-acb1042a9ffa8769fe691beac1011d6da1fcf321.zip
[devscripts] Provide pyinstaller hooks
Closes #6185
Diffstat (limited to 'pyinst.py')
-rw-r--r--pyinst.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/pyinst.py b/pyinst.py
index 17c950563..22df672c9 100644
--- a/pyinst.py
+++ b/pyinst.py
@@ -37,7 +37,7 @@ def main():
'--icon=devscripts/logo.ico',
'--upx-exclude=vcruntime140.dll',
'--noconfirm',
- *dependency_options(),
+ '--additional-hooks-dir=yt_dlp/__pyinstaller',
*opts,
'yt_dlp/__main__.py',
]
@@ -77,30 +77,6 @@ def version_to_list(version):
return list(map(int, version_list)) + [0] * (4 - len(version_list))
-def dependency_options():
- # Due to the current implementation, these are auto-detected, but explicitly add them just in case
- dependencies = [pycryptodome_module(), 'mutagen', 'brotli', 'certifi', 'websockets']
- excluded_modules = ('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins', 'devscripts')
-
- yield from (f'--hidden-import={module}' for module in dependencies)
- yield '--collect-submodules=websockets'
- yield from (f'--exclude-module={module}' for module in excluded_modules)
-
-
-def pycryptodome_module():
- try:
- import Cryptodome # noqa: F401
- except ImportError:
- try:
- import Crypto # noqa: F401
- print('WARNING: Using Crypto since Cryptodome is not available. '
- 'Install with: pip install pycryptodomex', file=sys.stderr)
- return 'Crypto'
- except ImportError:
- pass
- return 'Cryptodome'
-
-
def set_version_info(exe, version):
if OS_NAME == 'win32':
windows_set_version(exe, version)