diff --git a/scripts/build.py b/scripts/build.py index 1a4eb51a9..31495a4df 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -1,6 +1,7 @@ import os import sys from pathlib import Path +from importlib.metadata import metadata import PyInstaller.__main__ # type: ignore import pykakasi @@ -13,6 +14,11 @@ PYKAKASI_PATH = str((Path(pykakasi.__file__).parent / "data")) YTDLP_PATH = str(Path(yt_dlp.__file__).parent / "__pyinstaller") +# Read modules from pyproject.toml +modules = set( + module.split(" ")[0] for module in metadata("spotdl").get_all("Requires-Dist", []) +) + PyInstaller.__main__.run( [ "spotdl/__main__.py", @@ -25,5 +31,6 @@ "--name", f"spotdl-{__version__}-{sys.platform}", "--console", + *(f"--collect-all={module}" for module in modules), ] )