Skip to content

Commit

Permalink
refactor: remove version class
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio committed Jun 23, 2024
1 parent 03abf98 commit dc7f17e
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 295 deletions.
341 changes: 174 additions & 167 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ branch = True
[coverage:report]
show_missing = True
skip_covered = True
fail_under = 43
fail_under = 42
84 changes: 0 additions & 84 deletions sportorg/common/version.py

This file was deleted.

5 changes: 2 additions & 3 deletions sportorg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from pydantic import BaseSettings

from sportorg.common.version import Version


class Env(BaseSettings):
DEBUG: bool = False
Expand All @@ -15,7 +13,8 @@ class Config:


NAME = 'SportOrg'
VERSION = Version(1, 6, 0, 0, 'v')
VERSION = 'v1.6.0'
VERSION_FULL = '1.6.0.0'


def is_executable() -> bool:
Expand Down
2 changes: 1 addition & 1 deletion sportorg/modules/backup/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

def dump(file):
data = {
'version': config.VERSION.file,
'version': config.VERSION_FULL,
'current_race': get_current_race_index(),
'races': [race_downgrade(r.to_dict()) for r in races()],
}
Expand Down
2 changes: 1 addition & 1 deletion sportorg/modules/updater/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_version():
return VERSION


def check_version(version):
def check_version(version: str) -> bool:
if not get_version():
return True
return str(version) == get_version()
2 changes: 1 addition & 1 deletion tests/test_iss.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ def test_app_version(data):
def test_version_info(data):
for item in data:
if '#define MyVersionInfoVersion ' in item:
assert config.VERSION.file in item
assert config.VERSION_FULL in item
return
assert False, 'Not version info'
37 changes: 0 additions & 37 deletions tests/test_version.py

This file was deleted.

0 comments on commit dc7f17e

Please sign in to comment.