Skip to content

Commit b2e0319

Browse files
authored
Refactor setup.py for upgrade code and project root
Updated setup.py to read upgrade code from a file and set the project root to the current working directory.
1 parent 788a424 commit b2e0319

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

build/cxfreeze/setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@
33
import sys
44
from pathlib import Path
55

6-
# ---- Ensure project root is importable ----
7-
ROOT_DIR = Path(__file__).resolve().parents[2]
6+
ROOT_DIR = Path.cwd()
87
sys.path.insert(0, str(ROOT_DIR))
98

10-
# ---- Metadata injected by CI ----
9+
# ---- Metadata from extract_metadata.py ----
1110
APP_NAME = os.environ["APP_NAME"]
1211
APP_VERSION = os.environ["APP_VERSION"]
1312
APP_PUBLISHER = os.environ["APP_PUBLISHER"]
1413
APP_DESCRIPTION = os.environ["APP_DESCRIPTION"]
1514

15+
# ---- Read locked UpgradeCode ----
16+
UPGRADE_CODE = (ROOT_DIR / "build" / "installer" / "upgrade_code.txt").read_text().strip()
17+
1618
base = "Win32GUI" if sys.platform == "win32" else None
1719

1820
build_exe_options = {
19-
# ONLY real pip packages here
2021
"packages": [
2122
"PySide6",
2223
"yt_dlp",
2324
"nltk",
2425
"wordcloud",
2526
"scrapetube",
2627
],
27-
# Local source + data
28+
"excludes": ["tkinter", "tk", "tcl"],
2829
"include_files": [
2930
(ROOT_DIR / "utils", "utils"),
3031
(ROOT_DIR / "UI", "UI"),
@@ -36,8 +37,7 @@
3637
}
3738

3839
bdist_msi_options = {
39-
# DO NOT change once released
40-
"upgrade_code": "{A6F3E7B2-5E0F-4B58-9D9C-STATUBE000001}",
40+
"upgrade_code": UPGRADE_CODE,
4141
"initial_target_dir": r"[ProgramFilesFolder]\StaTube",
4242
"summary_data": {
4343
"author": APP_PUBLISHER,

0 commit comments

Comments
 (0)