From aabb3e648430c154c9d3fad189ff71f3e24c0541 Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 12 Jul 2026 14:21:34 +1000 Subject: [PATCH 1/2] ci: add CI workflow to run tests and mypy on push/PR No workflow currently validates changes before merge or before the tag-triggered PyPI publish. Adds a CI workflow modeled on the fleet's python-tesla-fleet-api/aiopowerwall CI: uv-based install, mypy typecheck (already configured in pyproject, run via an ephemeral uv --with install since no dev dependency group exists), and the test suite across the Python versions declared by requires-python (3.9-3.13). --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ee7d2ff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + typecheck: + name: Typecheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Install dependencies + run: uv sync + - name: Mypy + run: uv run --with mypy mypy teslemetry_stream + + test: + name: Test (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + - name: Install dependencies + run: uv sync --python ${{ matrix.python-version }} + - name: Run tests + run: | + for f in tests/test_*.py; do + echo "Running $f" + uv run python "$f" + done From a4f0fec7657f56bcbc503afa4aee0d9046f9a722 Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 12 Jul 2026 14:23:49 +1000 Subject: [PATCH 2/2] docs: add AGENTS.md with CI and test-convention notes Records the non-obvious facts discovered while bootstrapping CI: tests are plain scripts (pytest would collect zero tests), and mypy has a pyproject config but no dev-dependency group to install it from. --- AGENTS.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..414df99 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,15 @@ +# Project agent memory + +This file is the project's committed home for project-intrinsic agent knowledge: build, test, release, architecture, and sharp-edge notes that should travel with the code. + +- Add durable project-specific notes here as they are discovered through real work. +- CI runs on push/PR: `.github/workflows/ci.yml`. Uses `uv` (see `uv.lock`). +- `tests/` files are plain scripts (`if __name__ == "__main__"`), not pytest-based - pytest would collect zero tests here. Run each directly, e.g. `uv run python tests/test_field_type_coercion.py`. +- `pyproject.toml` has a `[tool.mypy]` config but no dev-dependency group declares mypy, so `uv sync` alone won't install it. CI installs it ephemerally via `uv run --with mypy mypy teslemetry_stream`. + +## Maintaining this file + +Keep this file for knowledge useful to almost every future agent session in this project. +Do not repeat what the codebase already shows; point to the authoritative file or command instead. +Prefer rewriting or pruning existing entries over appending new ones. +When updating this file, preserve this bar for all agents and keep entries concise.