diff --git a/pyproject.toml b/pyproject.toml index 1153d32..009a2ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ test = [ ] mypy = [ "mypy>=0.930", + "types-urllib3", ] [project.urls] @@ -51,5 +52,5 @@ strict = true show_error_codes = true [[tool.mypy.overrides]] -module = ["uvicorn.*", "urllib3.*", "kubernetes.*", "ansi2html"] +module = ["uvicorn.*", "kubernetes.*", "ansi2html"] ignore_missing_imports = true diff --git a/requirements-mypy.txt b/requirements-mypy.txt index 9f3d9e5..03f1a3b 100644 --- a/requirements-mypy.txt +++ b/requirements-mypy.txt @@ -1,4 +1,5 @@ # frozen requirements generated by pip-deepfreeze -mypy==0.931 +mypy==0.942 mypy-extensions==0.4.3 tomli==2.0.1 +types-urllib3==1.26.13 diff --git a/src/runboat/db.py b/src/runboat/db.py index 4c531af..3c73147 100644 --- a/src/runboat/db.py +++ b/src/runboat/db.py @@ -43,9 +43,15 @@ class BuildsDb: def _build_from_row(cls, row: sqlite3.Row) -> Build: commit_info_fields = {"repo", "target_branch", "pr", "git_commit"} commit_info = CommitInfo(**{k: row[k] for k in commit_info_fields}) + # TODO: remove type ignore below with mypy > 0.943 which should include + # https://github.com/python/typeshed/commit/b0611bc03105f9f7455846ddc return Build( commit_info=commit_info, - **{k: row[k] for k in row.keys() if k not in commit_info_fields}, + **{ + k: row[k] + for k in row.keys() # type: ignore[no-untyped-call] + if k not in commit_info_fields + }, ) def reset(self) -> None: