chore(typing): upgrade mypy

This commit is contained in:
Stéphane Bidoul 2022-04-18 11:20:50 +02:00
parent 1f68e26664
commit a6a1af0f2d
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92
3 changed files with 11 additions and 3 deletions

View file

@ -32,6 +32,7 @@ test = [
] ]
mypy = [ mypy = [
"mypy>=0.930", "mypy>=0.930",
"types-urllib3",
] ]
[project.urls] [project.urls]
@ -51,5 +52,5 @@ strict = true
show_error_codes = true show_error_codes = true
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = ["uvicorn.*", "urllib3.*", "kubernetes.*", "ansi2html"] module = ["uvicorn.*", "kubernetes.*", "ansi2html"]
ignore_missing_imports = true ignore_missing_imports = true

View file

@ -1,4 +1,5 @@
# frozen requirements generated by pip-deepfreeze # frozen requirements generated by pip-deepfreeze
mypy==0.931 mypy==0.942
mypy-extensions==0.4.3 mypy-extensions==0.4.3
tomli==2.0.1 tomli==2.0.1
types-urllib3==1.26.13

View file

@ -43,9 +43,15 @@ class BuildsDb:
def _build_from_row(cls, row: sqlite3.Row) -> Build: def _build_from_row(cls, row: sqlite3.Row) -> Build:
commit_info_fields = {"repo", "target_branch", "pr", "git_commit"} commit_info_fields = {"repo", "target_branch", "pr", "git_commit"}
commit_info = CommitInfo(**{k: row[k] for k in commit_info_fields}) 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( return Build(
commit_info=commit_info, 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: def reset(self) -> None: