1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Remove unused manifest fields (#33595)

This commit is contained in:
Paulus Schoutsen
2020-04-03 12:58:19 -07:00
committed by GitHub
parent cd300f54a8
commit f1d3c0d19b
870 changed files with 36 additions and 1057 deletions

View File

@@ -127,8 +127,8 @@ def gather_recursive_requirements(domain, seen=None):
seen.add(domain)
integration = Integration(Path(f"homeassistant/components/{domain}"))
integration.load_manifest()
reqs = set(integration.manifest["requirements"])
for dep_domain in integration.manifest["dependencies"]:
reqs = set(integration.requirements)
for dep_domain in integration.dependencies:
reqs.update(gather_recursive_requirements(dep_domain, seen))
return reqs
@@ -170,7 +170,7 @@ def gather_requirements_from_manifests(errors, reqs):
process_requirements(
errors,
integration.manifest["requirements"],
integration.requirements,
f"homeassistant.components.{domain}",
reqs,
)

View File

@@ -71,6 +71,16 @@ class Integration:
"""Integration domain."""
return self.path.name
@property
def requirements(self) -> List[str]:
"""List of requirements."""
return self.manifest.get("requirements", [])
@property
def dependencies(self) -> List[str]:
"""List of dependencies."""
return self.manifest.get("dependencies", [])
def add_error(self, *args, **kwargs):
"""Add an error."""
self.errors.append(Error(*args, **kwargs))