moved version to version.txt

This commit is contained in:
Adam Saudagar 2023-02-10 11:11:40 +05:30
parent cc926bf5fd
commit 0fef4aa22c
5 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,7 @@
include LICENSE
include README.md
include requirements.txt
include fishy/version.txt
include fishy/icon.ico
include fishy/fishybot_logo.png
include fishy/sound.mp3

View File

@ -1,4 +1,5 @@
from fishy import constants
import os
from pathlib import Path
# this prevents importing from package while setup
@ -7,4 +8,4 @@ def main():
actual_main()
__version__ = constants.version
__version__ = (Path(os.path.dirname(__file__)) / "version.txt").read_text()

View File

@ -10,6 +10,3 @@ libgps = ("LibGPS", "https://cdn.esoui.com/downloads/file601/LibGPS_3_2_0.zip",
libmapping = ("LibMapPing", "https://cdn.esoui.com/downloads/file1302/LibMapPing_2_0_0.zip", 200)
libdl = ("LibDebugLogger", "https://cdn.esoui.com/downloads/file2275/LibDebugLogger_2_4_1.zip", 241)
libchatmsg = ("LibChatMessage", "https://cdn.esoui.com/downloads/file2382/LibChatMessage_1_2_0.zip", 120)
version = "0.5.14"

View File

@ -1,8 +1,8 @@
import logging
import fishy
from fishy.helper.auto_update import _normalize_version
from fishy.constants import version
from .config import config
@ -14,14 +14,14 @@ class Migration:
@staticmethod
def migrate():
prev_version = _normalize_version(config.get("prev_version", "0.0.0"))
current_version = _normalize_version(version)
current_version = _normalize_version(fishy.__version__)
if current_version > prev_version:
for v, f in migration_code:
if prev_version < _normalize_version(v) <= current_version:
logging.info(f"running migration for {v}")
f()
config.set("prev_version", version)
config.set("prev_version", fishy.__version__)

1
fishy/version.txt Normal file
View File

@ -0,0 +1 @@
0.5.14