From b7fad78a7145c4f063470a1e7151ace9618c4bff Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 15 Feb 2026 15:17:30 +0300 Subject: [PATCH] refactor(release): bump to 1.6.0 and unify version source --- app_version.py | 1 + build.py | 3 ++- main.py | 2 +- tests/test_auth_relogin_smoke.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 app_version.py diff --git a/app_version.py b/app_version.py new file mode 100644 index 0000000..f4de560 --- /dev/null +++ b/app_version.py @@ -0,0 +1 @@ +APP_VERSION = "1.6.0" diff --git a/build.py b/build.py index 3859835..9ffe9df 100644 --- a/build.py +++ b/build.py @@ -2,10 +2,11 @@ import os import shutil import subprocess import sys +from app_version import APP_VERSION # --- Конфигурация --- APP_NAME = "AnabasisManager" -VERSION = "1.5.1" # Ваша версия +VERSION = APP_VERSION # Единая версия приложения MAIN_SCRIPT = "main.py" ICON_PATH = "icon.ico" DIST_DIR = os.path.join("dist", APP_NAME) diff --git a/main.py b/main.py index 1a57f96..64f0cd0 100644 --- a/main.py +++ b/main.py @@ -11,6 +11,7 @@ import re import threading import urllib.error import urllib.request +from app_version import APP_VERSION from PySide6.QtWidgets import (QApplication, QMainWindow, QLabel, QLineEdit, QPushButton, QVBoxLayout, QWidget, QMessageBox, QTextBrowser, QScrollArea, QCheckBox, QHBoxLayout, @@ -33,7 +34,6 @@ LOG_FILE = os.path.join(APP_DATA_DIR, "app.log") LOG_MAX_BYTES = 1024 * 1024 # 1 MB LOG_BACKUP_FILE = os.path.join(APP_DATA_DIR, "app.log.1") AUTH_RELOGIN_BACKOFF_SECONDS = 5.0 -APP_VERSION = "1.5.1" # Legacy owner/repo format for GitHub-only fallback. UPDATE_REPOSITORY = "" # Full repository URL is preferred (supports GitHub/Gitea). diff --git a/tests/test_auth_relogin_smoke.py b/tests/test_auth_relogin_smoke.py index 750602d..1abd10b 100644 --- a/tests/test_auth_relogin_smoke.py +++ b/tests/test_auth_relogin_smoke.py @@ -38,7 +38,7 @@ class AuthReloginSmokeTests(unittest.TestCase): self.assertNotIn("self.retail_coffee_checkboxes", self.source) def test_update_check_actions_exist(self): - self.assertIn("APP_VERSION = ", self.source) + self.assertIn("from app_version import APP_VERSION", self.source) self.assertIn("UPDATE_REPOSITORY = ", self.source) self.assertIn('QAction("Проверить обновления", self)', self.source) self.assertIn("def check_for_updates(self, silent_no_updates=False):", self.source)