]> jfr.im git - yt-dlp.git/blobdiff - pyinst.py
[compat_utils] Improve `passthrough_module`
[yt-dlp.git] / pyinst.py
index 9be5d896041fde0980b470cea5f29d70364744c2..17c95056303cd422ac7f554be07861134f87877a 100644 (file)
--- a/pyinst.py
+++ b/pyinst.py
@@ -12,9 +12,8 @@
 
 from devscripts.utils import read_version
 
-OS_NAME, MACHINE, ARCH = sys.platform, platform.machine(), platform.architecture()[0][:2]
-if MACHINE in ('x86_64', 'AMD64') or ('i' in MACHINE and '86' in MACHINE):
-    # NB: Windows x86 has MACHINE = AMD64 irrespective of bitness
+OS_NAME, MACHINE, ARCH = sys.platform, platform.machine().lower(), platform.architecture()[0][:2]
+if MACHINE in ('x86', 'x86_64', 'amd64', 'i386', 'i686'):
     MACHINE = 'x86' if ARCH == '32' else ''
 
 
@@ -63,7 +62,7 @@ def exe(onedir):
     name = '_'.join(filter(None, (
         'yt-dlp',
         {'win32': '', 'darwin': 'macos'}.get(OS_NAME, OS_NAME),
-        MACHINE
+        MACHINE,
     )))
     return name, ''.join(filter(None, (
         'dist/',
@@ -81,7 +80,7 @@ def version_to_list(version):
 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 = ['test', 'ytdlp_plugins', 'youtube_dl', 'youtube_dlc']
+    excluded_modules = ('youtube_dl', 'youtube_dlc', 'test', 'ytdlp_plugins', 'devscripts')
 
     yield from (f'--hidden-import={module}' for module in dependencies)
     yield '--collect-submodules=websockets'