Use version which is treated CalVer by AwesomeVersion (#5572)

* Use version which is treated CalVer by AwesomeVersion

The current dev version `99.9.9dev` is treated as unkown version type
by AwesomeVersion. This prevents the version from comparing with
actual Supervisor versions, e.g. from an exsiting backup file.

Make the development version a valid CalVer version so development
versions can handle non-development backups.

* Bump to year 9999
This commit is contained in:
Stefan Agner 2025-01-24 09:59:50 +01:00 committed by GitHub
parent 8e185a8413
commit 690f1c07a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ def _get_supervisor_version():
for line in CONSTANTS.split("/n"):
if match := RE_SUPERVISOR_VERSION.match(line):
return match.group(1)
return "99.9.9dev"
return "9999.09.9.dev9999"
setup(

View File

@ -9,7 +9,7 @@ from typing import Self
from aiohttp import __version__ as aiohttpversion
SUPERVISOR_VERSION = "99.9.9dev"
SUPERVISOR_VERSION = "9999.09.9.dev9999"
SERVER_SOFTWARE = f"HomeAssistantSupervisor/{SUPERVISOR_VERSION} aiohttp/{aiohttpversion} Python/{systemversion[0]}.{systemversion[1]}"
URL_HASSIO_ADDONS = "https://github.com/home-assistant/addons"

View File

@ -14,7 +14,7 @@ async def test_api_info(api_client):
resp = await api_client.get("/info")
result = await resp.json()
assert result["data"]["supervisor"] == "99.9.9dev"
assert result["data"]["supervisor"] == "9999.09.9.dev9999"
assert result["data"]["docker"] == "1.0.0"
assert result["data"]["supported"] is True
assert result["data"]["channel"] == "stable"

View File

@ -39,7 +39,7 @@ def partial_backup_mock(backup_mock):
backup_instance.sys_type = BackupType.PARTIAL
backup_instance.folders = []
backup_instance.addon_list = [TEST_ADDON_SLUG]
backup_instance.supervisor_version = "99.9.9dev"
backup_instance.supervisor_version = "9999.09.9.dev9999"
yield backup_mock
@ -50,7 +50,7 @@ def full_backup_mock(backup_mock):
backup_instance.sys_type = BackupType.FULL
backup_instance.folders = ALL_FOLDERS
backup_instance.addon_list = [TEST_ADDON_SLUG]
backup_instance.supervisor_version = "99.9.9dev"
backup_instance.supervisor_version = "9999.09.9.dev9999"
yield backup_mock

View File

@ -39,6 +39,6 @@ def test_now(coresys: CoreSys):
def test_custom_user_agent(coresys: CoreSys):
"""Test custom useragent."""
assert (
"HomeAssistantSupervisor/99.9.9dev"
"HomeAssistantSupervisor/9999.09.9.dev9999"
in coresys.websession._default_headers[USER_AGENT] # pylint: disable=protected-access
)