Skip to content

Commit

Permalink
Use version which is treated CalVer by AwesomeVersion (#5572)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
agners authored Jan 24, 2025
1 parent 8e185a8 commit 690f1c0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion supervisor/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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"
Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/backups/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/test_coresys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

0 comments on commit 690f1c0

Please sign in to comment.