feat: add versioned release packaging

This commit is contained in:
chengma
2026-07-07 14:21:30 +08:00
parent 148c4a73eb
commit 7838554c3d
14 changed files with 407 additions and 113 deletions
+3 -2
View File
@@ -6,6 +6,7 @@ import os
import sys
from .. import appconfig
from ..version import APP_NAME, display_name
from . import widgets as _widgets
from .widgets import *
@@ -33,7 +34,7 @@ if QT_IMPORT_ERROR is None:
else:
class MainWindow(QMainWindow):
def __init__(self):
raise RuntimeError("蝦皮圈優化助手 GUI 无法启动:当前 Python 环境未安装 PySide6。")
raise RuntimeError(f"{APP_NAME} GUI 无法启动:当前 Python 环境未安装 PySide6。")
def _ensure_offscreen_for_headless_tests():
@@ -43,7 +44,7 @@ def _ensure_offscreen_for_headless_tests():
def main() -> int:
if QT_IMPORT_ERROR is not None:
print("蝦皮圈優化助手 GUI 无法启动:当前 Python 环境未安装 PySide6。")
print(f"{APP_NAME} GUI 无法启动:当前 Python 环境未安装 PySide6。")
return 1
_ensure_offscreen_for_headless_tests()
app = QApplication.instance() or QApplication(sys.argv)
+4 -1
View File
@@ -2,6 +2,7 @@
from __future__ import annotations
from ..version import display_name
from .tabs.accounts import AccountsTab
from .tabs.apply import ApplyTab
from .tabs.collect import CollectTab
@@ -9,6 +10,7 @@ from .tabs.generate import GenerateTab
from .tabs.settings import SettingsTab
from .widgets import *
PREFERRED_WINDOW_SIZE = (1180, 760)
MIN_WINDOW_SIZE = (960, 640)
WINDOW_SCREEN_MARGIN = 40
@@ -68,6 +70,7 @@ def _fit_and_center_window(
max_y = available.y() + max(0, available.height() - height)
window.move(min(max(x, available.x()), max_x), min(max(y, available.y()), max_y))
class MainWindow(QMainWindow):
"""Main application window with the fixed five-tab workflow."""
@@ -86,7 +89,7 @@ class MainWindow(QMainWindow):
or self.config.get("ai_models_path")
or appconfig.ai_models_config_path(self.config)
)
self.setWindowTitle("蝦皮圈優化助手")
self.setWindowTitle(display_name())
_fit_and_center_window(self)
self.setStyleSheet(BUTTON_BASE_STYLE)
self._settings_tab_index = TAB_TITLES.index("⑤ 设置")