2024-04-06 11:25:47 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -ex
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
2025-11-27 12:00:47 -08:00
|
|
|
# Remove mypy-dev from requirements_test.txt since the maintainer deletes old versions from PyPI.
|
|
|
|
|
# We'll install the latest version separately below.
|
|
|
|
|
# See: https://github.com/cdce8p/mypy-dev/issues/62
|
|
|
|
|
sed -i '/^mypy-dev/d' core/requirements_test.txt
|
2024-08-25 11:21:01 -07:00
|
|
|
|
2025-06-15 21:31:51 -07:00
|
|
|
uv pip install -r core/requirements.txt
|
2025-01-01 16:11:22 -08:00
|
|
|
uv pip install -r core/requirements_test.txt
|
2026-04-24 11:31:53 -07:00
|
|
|
|
|
|
|
|
# HA 2026.4+ imports aiohasupervisor from tests/components/conftest.py
|
|
|
|
|
# but pins it in requirements_test_all.txt instead of requirements_test.txt.
|
|
|
|
|
aiohasupervisor_req=""
|
|
|
|
|
if [[ -f core/requirements_test_all.txt ]]; then
|
|
|
|
|
aiohasupervisor_req="$(grep -m1 '^aiohasupervisor' core/requirements_test_all.txt || true)"
|
|
|
|
|
fi
|
|
|
|
|
if [[ -n "${aiohasupervisor_req}" ]]; then
|
|
|
|
|
uv pip install "${aiohasupervisor_req}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# HA 2026.4+ validates service translations through translations/en.json.
|
|
|
|
|
# The core checkout keeps English source strings in strings.json, so seed en.json
|
|
|
|
|
# in the temporary CI checkout before tests load integrations.
|
|
|
|
|
for strings_file in core/homeassistant/components/*/strings.json; do
|
|
|
|
|
[[ -f "${strings_file}" ]] || continue
|
|
|
|
|
translations_dir="$(dirname "${strings_file}")/translations"
|
|
|
|
|
en_translation="${translations_dir}/en.json"
|
|
|
|
|
if [[ ! -f "${en_translation}" ]]; then
|
|
|
|
|
mkdir -p "${translations_dir}"
|
|
|
|
|
cp "${strings_file}" "${en_translation}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
2025-01-01 16:11:22 -08:00
|
|
|
uv pip install -e core/
|
|
|
|
|
uv pip install ulid-transform # this is in Adaptive-lighting's manifest.json
|
|
|
|
|
uv pip install $(python test_dependencies.py)
|
2025-11-27 12:00:47 -08:00
|
|
|
|
|
|
|
|
# Install the latest mypy-dev (not pinned since old versions get deleted from PyPI)
|
|
|
|
|
uv pip install --upgrade mypy-dev
|
2025-12-12 13:29:46 -08:00
|
|
|
|
|
|
|
|
# Workaround for aiodns/pycares compatibility issue
|
|
|
|
|
# See: https://github.com/aio-libs/aiodns/issues/214
|
|
|
|
|
uv pip install --upgrade aiodns
|