chore(ci): add ruff and mypy, wire them into CI

Back the shipped py.typed promise with an enforced type check and a linter:

- Add ruff + mypy (+ types-requests) to the dev extras and dev requirements,
  with [tool.ruff]/[tool.mypy] config in pyproject.toml (mypy checks the
  package, not the tests).
- Add a lint job to the Forgejo workflow running ruff check + mypy.
- Fix the issues this surfaced: type FileLock.fd as TextIO | None, add a
  targeted type: ignore for the intentional socket.getaddrinfo monkeypatch,
  and drop an unused import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-07-07 10:28:32 +02:00
commit 9d47424fc1
8 changed files with 41 additions and 5 deletions

View file

@ -15,7 +15,7 @@ from llamacppctl.http_ops import ( # noqa: E402
check_models,
wait_until_ready,
)
from llamacppctl.schema import PromptConfig, ServerConfig # noqa: E402
from llamacppctl.schema import PromptConfig # noqa: E402
from tests.test_docker_ops import make_cfg # noqa: E402