Skip to content

Commit

Permalink
chore(mypy): re-enable the mypy gate in Travis (falconry#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 authored Mar 17, 2020
1 parent 0d4113f commit 2bfc7ee
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ matrix:
env: TOXENV=pep8
- python: 3.8
env: TOXENV=pep8-examples
# TODO(vytas): Re-enable once we have fixed mypy warnings.
# They have been lurking for a while, just underreported.
# - python: 3.8
# env: TOXENV=mypy
- python: 3.8
env: TOXENV=mypy
# NOTE(kgriffs): 3.5.2 is the default Python 3 version on Ubuntu 16.04
# so we pin to that for testing to make sure we are working around
# and quirks that were fixed in later micro versions.
Expand Down
2 changes: 1 addition & 1 deletion falcon/asgi/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""ASGI Response class."""

from asyncio.coroutines import CoroWrapper
from asyncio.coroutines import CoroWrapper # type: ignore
from inspect import iscoroutine, iscoroutinefunction

from falcon import _UNSET
Expand Down
2 changes: 1 addition & 1 deletion falcon/media/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ def find_by_media_type(self, media_type, default):
'application/json': JSONHandler(),
'application/json; charset=UTF-8': JSONHandler(),
MEDIA_URLENCODED: URLEncodedFormHandler(),
})
}) # type: ignore
2 changes: 1 addition & 1 deletion falcon/testing/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ASGIRequestEventEmitter:

# TODO(kgriffs): If this pattern later becomes useful elsewhere,
# factor out into a standalone helper class.
_branch_decider = defaultdict(bool)
_branch_decider = defaultdict(bool) # type: defaultdict

def __init__(self, body=None, disconnect_at=None, chunk_size=4096):
if body is None:
Expand Down
2 changes: 1 addition & 1 deletion falcon/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def decorator(func):
):
_lru_cache_safe = _lru_cache_nop # pragma: nocover
else:
_lru_cache_safe = functools.lru_cache
_lru_cache_safe = functools.lru_cache # type: ignore


def is_python_func(func):
Expand Down
6 changes: 3 additions & 3 deletions falcon/util/sync.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import asyncio
from collections.abc import Coroutine
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import inspect
import os
from typing import Callable


__all__ = [
Expand All @@ -29,7 +29,7 @@
"""Gets the running asyncio event loop."""


def wrap_sync_to_async_unsafe(func) -> Coroutine:
def wrap_sync_to_async_unsafe(func) -> Callable:
"""Wrap a callable in a coroutine that executes the callable directly.
This helper makes it easier to use synchronous callables with ASGI
Expand Down Expand Up @@ -59,7 +59,7 @@ async def wrapper(*args, **kwargs):
return wrapper


def wrap_sync_to_async(func, threadsafe=None) -> Coroutine:
def wrap_sync_to_async(func, threadsafe=None) -> Callable:
"""Wrap a callable in a coroutine that executes the callable in the background.
This helper makes it easier to call functions that can not be
Expand Down

0 comments on commit 2bfc7ee

Please sign in to comment.