mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 18:12:00 +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 .localplatform import localplatform
|
||||||
from .enums import UserType
|
from .enums import UserType
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from packaging.version import Version # type: ignore
|
from packaging.version import Version
|
||||||
|
|
||||||
REMOTE_DEBUGGER_UNIT = "steam-web-debug-portforward.service"
|
REMOTE_DEBUGGER_UNIT = "steam-web-debug-portforward.service"
|
||||||
|
|
||||||
@@ -63,19 +63,18 @@ def mkdir_as_user(path: str):
|
|||||||
localplatform.chown(path)
|
localplatform.chown(path)
|
||||||
|
|
||||||
# Fetches the version of loader
|
# 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:
|
def get_loader_version() -> str:
|
||||||
try:
|
try:
|
||||||
# Normalize Python-style version to conform to Decky style
|
# 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
|
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
|
if v.post: # type: ignore
|
||||||
version_str += f'-dev{v.post}' # type: ignore
|
version_str += f'-dev{v.post}'
|
||||||
|
|
||||||
return version_str
|
return version_str
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ a = Analysis(
|
|||||||
('locales', 'locales'),
|
('locales', 'locales'),
|
||||||
('static', 'static'),
|
('static', 'static'),
|
||||||
] + copy_metadata('decky_loader'),
|
] + copy_metadata('decky_loader'),
|
||||||
hiddenimports=['logging.handlers', 'sqlite3', 'decky_plugin' 'decky'],
|
hiddenimports=['logging.handlers', 'sqlite3', 'decky_plugin', 'decky'],
|
||||||
)
|
)
|
||||||
pyz = PYZ(a.pure, a.zipped_data)
|
pyz = PYZ(a.pure, a.zipped_data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user