mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 10:59:43 +00:00
Enable mypy part 1 (addons and api) (#5759)
* Fix mypy issues in addons * Fix mypy issues in api * fix docstring * Brackets instead of get with default
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from functools import cached_property
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from awesomeversion import AwesomeVersion
|
||||
|
||||
@@ -23,7 +23,7 @@ from ..utils.common import FileConfiguration, find_one_filetype
|
||||
from .validate import SCHEMA_BUILD_CONFIG
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import AnyAddon
|
||||
from .manager import AnyAddon
|
||||
|
||||
|
||||
class AddonBuild(FileConfiguration, CoreSysAttributes):
|
||||
@@ -63,7 +63,7 @@ class AddonBuild(FileConfiguration, CoreSysAttributes):
|
||||
@cached_property
|
||||
def arch(self) -> str:
|
||||
"""Return arch of the add-on."""
|
||||
return self.sys_arch.match(self.addon.arch)
|
||||
return self.sys_arch.match([self.addon.arch])
|
||||
|
||||
@property
|
||||
def base_image(self) -> str:
|
||||
@@ -126,7 +126,7 @@ class AddonBuild(FileConfiguration, CoreSysAttributes):
|
||||
|
||||
Must be run in executor.
|
||||
"""
|
||||
args = {
|
||||
args: dict[str, Any] = {
|
||||
"path": str(self.addon.path_location),
|
||||
"tag": f"{image or self.addon.image}:{version!s}",
|
||||
"dockerfile": str(self.get_dockerfile()),
|
||||
|
||||
Reference in New Issue
Block a user