Home Assistant Unofficial Reference 2024.12.1
homeassistant.requirements Namespace Reference

Classes

class  RequirementsManager
 
class  RequirementsNotFound
 

Functions

RequirementsManager _async_get_manager (HomeAssistant hass)
 
tuple[set[str], set[str]] _install_requirements_if_missing (list[str] requirements, dict[str, Any] kwargs)
 
bool _install_with_retry (str requirement, dict[str, Any] kwargs)
 
None async_clear_install_history (HomeAssistant hass)
 
Integration async_get_integration_with_requirements (HomeAssistant hass, str domain)
 
None async_load_installed_versions (HomeAssistant hass, set[str] requirements)
 
None async_process_requirements (HomeAssistant hass, str name, list[str] requirements)
 
dict[str, Any] pip_kwargs (str|None config_dir)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string CONSTRAINT_FILE = "package_constraints.txt"
 
string DATA_REQUIREMENTS_MANAGER = "requirements_manager"
 
int MAX_INSTALL_FAILURES = 3
 
int PIP_TIMEOUT = 60
 

Detailed Description

Module to handle installing requirements.

Function Documentation

◆ _async_get_manager()

RequirementsManager homeassistant.requirements._async_get_manager ( HomeAssistant  hass)
private
Get the requirements manager.

Definition at line 77 of file requirements.py.

◆ _install_requirements_if_missing()

tuple[set[str], set[str]] homeassistant.requirements._install_requirements_if_missing ( list[str]  requirements,
dict[str, Any]   kwargs 
)
private
Install requirements if missing.

Definition at line 108 of file requirements.py.

◆ _install_with_retry()

bool homeassistant.requirements._install_with_retry ( str  requirement,
dict[str, Any]  kwargs 
)
private
Try to install a package up to MAX_INSTALL_FAILURES times.

Definition at line 100 of file requirements.py.

◆ async_clear_install_history()

None homeassistant.requirements.async_clear_install_history ( HomeAssistant  hass)
Forget the install history.

Definition at line 83 of file requirements.py.

◆ async_get_integration_with_requirements()

Integration homeassistant.requirements.async_get_integration_with_requirements ( HomeAssistant  hass,
str   domain 
)
Get an integration with all requirements installed, including the dependencies.

This can raise IntegrationNotFound if manifest or integration
is invalid, RequirementNotFound if there was some type of
failure to install requirements.

Definition at line 44 of file requirements.py.

◆ async_load_installed_versions()

None homeassistant.requirements.async_load_installed_versions ( HomeAssistant  hass,
set[str]   requirements 
)
Load the installed version of requirements.

Definition at line 68 of file requirements.py.

◆ async_process_requirements()

None homeassistant.requirements.async_process_requirements ( HomeAssistant  hass,
str  name,
list[str]   requirements 
)
Install the requirements for a component or platform.

This method is a coroutine. It will raise RequirementsNotFound
if an requirement can't be satisfied.

Definition at line 57 of file requirements.py.

◆ pip_kwargs()

dict[str, Any] homeassistant.requirements.pip_kwargs ( str | None  config_dir)
Return keyword arguments for PIP install.

Definition at line 88 of file requirements.py.

Variable Documentation

◆ _LOGGER

homeassistant.requirements._LOGGER = logging.getLogger(__name__)
private

Definition at line 31 of file requirements.py.

◆ CONSTRAINT_FILE

string homeassistant.requirements.CONSTRAINT_FILE = "package_constraints.txt"

Definition at line 24 of file requirements.py.

◆ DATA_REQUIREMENTS_MANAGER

string homeassistant.requirements.DATA_REQUIREMENTS_MANAGER = "requirements_manager"

Definition at line 23 of file requirements.py.

◆ MAX_INSTALL_FAILURES

int homeassistant.requirements.MAX_INSTALL_FAILURES = 3

Definition at line 22 of file requirements.py.

◆ PIP_TIMEOUT

int homeassistant.requirements.PIP_TIMEOUT = 60

Definition at line 21 of file requirements.py.