mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
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:
@ -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")
|
||||
|
Reference in New Issue
Block a user