This custom integration uses multiple requirements files to separate different types of dependencies:
Purpose: Python packages needed by the integration at runtime
Installed by: Home Assistant when loading the integration
Also defined in: custom_components/ecole_directe/manifest.json
Note: This file is typically empty if this integration has no additional runtime dependencies beyond Home Assistant core.
Example:
aiohttp>=3.8.0
async-timeout>=4.0.0Purpose: Additional development tools beyond what Home Assistant core provides
Installed by: script/setup/bootstrap
Used by: Developers, IDEs
Includes:
pyright- Type checker (we prefer pyright over HA's mypy for better IDE integration)colorlog- Colored logging for development scripts- Performance tools (
zlib_ng,isal) - Optional optimization packages
Note: Most development tools (ruff, pre-commit, codespell, pylint) are already provided by Home Assistant core's requirements_test.txt and requirements_test_pre_commit.txt, which are installed automatically via script/setup/bootstrap.
Purpose: Additional testing tools beyond what Home Assistant core provides
Installed by: script/setup/bootstrap
Used by: Test runners, CI/CD
Includes:
pytest-homeassistant-custom-component- Additional fixtures and utilities for custom component testing
Note: Core testing tools (pytest, pytest-asyncio, pytest-aiohttp, pytest-cov, pytest-timeout, pytest-xdist, coverage, freezegun, requests-mock, respx) are already provided by Home Assistant core's requirements_test.txt, which is installed automatically via script/setup/bootstrap.
{
"requirements": ["aiohttp>=3.8.0"]
}- β Runtime dependencies for end users
- β Automatically installed by Home Assistant
- β
Should match
requirements.txtcontent - βΉοΈ Optional: If this integration doesn't need additional packages beyond Home Assistant core, you can omit this field
| Add to | When |
|---|---|
manifest.json + requirements.txt |
Runtime dependency (end users need it) |
requirements_dev.txt |
Development tool (linting, formatting, type checking) |
requirements_test.txt |
Testing tool (pytest plugins, test utilities) |
When you add a runtime dependency:
- β
Add to
manifest.jsonrequirementsfield - β
Add to
requirements.txt(same version constraint) - β Don't add to
requirements_dev.txtorrequirements_test.txt
Example:
// manifest.json
{
"requirements": ["aiohttp>=3.8.0"]
}# requirements.txt
aiohttp>=3.8.0The script/setup/bootstrap automatically installs dependencies from multiple sources:
Version: Configured via HA_VERSION in .devcontainer/devcontainer.json (currently 2026.12.3)
-
Runtime dependencies (
requirements_all.txt)- All packages that Home Assistant integrations might need
- Includes aiohttp, async-timeout, and hundreds of other packages
-
Test dependencies (
requirements_test.txt)- pytest and all pytest plugins (pytest-asyncio, pytest-aiohttp, pytest-cov, pytest-timeout, pytest-xdist)
- Testing utilities (coverage, freezegun, requests-mock, respx)
- mypy-dev for type checking (we use pyright instead)
-
Pre-commit dependencies (
requirements_test_pre_commit.txt)- ruff (linting and formatting)
- codespell (spell checking)
- pre-commit (hook framework)
- pylint (linting)
-
Home Assistant core (
homeassistant==$HA_VERSION)- The full Home Assistant installation
requirements_dev.txt- Additional development tools this project uses (pyright, colorlog, performance packages)requirements_test.txt- Custom component testing utilitiesrequirements.txt- This integration's runtime dependencies (if any)
This approach means this project only needs to maintain a minimal set of dependencies that are specific to this integration, while leveraging the comprehensive dependency management from Home Assistant core.
{
"name": "Integration Name",
"homeassistant": "2026.11.0",
"hacs": "2.0.5"
}- β No Python dependencies - only metadata
- β Minimum Home Assistant version
- β Minimum HACS version
{
"requirements": ["package>=1.0.0"]
}- β Python package dependencies
- β Installed by Home Assistant
No duplication needed! hacs.json only contains version constraints for HA/HACS, not Python packages.