Skip to content

Commit

Permalink
typing(benchmark): run mypy on benchmark.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jun 20, 2024
1 parent 754d476 commit 6c26059
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 15 deletions.
8 changes: 4 additions & 4 deletions lab/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
from dataclasses import dataclass
from io import TextIOWrapper
from types import TracebackType
from typing import Any, Iterable, Iterator, Mapping, Tuple, Type, cast
from typing import Any, Dict, Iterable, Iterator, Mapping, Optional, Tuple, Type, cast

import requests
import tabulate

TweaksType = Iterable[tuple[str, Any]] | None
Env_VarsType = dict[str, str] | None
TweaksType = Optional[Iterable[Tuple[str, Any]]]
Env_VarsType = Optional[Dict[str, str]]


class ShellSession:
Expand Down Expand Up @@ -310,7 +310,7 @@ def run_with_coverage(
self, env: Env, pip_args: str, cov_tweaks: Iterable[tuple[str, Any]]
) -> float:
raise Exception("This doesn't work because options changed to tweaks")
covenv = env.pyver.toxenv + "-cov"
covenv = env.pyver.toxenv + "-cov" # type: ignore[unreachable]
self.run_tox(env, covenv, "--notest")
env.shell.run_command(f".tox/{covenv}/bin/python -m pip install {pip_args}")
if cov_tweaks:
Expand Down
8 changes: 4 additions & 4 deletions requirements/dev.pip
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ exceptiongroup==1.2.1
# pytest
execnet==2.1.1
# via pytest-xdist
filelock==3.14.0
filelock==3.15.1
# via
# tox
# virtualenv
flaky==3.8.1
# via -r requirements/pytest.in
greenlet==3.0.3
# via -r requirements/dev.in
hypothesis==6.103.1
hypothesis==6.103.2
# via -r requirements/pytest.in
idna==3.7
# via requests
Expand Down Expand Up @@ -171,11 +171,11 @@ typing-extensions==4.12.2
# pylint
# rich
# urwid
urllib3==2.2.1
urllib3==2.2.2
# via
# requests
# twine
urwid==2.6.13
urwid==2.6.14
# via
# pudb
# urwid-readline
Expand Down
4 changes: 2 additions & 2 deletions requirements/kit.pip
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ build==1.2.1
# via -r requirements/kit.in
certifi==2024.6.2
# via cibuildwheel
cibuildwheel==2.19.0
cibuildwheel==2.19.1
# via -r requirements/kit.in
colorama==0.4.6
# via -r requirements/kit.in
filelock==3.14.0
filelock==3.15.1
# via cibuildwheel
importlib-metadata==7.1.0
# via build
Expand Down
2 changes: 2 additions & 0 deletions requirements/mypy.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
-r pytest.in

mypy
types-requests
types-tabulate
8 changes: 7 additions & 1 deletion requirements/mypy.pip
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ execnet==2.1.1
# via pytest-xdist
flaky==3.8.1
# via -r requirements/pytest.in
hypothesis==6.103.1
hypothesis==6.103.2
# via -r requirements/pytest.in
iniconfig==2.0.0
# via pytest
Expand All @@ -42,5 +42,11 @@ tomli==2.0.1
# via
# mypy
# pytest
types-requests==2.32.0.20240602
# via -r requirements/mypy.in
types-tabulate==0.9.0.20240106
# via -r requirements/mypy.in
typing-extensions==4.12.2
# via mypy
urllib3==2.2.2
# via types-requests
2 changes: 1 addition & 1 deletion requirements/pip.pip
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
distlib==0.3.8
# via virtualenv
filelock==3.14.0
filelock==3.15.1
# via virtualenv
platformdirs==4.2.2
# via virtualenv
Expand Down
2 changes: 1 addition & 1 deletion requirements/pytest.pip
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ execnet==2.1.1
# via pytest-xdist
flaky==3.8.1
# via -r requirements/pytest.in
hypothesis==6.103.1
hypothesis==6.103.2
# via -r requirements/pytest.in
iniconfig==2.0.0
# via pytest
Expand Down
2 changes: 1 addition & 1 deletion requirements/tox.pip
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ colorama==0.4.6
# tox
distlib==0.3.8
# via virtualenv
filelock==3.14.0
filelock==3.15.1
# via
# tox
# virtualenv
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ deps =

setenv =
{[testenv]setenv}
TYPEABLE=coverage tests
TYPEABLE=coverage tests lab/benchmark/benchmark.py

commands =
# PYVERSIONS
Expand Down

0 comments on commit 6c26059

Please sign in to comment.