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:
Mike Degatano
2025-03-25 15:06:35 -04:00
committed by GitHub
parent 543d6efec4
commit 0636e49fe2
62 changed files with 500 additions and 382 deletions

View File

@@ -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()),