def integration(): """Fixture for hassfest integration model.""" integration = Integration("") integration.manifest = { "domain": "test", "documentation": "https://example.com", "name": "test", "codeowners": ["@awesome"], } return integration
def gather_recursive_requirements(domain, seen=None): """Recursively gather requirements from a module.""" if seen is None: seen = set() seen.add(domain) integration = Integration(Path(f"homeassistant/components/{domain}")) integration.load_manifest() reqs = {x for x in integration.requirements if x not in CONSTRAINT_BASE} for dep_domain in integration.dependencies: reqs.update(gather_recursive_requirements(dep_domain, seen)) return reqs
def gather_recursive_requirements(domain, seen=None): """Recursively gather requirements from a module.""" if seen is None: seen = set() 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.update(gather_recursive_requirements(dep_domain, seen)) return reqs
def integration(): """Fixture for hassfest integration model.""" integration = Integration( path=Path("homeassistant/components/test"), manifest={ "domain": "test", "documentation": "https://example.com", "name": "test", "codeowners": ["@awesome"], "requirements": [], }, ) yield integration
def gather_recursive_requirements(domain, seen=None): """Recursively gather requirements from a module.""" if seen is None: seen = set() seen.add(domain) integration = Integration( pathlib.Path('homeassistant/components/{}'.format(domain))) integration.load_manifest() reqs = set(integration.manifest['requirements']) for dep_domain in integration.manifest['dependencies']: reqs.update(gather_recursive_requirements(dep_domain, seen)) return reqs