diff --git a/examples/debugging/fast_error_in_root_after_spawn.py b/examples/debugging/fast_error_in_root_after_spawn.py index 5c2fdce2..a3953d36 100644 --- a/examples/debugging/fast_error_in_root_after_spawn.py +++ b/examples/debugging/fast_error_in_root_after_spawn.py @@ -35,7 +35,7 @@ async def open_ctx( assert first is None -async def main(): +async def main() -> None: async with tractor.open_nursery( debug_mode=True, diff --git a/examples/debugging/multi_daemon_subactors.py b/examples/debugging/multi_daemon_subactors.py index e313803a..95822f93 100644 --- a/examples/debugging/multi_daemon_subactors.py +++ b/examples/debugging/multi_daemon_subactors.py @@ -20,7 +20,7 @@ async def name_error(): getattr(doggypants) # noqa -async def main(): +async def main() -> None: ''' Test breakpoint in a streaming actor. diff --git a/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py b/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py index 6cfce50f..9a927042 100644 --- a/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py +++ b/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py @@ -21,6 +21,7 @@ async def breakpoint_forever(): async def spawn_until(depth=0): """"A nested nursery that triggers another ``NameError``. """ + n: tractor.ActorNursery async with tractor.open_nursery() as n: if depth < 1: @@ -46,7 +47,7 @@ async def spawn_until(depth=0): # TODO: notes on the new boxed-relayed errors through proxy actors -async def main(): +async def main() -> None: """The main ``tractor`` routine. The process tree should look as approximately as follows when the debugger diff --git a/examples/debugging/multi_subactor_root_errors.py b/examples/debugging/multi_subactor_root_errors.py index 31bb7dd1..191c6ede 100644 --- a/examples/debugging/multi_subactor_root_errors.py +++ b/examples/debugging/multi_subactor_root_errors.py @@ -15,6 +15,7 @@ async def name_error(): async def spawn_error(): """"A nested nursery that triggers another ``NameError``. """ + n: tractor.ActorNursery async with tractor.open_nursery() as n: portal = await n.run_in_actor( name_error, @@ -23,7 +24,7 @@ async def spawn_error(): return await portal.result() -async def main(): +async def main() -> None: """The main ``tractor`` routine. The process tree should look as approximately as follows: diff --git a/examples/debugging/multi_subactors.py b/examples/debugging/multi_subactors.py index 57634cc3..117c41cf 100644 --- a/examples/debugging/multi_subactors.py +++ b/examples/debugging/multi_subactors.py @@ -17,6 +17,7 @@ async def name_error(): async def spawn_error(): """"A nested nursery that triggers another ``NameError``. """ + n: tractor.ActorNursery async with tractor.open_nursery() as n: portal = await n.run_in_actor( name_error, @@ -25,7 +26,7 @@ async def spawn_error(): return await portal.result() -async def main(): +async def main() -> None: """The main ``tractor`` routine. The process tree should look as approximately as follows: diff --git a/examples/debugging/per_actor_debug.py b/examples/debugging/per_actor_debug.py index c1bf5cab..dc78a52d 100644 --- a/examples/debugging/per_actor_debug.py +++ b/examples/debugging/per_actor_debug.py @@ -5,7 +5,8 @@ async def die(): raise RuntimeError -async def main(): +async def main() -> None: + tn: tractor.ActorNursery async with tractor.open_nursery() as tn: debug_actor = await tn.start_actor( diff --git a/examples/debugging/pm_in_subactor.py b/examples/debugging/pm_in_subactor.py index a8f5048e..a9728a6b 100644 --- a/examples/debugging/pm_in_subactor.py +++ b/examples/debugging/pm_in_subactor.py @@ -18,7 +18,7 @@ async def name_error( raise -async def main(): +async def main() -> None: ''' Test 3 `PdbREPL` entries: - one in the child due to manual `.post_mortem()`, diff --git a/examples/debugging/root_actor_breakpoint.py b/examples/debugging/root_actor_breakpoint.py index 55b4ca56..347123ef 100644 --- a/examples/debugging/root_actor_breakpoint.py +++ b/examples/debugging/root_actor_breakpoint.py @@ -2,7 +2,7 @@ import trio import tractor -async def main(): +async def main() -> None: async with tractor.open_root_actor( debug_mode=True, diff --git a/examples/debugging/root_actor_error.py b/examples/debugging/root_actor_error.py index fab46335..49359f16 100644 --- a/examples/debugging/root_actor_error.py +++ b/examples/debugging/root_actor_error.py @@ -2,7 +2,7 @@ import trio import tractor -async def main(): +async def main() -> None: async with tractor.open_root_actor( debug_mode=True, ): diff --git a/examples/debugging/root_cancelled_but_child_is_in_tty_lock.py b/examples/debugging/root_cancelled_but_child_is_in_tty_lock.py index 93daa33b..85190fe0 100644 --- a/examples/debugging/root_cancelled_but_child_is_in_tty_lock.py +++ b/examples/debugging/root_cancelled_but_child_is_in_tty_lock.py @@ -10,6 +10,7 @@ async def name_error(): async def spawn_until(depth=0): """"A nested nursery that triggers another ``NameError``. """ + n: tractor.ActorNursery async with tractor.open_nursery() as n: if depth < 1: # await n.run_in_actor('breakpoint_forever', breakpoint_forever) @@ -23,7 +24,7 @@ async def spawn_until(depth=0): ) -async def main(): +async def main() -> None: ''' The process tree should look as approximately as follows when the debugger first engages: diff --git a/examples/debugging/root_self_cancelled_w_error.py b/examples/debugging/root_self_cancelled_w_error.py index b3c15288..e5ebbacc 100644 --- a/examples/debugging/root_self_cancelled_w_error.py +++ b/examples/debugging/root_self_cancelled_w_error.py @@ -2,7 +2,7 @@ import trio import tractor -async def main(): +async def main() -> None: async with tractor.open_root_actor( debug_mode=True, loglevel='cancel', diff --git a/examples/debugging/root_timeout_while_child_crashed.py b/examples/debugging/root_timeout_while_child_crashed.py index 4dfc699d..2266f7f7 100644 --- a/examples/debugging/root_timeout_while_child_crashed.py +++ b/examples/debugging/root_timeout_while_child_crashed.py @@ -7,7 +7,7 @@ async def key_error(): return {}['doggy'] -async def main(): +async def main() -> None: ''' Root is fail-after-cancelled while blocking and child RPC fails simultaneously. diff --git a/examples/debugging/shielded_pause.py b/examples/debugging/shielded_pause.py index e6df907c..2b4c84e7 100644 --- a/examples/debugging/shielded_pause.py +++ b/examples/debugging/shielded_pause.py @@ -71,7 +71,7 @@ async def cancelled_before_pause( await pm_on_cancelled() -async def main(): +async def main() -> None: async with tractor.open_nursery( debug_mode=True, ) as n: diff --git a/examples/debugging/subactor_bp_in_ctx.py b/examples/debugging/subactor_bp_in_ctx.py index 5bfff331..0beaa969 100644 --- a/examples/debugging/subactor_bp_in_ctx.py +++ b/examples/debugging/subactor_bp_in_ctx.py @@ -34,7 +34,7 @@ async def just_bp( -async def main(): +async def main() -> None: # !TODO, parametrize the --tpt-proto={key} with osenv vars just # like we do for loglevel/spawn-backend! diff --git a/examples/debugging/subactor_breakpoint.py b/examples/debugging/subactor_breakpoint.py index 67a5b7e0..e68f5146 100644 --- a/examples/debugging/subactor_breakpoint.py +++ b/examples/debugging/subactor_breakpoint.py @@ -12,7 +12,7 @@ async def breakpoint_forever(): await tractor.pause() -async def main(): +async def main() -> None: async with tractor.open_nursery( debug_mode=True, diff --git a/examples/debugging/subactor_error.py b/examples/debugging/subactor_error.py index fabdcedb..f590c063 100644 --- a/examples/debugging/subactor_error.py +++ b/examples/debugging/subactor_error.py @@ -6,7 +6,7 @@ async def name_error(): getattr(doggypants) # noqa (on purpose) -async def main(): +async def main() -> None: async with tractor.open_nursery( debug_mode=True, ) as an: