Add task to install all requirements of an integration (#108262)

* Add task to install the requirements of an integration

* Gather recursive requirements

* Move valid_integration to util

* Apply suggestions from code review

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Implement suggestions

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Robert Resch
2024-01-18 22:11:02 +01:00
committed by GitHub
parent c399cab427
commit edd7feaf10
5 changed files with 89 additions and 11 deletions

View File

@ -4,24 +4,15 @@ from pathlib import Path
import subprocess
import sys
from script.util import valid_integration
from . import docs, error, gather_info, generate
from .const import COMPONENT_DIR
TEMPLATES = [
p.name for p in (Path(__file__).parent / "templates").glob("*") if p.is_dir()
]
def valid_integration(integration):
"""Test if it's a valid integration."""
if not (COMPONENT_DIR / integration).exists():
raise argparse.ArgumentTypeError(
f"The integration {integration} does not exist."
)
return integration
def get_arguments() -> argparse.Namespace:
"""Get parsed passed in arguments."""
parser = argparse.ArgumentParser(description="Home Assistant Scaffolder")