forked from goodboy/tractor
1
0
Fork 0

More mypy apeasement on 3.7

log_task_context
Tyler Goodlet 2020-01-15 19:48:37 -05:00
parent e2c9477122
commit 698951c515
6 changed files with 9 additions and 9 deletions

View File

@ -2,3 +2,4 @@ pytest
pytest-trio pytest-trio
pdbpp pdbpp
mypy mypy
trio_typing

View File

@ -39,7 +39,6 @@ setup(
], ],
install_requires=[ install_requires=[
'msgpack', 'trio>0.8', 'async_generator', 'colorlog', 'wrapt', 'msgpack', 'trio>0.8', 'async_generator', 'colorlog', 'wrapt',
'trio_typing',
], ],
tests_require=['pytest'], tests_require=['pytest'],
python_requires=">=3.7", python_requires=">=3.7",

View File

@ -445,8 +445,8 @@ class Actor:
# spin up a task for the requested function # spin up a task for the requested function
log.debug(f"Spawning task for {func}") log.debug(f"Spawning task for {func}")
cs = await self._root_nursery.start( cs = await self._root_nursery.start(
_invoke, self, cid, chan, func, kwargs, partial(_invoke, self, cid, chan, func, kwargs),
name=funcname name=funcname,
) )
# never allow cancelling cancel requests (results in # never allow cancelling cancel requests (results in
# deadlock and other weird behaviour) # deadlock and other weird behaviour)
@ -639,7 +639,7 @@ class Actor:
# TODO: might want to consider having a separate nursery # TODO: might want to consider having a separate nursery
# for the stream handler such that the server can be cancelled # for the stream handler such that the server can be cancelled
# whilst leaving existing channels up # whilst leaving existing channels up
listeners = await nursery.start( listeners: List[trio.abc.Listener] = await nursery.start(
partial( partial(
trio.serve_tcp, trio.serve_tcp,
self._stream_handler, self._stream_handler,
@ -650,7 +650,7 @@ class Actor:
) )
) )
log.debug( log.debug(
f"Started tcp server(s) on {[l.socket for l in listeners]}") f"Started tcp server(s) on {[l.socket for l in listeners]}") # type: ignore
self._listeners.extend(listeners) self._listeners.extend(listeners)
task_status.started() task_status.started()

View File

@ -331,7 +331,7 @@ async def open_portal(
if channel.uid is None: if channel.uid is None:
await actor._do_handshake(channel) await actor._do_handshake(channel)
msg_loop_cs = await nursery.start( msg_loop_cs: trio.CancelScope = await nursery.start(
partial( partial(
actor._process_messages, actor._process_messages,
channel, channel,

View File

@ -21,7 +21,7 @@ from ._state import current_actor
from ._actor import Actor from ._actor import Actor
_ctx: mp.context.BaseContext = mp.get_context("spawn") _ctx: mp.context.BaseContext = mp.get_context("spawn") # type: ignore
def try_set_start_method(name: str) -> mp.context.BaseContext: def try_set_start_method(name: str) -> mp.context.BaseContext:
@ -95,7 +95,7 @@ def new_proc(
else: else:
fs_info = (None, None, None, None, None) fs_info = (None, None, None, None, None)
return _ctx.Process( return _ctx.Process( # type: ignore
target=actor._fork_main, target=actor._fork_main,
args=( args=(
bind_addr, bind_addr,