mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
version does have types, false alarm
This commit is contained in:
@@ -15,7 +15,7 @@ from aiohttp import ClientSession
|
||||
from .localplatform import localplatform
|
||||
from .enums import UserType
|
||||
from logging import getLogger
|
||||
from packaging.version import Version # type: ignore
|
||||
from packaging.version import Version
|
||||
|
||||
REMOTE_DEBUGGER_UNIT = "steam-web-debug-portforward.service"
|
||||
|
||||
@@ -63,19 +63,18 @@ def mkdir_as_user(path: str):
|
||||
localplatform.chown(path)
|
||||
|
||||
# Fetches the version of loader
|
||||
# TODO THIS IS ABSOLUTELY TERRIBLE AND NEVER SHOULDVE BEEN MERGED! packaging HAS NO TYPES AND WE COULD LITERALLY JUST USE A REGEX!!!!! REWRITE THIS!!!!!!!!!!!!!
|
||||
def get_loader_version() -> str:
|
||||
try:
|
||||
# Normalize Python-style version to conform to Decky style
|
||||
v = Version(importlib.metadata.version("decky_loader")) # type: ignore
|
||||
v = Version(importlib.metadata.version("decky_loader"))
|
||||
|
||||
version_str = f'v{v.major}.{v.minor}.{v.micro}' # type: ignore
|
||||
version_str = f'v{v.major}.{v.minor}.{v.micro}'
|
||||
|
||||
if v.pre: # type: ignore
|
||||
version_str += f'-pre{v.pre[1]}' # type: ignore
|
||||
version_str += f'-pre{v.pre[1]}'
|
||||
|
||||
if v.post: # type: ignore
|
||||
version_str += f'-dev{v.post}' # type: ignore
|
||||
version_str += f'-dev{v.post}'
|
||||
|
||||
return version_str
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user