fix(packaging): anchor PyInstaller spec paths to project root via SPECPATH
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled

This commit is contained in:
2026-08-11 09:17:07 +03:30
parent 95e0acbe71
commit 9a7a2a8e38

View File

@@ -8,14 +8,19 @@ Or manually:
pyinstaller packaging/xlsx_clean.spec pyinstaller packaging/xlsx_clean.spec
""" """
import os
from PyInstaller.utils.hooks import collect_all from PyInstaller.utils.hooks import collect_all
block_cipher = None block_cipher = None
# SPECPATH is the directory containing this spec file (i.e. "packaging/").
# All source paths are relative to the project root (one level up).
root = os.path.abspath(os.path.join(SPECPATH, ".."))
datas = [ datas = [
("src/xlsx_clean/file_data.csv", "xlsx_clean"), (os.path.join(root, "src/xlsx_clean/file_data.csv"), "xlsx_clean"),
("src/xlsx_clean/strings.txt", "xlsx_clean"), (os.path.join(root, "src/xlsx_clean/strings.txt"), "xlsx_clean"),
("src/xlsx_clean/fonts", "xlsx_clean/fonts"), (os.path.join(root, "src/xlsx_clean/fonts"), "xlsx_clean/fonts"),
] ]
binaries = [] binaries = []
hiddenimports = [ hiddenimports = [
@@ -34,8 +39,8 @@ binaries += tmp_ret[1]
hiddenimports += tmp_ret[2] hiddenimports += tmp_ret[2]
a = Analysis( a = Analysis(
["src/xlsx_clean/gui_app.py"], [os.path.join(root, "src/xlsx_clean/gui_app.py")],
pathex=["."], pathex=[root],
binaries=binaries, binaries=binaries,
datas=datas, datas=datas,
hiddenimports=hiddenimports, hiddenimports=hiddenimports,
@@ -67,7 +72,7 @@ exe = EXE(
target_arch=None, target_arch=None,
codesign_identity=None, codesign_identity=None,
entitlements_file=None, entitlements_file=None,
icon="desktop/xlsx-clean.ico", icon=os.path.join(root, "desktop/xlsx-clean.ico"),
) )
coll = COLLECT( coll = COLLECT(