Update the pyinstaller build to include version number.
This commit is contained in:
parent
da6bd95733
commit
c6535f0ce1
2 changed files with 20 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -36,3 +36,4 @@ __pycache__
|
||||||
.idea
|
.idea
|
||||||
dist
|
dist
|
||||||
build
|
build
|
||||||
|
version.txt
|
||||||
|
|
|
||||||
21
app.spec
21
app.spec
|
|
@ -1,8 +1,24 @@
|
||||||
|
import importlib.util
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
import tomllib
|
import tomllib
|
||||||
|
|
||||||
|
spec = importlib.util.spec_from_file_location("version", "./app/library/version.py")
|
||||||
|
ver = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(ver)
|
||||||
|
|
||||||
|
with open("version.txt", "w") as f:
|
||||||
|
f.write(f"""# UTF-8
|
||||||
|
# FileVersion: "{ver.APP_VERSION}"
|
||||||
|
# ProductVersion: "{ver.APP_VERSION}"
|
||||||
|
# FileDescription: "YTPTube build {ver.APP_COMMIT_SHA}"
|
||||||
|
# ProductName: "YTPTube"
|
||||||
|
# OriginalFilename: "ytptube.exe"
|
||||||
|
# InternalName: "YTPTube"
|
||||||
|
# Comments: "Built from {ver.APP_BRANCH} at {ver.APP_BUILD_DATE}"
|
||||||
|
""")
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
machine = platform.machine().lower()
|
machine = platform.machine().lower()
|
||||||
|
|
@ -31,7 +47,7 @@ hidden = [
|
||||||
"engineio",
|
"engineio",
|
||||||
"engineio.async_drivers.aiohttp",
|
"engineio.async_drivers.aiohttp",
|
||||||
"socketio.async_drivers.aiohttp",
|
"socketio.async_drivers.aiohttp",
|
||||||
"app"
|
"app",
|
||||||
]
|
]
|
||||||
|
|
||||||
hidden = [f.replace("-", "_") for f in hidden]
|
hidden = [f.replace("-", "_") for f in hidden]
|
||||||
|
|
@ -63,7 +79,8 @@ exe = EXE( # type: ignore # noqa: F821
|
||||||
debug=False,
|
debug=False,
|
||||||
strip=False,
|
strip=False,
|
||||||
upx=True,
|
upx=True,
|
||||||
console=False, # Turn on to True if you want a console window for debugging.
|
version="version.txt",
|
||||||
|
console=False, # Turn on to True if you want a console window for debugging.
|
||||||
icon="ui/public/favicon.ico",
|
icon="ui/public/favicon.ico",
|
||||||
onefile=True,
|
onefile=True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue