Compare commits
2
Commits
3f8e4cf593
...
8bdf950fcf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bdf950fcf | ||
|
|
78d9b276ee |
@@ -14,6 +14,9 @@ until the first tagged release.
|
||||
removed. `make test` means the same thing from any directory.
|
||||
- Firmware targets source `~/esp-idf/export.sh` themselves, so `idf.py` resolves without
|
||||
having to remember. Override the location with `IDF_EXPORT=`.
|
||||
- `make setup` now proves the gateway environment actually works instead of trusting a
|
||||
clean `pip install` exit code: it collects the test suite and checks `ruff`/`mypy`
|
||||
resolve in the venv, and fails the target if any of that is broken (T-47).
|
||||
|
||||
## [0.2.2] — 2026-07-19
|
||||
|
||||
|
||||
@@ -44,8 +44,28 @@ lint: lint-gateway ## Lint every component that has a linter
|
||||
# --- gateway ------------------------------------------------------------------
|
||||
|
||||
.PHONY: setup
|
||||
setup: ## Create the gateway venv and install dev deps (no ML models)
|
||||
setup: ## Gateway venv + dev deps + prove it works (firmware needs export.sh — see below)
|
||||
cd $(GATEWAY) && $(PYTHON) -m venv .venv && .venv/bin/pip install -e ".[dev]"
|
||||
@# This covers the gateway half only, deliberately. The firmware half needs
|
||||
@# `source ~/esp-idf/export.sh` in every shell (see the firmware gotchas
|
||||
@# above); a Makefile recipe runs in its own subshell, so it cannot leave
|
||||
@# that sourced in the caller's shell. A `setup` that appeared to prepare
|
||||
@# firmware and silently left `idf.py` unresolved would be worse than one
|
||||
@# that says plainly it does not touch that half — hence `build-firmware`
|
||||
@# sources export.sh itself, per target, instead.
|
||||
@#
|
||||
@# Exit 0 from `pip install` is not evidence (D-24) — pip reports success
|
||||
@# even when the result is unusable (e.g. a dependency that resolved but
|
||||
@# doesn't actually import, or a stale .venv left over from a different
|
||||
@# Python). Prove the environment works instead of trusting the install
|
||||
@# step: `--collect-only` imports every test module and therefore every
|
||||
@# src module each one pulls in (T-47). It runs zero tests, so it stays
|
||||
@# cheap, and it also confirms ruff/mypy landed in .venv/bin — the venv
|
||||
@# is the only place either binary exists (see gateway gotchas above);
|
||||
@# `--version` is enough to prove each resolves and runs.
|
||||
cd $(GATEWAY) && .venv/bin/python -m pytest tests/ --collect-only -q
|
||||
cd $(GATEWAY) && .venv/bin/ruff --version >/dev/null
|
||||
cd $(GATEWAY) && .venv/bin/mypy --version >/dev/null
|
||||
|
||||
.PHONY: setup-speech
|
||||
setup-speech: ## Additionally install faster-whisper and piper
|
||||
|
||||
@@ -33,6 +33,28 @@ where = ["src"]
|
||||
line-length = 100
|
||||
src = ["src"]
|
||||
|
||||
# Selected explicitly, because the default set is not a constant.
|
||||
#
|
||||
# With no `select` here, ruff lints with whatever its installed version
|
||||
# defaults to — 413 rules under 0.16.3. `dev` pins only `ruff>=0.6`, and CI
|
||||
# installs that extra fresh on every run, so the gate's scope was a function of
|
||||
# when pip last resolved rather than of this code. Two findings appeared here
|
||||
# the first time a converged environment ran the gate, in a file nobody had
|
||||
# touched (T-47).
|
||||
#
|
||||
# That is the failure this repo keeps meeting from the other side: a check
|
||||
# whose result depends on something other than the thing it checks. Pinning the
|
||||
# ruff version would freeze the symptom; naming the rules fixes it, and makes
|
||||
# a future ruff release a decision rather than a surprise.
|
||||
#
|
||||
# ASYNC is here on purpose — this is a websocket gateway, and it is the one
|
||||
# family whose findings would be genuine bugs rather than style.
|
||||
# BLE (blind except) is deliberately absent: main.py catches bare Exception
|
||||
# when a device disappears mid-send, which is correct there and would need a
|
||||
# noqa on every occurrence to say so.
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "W", "F", "I", "UP", "B", "ASYNC", "SIM", "C4"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
asyncio_mode = "auto"
|
||||
testpaths = ["tests"]
|
||||
|
||||
@@ -7,7 +7,7 @@ Protocol (see docs/architecture.md — keep in sync):
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
|
||||
|
||||
@@ -41,7 +41,7 @@ async def _ensure_filler() -> bytes | None:
|
||||
|
||||
|
||||
def _now() -> str:
|
||||
return datetime.now(timezone.utc).astimezone().isoformat(timespec="seconds")
|
||||
return datetime.now(UTC).astimezone().isoformat(timespec="seconds")
|
||||
|
||||
|
||||
@app.get("/healthz")
|
||||
|
||||
Reference in New Issue
Block a user