Skip to content

Commit

Permalink
bundle all modules from pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
xnetcat committed Nov 18, 2024
1 parent 2d637c7 commit 4035f34
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
from pathlib import Path
from importlib.metadata import metadata

import PyInstaller.__main__ # type: ignore
import pykakasi
Expand All @@ -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",
Expand All @@ -25,5 +31,6 @@
"--name",
f"spotdl-{__version__}-{sys.platform}",
"--console",
*(f"--collect-all={module}" for module in modules),
]
)

0 comments on commit 4035f34

Please sign in to comment.