mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-10 20:02:29 +00:00
refactor!: change layout; import and build change
Fixes: #200 Fixes: #365 Fixes: #512 Fixes: #800 fix(pyproject): resolve mix-up of mypy and pytest chore(ci): remove legacy scripts chore: format with new mypy rules; fix translation test wip(ci/mypy): remove config flag fix(pyinstaller): use correct dict access fix(resources): usage in ts_qt.py feat(nix/package): validate tests with pytest hook fix(nix/package): remove old dependency patch feat(nix): support Darwin fix(nix/package): move check deps to checkInputs fix(nix/shell): typo fix(nix/shell): correctly wrap Python with Qt args fix(pyproject): specify mypy-extensions feat(nix/package): provide pillow-jxl-plugin nix(nix/package): split into multiple files, allow overriding of JXL and vtf2img fix(nix/shell): provide FFmpeg on runtime feat(flake): output pillow-jxl-plugin and vtf2img fix(nix/package): load pipewire feat(nix/package): run tests on pillow-jxl-plugin fix: remove extra noqa comment docs: update installation docs docs: shrink table size on docs site nit(nix/package): pipewire not needed in buildInputs docs: update commands, environment, setup fix: use consistent possessives chore: format with prettier, add ignore flags fix(pyinstaller): consume from pyproject Revert "fix(pyinstaller): consume from pyproject" This reverts commit 398cd4e5630a3e83d22d15286d7ac59b4c07c5d6. refactor: use icon from resource manager Also fixes incorrect path currently used in ts_qt.py. nix(pyinstaller): replace use of sys.platform with platform.system docs: add build section Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
This commit is contained in:
@@ -1,32 +1,33 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
# vi: ft=python
|
||||
|
||||
|
||||
import platform
|
||||
from argparse import ArgumentParser
|
||||
import sys
|
||||
|
||||
from PyInstaller.building.api import COLLECT, EXE, PYZ
|
||||
from PyInstaller.building.build_main import Analysis
|
||||
from PyInstaller.building.osx import BUNDLE
|
||||
|
||||
from tomllib import load
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('--portable', action='store_true')
|
||||
parser.add_argument("--portable", action="store_true")
|
||||
options = parser.parse_args()
|
||||
|
||||
with open("pyproject.toml", "rb") as file:
|
||||
pyproject = load(file)["project"]
|
||||
|
||||
name = 'TagStudio' if sys.platform == 'win32' else 'tagstudio'
|
||||
system = platform.system()
|
||||
|
||||
name = pyproject["name"] if system == "Windows" else "tagstudio"
|
||||
icon = None
|
||||
if sys.platform == 'win32':
|
||||
icon = 'tagstudio/resources/icon.ico'
|
||||
elif sys.platform == 'darwin':
|
||||
icon = 'tagstudio/resources/icon.icns'
|
||||
if system == "Windows":
|
||||
icon = "src/tagstudio/resources/icon.ico"
|
||||
elif system == "Darwin":
|
||||
icon = "src/tagstudio/resources/icon.icns"
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['tagstudio/tag_studio.py'],
|
||||
["src/tagstudio/main.py"],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[('tagstudio/resources', 'resources'), ('tagstudio/src', 'src')],
|
||||
datas=[("src/tagstudio", "tagstudio")],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
@@ -47,7 +48,7 @@ exe = EXE(
|
||||
[],
|
||||
bootloader_ignore_signals=False,
|
||||
console=False,
|
||||
hide_console='hide-early',
|
||||
hide_console="hide-early",
|
||||
disable_windowed_traceback=False,
|
||||
debug=False,
|
||||
name=name,
|
||||
@@ -60,27 +61,34 @@ exe = EXE(
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
runtime_tmpdir=None
|
||||
runtime_tmpdir=None,
|
||||
)
|
||||
|
||||
coll = None if options.portable else COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
name=name,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
coll = (
|
||||
None
|
||||
if options.portable
|
||||
else COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
name=name,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
)
|
||||
)
|
||||
|
||||
app = BUNDLE(
|
||||
exe if coll is None else coll,
|
||||
name='TagStudio.app',
|
||||
icon=icon,
|
||||
bundle_identifier='com.cyanvoxel.tagstudio',
|
||||
version='9.5.1',
|
||||
info_plist={
|
||||
'NSAppleScriptEnabled': False,
|
||||
'NSPrincipalClass': 'NSApplication',
|
||||
}
|
||||
)
|
||||
if system == "Darwin":
|
||||
app = BUNDLE(
|
||||
exe if coll is None else coll,
|
||||
name=f"{pyproject['name']}.app",
|
||||
icon=icon,
|
||||
bundle_identifier="com.cyanvoxel.tagstudio",
|
||||
version=pyproject["version"],
|
||||
info_plist={
|
||||
"NSAppleScriptEnabled": False,
|
||||
"NSPrincipalClass": "NSApplication",
|
||||
},
|
||||
)
|
||||
|
||||
# vi: ft=python
|
||||
|
||||
Reference in New Issue
Block a user