Skip to content

Commit

Permalink
Share requirements and fix version import
Browse files Browse the repository at this point in the history
  • Loading branch information
mdegat01 committed Dec 21, 2023
1 parent cc4a3b9 commit 00626af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 32 deletions.
31 changes: 1 addition & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "Supervisor"
dynamic = ["version"]
dynamic = ["version", "dependencies"]
license = { text = "Apache-2.0" }
description = "Open-source private cloud os for Home-Assistant based on HassOS"
readme = "README.md"
Expand All @@ -13,35 +13,6 @@ authors = [
]
keywords = ["docker", "home-assistant", "api"]
requires-python = ">=3.11.0"
dependencies = [
"aiodns==3.1.1",
"aiohttp==3.8.6",
"aiohttp-fast-url-dispatcher==0.1.1",
"async_timeout==4.0.3",
"atomicwrites-homeassistant==1.4.1",
"attrs==23.1.0",
"awesomeversion==23.11.0",
"brotli==1.1.0",
"ciso8601==2.3.1",
"colorlog==6.7.0",
"cpe==1.2.1",
"cryptography==41.0.5",
"debugpy==1.8.0",
"deepmerge==1.1.0",
"dirhash==0.2.1",
"docker==6.1.3",
"faust-cchardet==2.1.19",
"gitpython==3.1.40",
"jinja2==3.1.2",
"pulsectl==23.5.2",
"pyudev==0.24.1",
"PyYAML==6.0.1",
"securetar==2023.3.0",
"sentry-sdk==1.36.0",
"voluptuous==0.14.1",
"dbus-fast==2.14.0",
"typing_extensions==4.8.0",
]

[project.urls]
"Homepage" = "https://www.home-assistant.io/"
Expand Down
25 changes: 23 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
"""Home Assistant Supervisor setup."""
from pathlib import Path
import re

from setuptools import setup

from supervisor.const import SUPERVISOR_VERSION
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 "99.9.9dev"


setup(version=SUPERVISOR_VERSION)
setup(
version=_get_supervisor_version(),
dependencies=REQUIREMENTS.split("/n"),
)

0 comments on commit 00626af

Please sign in to comment.