mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-04-19 10:47:15 +00:00

* 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
29 lines
721 B
Python
29 lines
721 B
Python
"""Home Assistant Supervisor setup."""
|
|
|
|
from pathlib import Path
|
|
import re
|
|
|
|
from setuptools import setup
|
|
|
|
RE_SUPERVISOR_VERSION = re.compile(r"^SUPERVISOR_VERSION =\s*(.+)$")
|
|
|
|
SUPERVISOR_DIR = Path(__file__).parent
|
|
REQUIREMENTS_FILE = SUPERVISOR_DIR / "requirements.txt"
|
|
CONST_FILE = SUPERVISOR_DIR / "supervisor/const.py"
|
|
|
|
REQUIREMENTS = REQUIREMENTS_FILE.read_text(encoding="utf-8")
|
|
CONSTANTS = CONST_FILE.read_text(encoding="utf-8")
|
|
|
|
|
|
def _get_supervisor_version():
|
|
for line in CONSTANTS.split("/n"):
|
|
if match := RE_SUPERVISOR_VERSION.match(line):
|
|
return match.group(1)
|
|
return "9999.09.9.dev9999"
|
|
|
|
|
|
setup(
|
|
version=_get_supervisor_version(),
|
|
dependencies=REQUIREMENTS.split("/n"),
|
|
)
|