From 4035f348dc03841ef2eb483047fbf84127f37920 Mon Sep 17 00:00:00 2001 From: kuba Date: Mon, 18 Nov 2024 12:07:21 +0300 Subject: [PATCH] bundle all modules from pyproject.toml --- scripts/build.py | 7 +++++++ 1 file changed, 7 insertions(+) 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), ] )