#!/bin/bash # CI python-части репозитория (pyfglair; позже — тесты HA-компонента). # scripts/py-ci.sh --setup # создать venv и поставить зависимости # scripts/py-ci.sh # прогнать pytest (ядро соберётся в conftest) set -euo pipefail cd "$(dirname "$0")/.." VENV="${PY_VENV:-.venv}" if [ "${1:-}" = "--setup" ]; then python3 -m venv "$VENV" "$VENV/bin/pip" install -q --upgrade pip "$VENV/bin/pip" install -q cffi aiohttp pytest pytest-asyncio fi if [ ! -x "$VENV/bin/python" ]; then echo "py-ci: нет $VENV (запустите: scripts/py-ci.sh --setup)" >&2 exit 1 fi "$VENV/bin/python" -m pytest tests/pyfglair -q