fix(packaging): anchor PyInstaller spec paths to project root via SPECPATH
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
Some checks failed
Mirror to Gitea / mirror (push) Has been cancelled
This commit is contained in:
@@ -8,14 +8,19 @@ Or manually:
|
||||
pyinstaller packaging/xlsx_clean.spec
|
||||
"""
|
||||
|
||||
import os
|
||||
from PyInstaller.utils.hooks import collect_all
|
||||
|
||||
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 = [
|
||||
("src/xlsx_clean/file_data.csv", "xlsx_clean"),
|
||||
("src/xlsx_clean/strings.txt", "xlsx_clean"),
|
||||
("src/xlsx_clean/fonts", "xlsx_clean/fonts"),
|
||||
(os.path.join(root, "src/xlsx_clean/file_data.csv"), "xlsx_clean"),
|
||||
(os.path.join(root, "src/xlsx_clean/strings.txt"), "xlsx_clean"),
|
||||
(os.path.join(root, "src/xlsx_clean/fonts"), "xlsx_clean/fonts"),
|
||||
]
|
||||
binaries = []
|
||||
hiddenimports = [
|
||||
@@ -34,8 +39,8 @@ binaries += tmp_ret[1]
|
||||
hiddenimports += tmp_ret[2]
|
||||
|
||||
a = Analysis(
|
||||
["src/xlsx_clean/gui_app.py"],
|
||||
pathex=["."],
|
||||
[os.path.join(root, "src/xlsx_clean/gui_app.py")],
|
||||
pathex=[root],
|
||||
binaries=binaries,
|
||||
datas=datas,
|
||||
hiddenimports=hiddenimports,
|
||||
@@ -67,7 +72,7 @@ exe = EXE(
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
icon="desktop/xlsx-clean.ico",
|
||||
icon=os.path.join(root, "desktop/xlsx-clean.ico"),
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
|
||||
Reference in New Issue
Block a user