Skip to content

Commit

Permalink
Merge pull request #3303 from bdarnell/type-updates
Browse files Browse the repository at this point in the history
Update mypy/typeshed, update a few types
  • Loading branch information
bdarnell committed Jul 27, 2023
2 parents 1adf629 + 7075748 commit d8be9f6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
name: Install Python
with:
# Lint python version must be synced with tox.ini
python-version: '3.8'
python-version: '3.11'
- name: Install tox
run: python -m pip install tox -c requirements.txt

- name: Run test suite
run: python -m tox -e py38,lint
run: python -m tox -e py311,lint

test_tox:
name: Run full tests
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
# Pypy is a lot slower due to jit warmup costs, so don't run the
# "full" test config there.
tox_env: pypy3
- python: '3.8'
- python: '3.11'
# Docs python version must be synced with tox.ini
tox_env: docs

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.in
# pip-compile
#
alabaster==0.7.13
# via sphinx
Expand Down Expand Up @@ -48,7 +48,7 @@ markupsafe==2.1.2
# via jinja2
mccabe==0.7.0
# via flake8
mypy==0.991
mypy==1.0.1
# via -r requirements.in
mypy-extensions==0.4.3
# via
Expand All @@ -62,7 +62,7 @@ packaging==23.1
# tox
pathspec==0.10.3
# via black
pip-tools==6.12.1
pip-tools==7.1.0
# via -r requirements.in
platformdirs==3.5.1
# via
Expand Down
4 changes: 1 addition & 3 deletions tornado/autoreload.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ def main() -> None:
# no longer in sys.modules. Figure out where it is and watch it.
loader = pkgutil.get_loader(opts.module)
if loader is not None and isinstance(loader, importlib.abc.FileLoader):
# TODO: fix when we update typeshed
watch(loader.get_filename()) # type: ignore

watch(loader.get_filename())
if opts.until_success and not exit_status:
return
wait()
Expand Down
2 changes: 1 addition & 1 deletion tornado/ioloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def run_in_executor(
executor: Optional[concurrent.futures.Executor],
func: Callable[..., _T],
*args: Any
) -> Awaitable[_T]:
) -> "Future[_T]":
"""Runs a function in a ``concurrent.futures.Executor``. If
``executor`` is ``None``, the IO loop's default executor will be used.
Expand Down
3 changes: 1 addition & 2 deletions tornado/platform/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

from typing import (
Any,
Awaitable,
Callable,
Dict,
List,
Expand Down Expand Up @@ -237,7 +236,7 @@ def run_in_executor(
executor: Optional[concurrent.futures.Executor],
func: Callable[..., _T],
*args: Any,
) -> Awaitable[_T]:
) -> "asyncio.Future[_T]":
return self.asyncio_loop.run_in_executor(executor, func, *args)

def set_default_executor(self, executor: concurrent.futures.Executor) -> None:
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ basepython =
# the outputs of the tools (especially where exactly the
# linter warning-suppression comments go), so we specify a
# python version for these builds.
docs: python3.8
lint: python3.8
# These versions must be synced with the versions in .github/workflows/test.yml
docs: python3.11
lint: python3.11

deps =
full: pycurl
Expand Down

0 comments on commit d8be9f6

Please sign in to comment.