Consistent version management

This commit is contained in:
Wiktor Mazur
2021-07-24 13:43:57 +02:00
parent 458202f067
commit a34bd72d54
4 changed files with 12 additions and 24 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
from setuptools import setup, find_packages
from src.utils import version
install_requires = [
"requests==2.26.0",
@@ -11,7 +11,7 @@ install_requires = [
setup(
name='aostats',
version='1.0.0',
version=version.get_version(),
packages=find_packages('.', include=('src*')),
package_data={'': ['**/*.png']},
include_package_data=True,
+2 -19
View File
@@ -17,7 +17,6 @@ from ..utils.config import config
from .modules.main import MainWidget
from .styling import style
from ..utils.version import current_version as get_current_version
from ..utils.version import latest_url
from ..utils.version import latest_version as get_latest_version
from ..utils.assets import path
from ..utils.assets import scripts
@@ -30,18 +29,6 @@ def fix_npcap():
sys.exit(0)
def get_modt(always_on_top):
motd_url = 'https://mazurwiktor.github.io/aostats/motd'
msg = QMessageBox()
msg.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
msg.setObjectName("Motd")
msg.setWindowTitle("Message of the day")
msg.setInformativeText(str(requests.get(motd_url).text))
msg.setStandardButtons(QMessageBox.Ok)
return msg
def run():
initialization_result = initialize()
@@ -66,16 +53,12 @@ def run():
widget.setWindowTitle('Albion Online Stats')
widget.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
modt = get_modt(['always_on_top'])
if window_config['always_on_top']:
widget.setWindowFlag(Qt.WindowStaysOnTopHint)
modt.setWindowFlag(Qt.WindowStaysOnTopHint)
if window_config['frameless']:
widget.setWindowFlag(Qt.FramelessWindowHint)
widget.show()
modt.show()
current_version, latest_version = (
get_current_version(), get_latest_version())
@@ -85,8 +68,8 @@ def run():
msg.setIcon(QMessageBox.Warning)
msg.setWindowTitle("Update available!")
msg.setText("Another version of app is avaliable.")
msg.setInformativeText("You are using app in version {}, new version {} available <a href='{}'>here</a>".format(
current_version, latest_version, latest_url))
msg.setInformativeText("You are using app in version {}, latest version is {}".format(
current_version, latest_version))
msg.setStandardButtons(QMessageBox.Ok)
msg.show()
+3 -2
View File
@@ -1,5 +1,6 @@
from PySide2.QtWidgets import QMessageBox # type: ignore
from PySide2.QtWidgets import QMessageBox # noqa type: ignore
from ...utils.version import get_version
text = """
This software is free to use and delivered to you with a lot on fun :)
@@ -18,7 +19,7 @@ class About(QMessageBox):
def __init__(self):
QMessageBox.__init__(self)
self.setIcon(QMessageBox.Information)
self.setWindowTitle("Albion online stats")
self.setWindowTitle(f"Albion online stats {get_version()}")
self.setText(text)
self.setInformativeText('<a href="{}"> Report Bug/Feature request </a> | <a href="{}"> Contribute </a> | <a href="{}"> Download </a> | <a href="{}"> Donate </a>'.format(
"https://github.com/mazurwiktor/albion-online-stats/issues/new/choose",
+5 -1
View File
@@ -1,11 +1,15 @@
import os
import requests
_version = "0.11.12"
_version = "1.0.0"
latest_url = "https://github.com/mazurwiktor/albion-online-stats/releases/latest"
def get_version():
return _version
def latest_version():
req = requests.get(latest_url)
if req.status_code == 200: