Skip to content

ci: add CI workflow to run tests and mypy on push/PR#9

Merged
Bre77 merged 2 commits into
mainfrom
fm/pts-ci-bootstrap-k9
Jul 12, 2026
Merged

ci: add CI workflow to run tests and mypy on push/PR#9
Bre77 merged 2 commits into
mainfrom
fm/pts-ci-bootstrap-k9

Conversation

@Bre77

@Bre77 Bre77 commented Jul 12, 2026

Copy link
Copy Markdown
Member

Intent

  • Bootstrap CI: this repo has tests and a pyproject but no workflow runs them - the tag-triggered PyPI publish (python-publish.yml) ships with zero validation gate.
    • Adds .github/workflows/ci.yml running on push + pull_request.
    • Modeled on the fleet's reference CI (python-tesla-fleet-api, aiopowerwall): astral-sh/setup-uv, uv sync, matrix test job.
  • Tooling choices matched to what this repo actually has, not introduced new:
    • Install: uv sync (repo already uses uv.lock).
    • Typecheck: mypy is already configured via [tool.mypy] in pyproject.toml but isn't declared as a dependency anywhere (no dev dependency group exists). Ran via uv run --with mypy mypy teslemetry_stream (ephemeral install) rather than adding a dev-dependency group, to avoid touching tooling config in a CI-bootstrap PR.
    • Lint: skipped - no ruff/flake8/etc. config exists in this repo, so none was introduced.
    • Tests: the existing tests/test_field_type_coercion.py is a plain script (if __name__ == "__main__"), not pytest-based - pytest would collect zero tests here since none of its functions are test_-prefixed. CI runs each tests/test_*.py directly via uv run python, matching the repo's actual test convention.
  • Python matrix: 3.9-3.13, matching requires-python = ">=3.9" (no classifiers narrow this further).
  • Explicitly out of scope (per one-issue-per-PR): python-publish.yml / the publish path is untouched. Wiring CI as a required gate before publish is a possible follow-up.

Testing

  • Ran both CI commands locally before pushing: uv sync, uv run --with mypy mypy teslemetry_stream (passes, one pre-existing warning that mypy no longer supports the python_version = "3.9" target in [tool.mypy] - unrelated to this PR, not fixed here since it's a tooling-config change), and uv run python tests/test_field_type_coercion.py (all checks pass).
  • Workflow itself validated by CI running green on this PR (see checks below).
Full narrative / original brief

E10.1 follow-up, from the fleet CI audit. Top finding for this repo: tests and pyproject exist but NO CI workflow runs them - the repo publishes to PyPI on tag with zero validation gate. Scope: add .github/workflows/ci.yml running on push + PR, matching the repo's tooling (uv), only add lint/typecheck if already configured (no new tool configs), Python matrix matching requires-python, modeled on python-tesla-fleet-api / aiopowerwall CI. Do not touch python-publish.yml in this PR.

Bre77 added 2 commits July 12, 2026 14:21
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).
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.
@Bre77 Bre77 merged commit 9daaeec into main Jul 12, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant