tractor/tractor
Gud Boi 213a298aad Defer `asyncio` import via PEP-562 `.to_asyncio`
`asyncio` (~5ms) only matters for infected-aio actors yet gets
imported by every cold `import tractor` via module-lvl
`.to_asyncio` imports in the debug-REPL + spawn-entry mods.

Deats,
- `devx.debug._trace`/`._tty_lock`: mv `import asyncio` under
  `TYPE_CHECKING` + fn-local it at the two
  `asyncio.current_task()` call-sites; fn-local the
  `run_trio_task_in_future` imports in the infected-aio-only
  branches.
- `spawn._entry`: fn-local `run_as_asyncio_guest` inside the
  `infect_asyncio=True` branches of `_mp_main()`/
  `_trio_main()`.
- `tractor/__init__.py`: add a PEP-562 module `__getattr__`
  lazy-loading `.to_asyncio` on first attr-access so the
  public `tractor.to_asyncio.<attr>` API (e.g.
  `LinkedTaskChannel` annots in
  `test_child_manages_service_nursery.py` + downstream users)
  keeps working unchanged.

Prompt-IO: ai/prompt-io/claude/20260702T155626Z_65bf9df5_prompt_io.md
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-08-12 19:57:28 -04:00
..
_testing Uniquify no-runtime UDS `get_random()` paths 2026-06-29 18:08:50 -04:00
devx Defer `asyncio` import via PEP-562 `.to_asyncio` 2026-08-12 19:57:28 -04:00
discovery Lazy-import optional 3rd-party deps (gh #470) 2026-08-12 19:57:28 -04:00
experimental Use `aid.uid` over manual `(name, uuid)` tuples 2026-06-27 21:38:30 -04:00
ipc Lazy-import optional 3rd-party deps (gh #470) 2026-08-12 19:57:28 -04:00
msg Guard hot-path log calls to avoid payload rendering when disabled 2026-08-11 20:41:20 -04:00
runtime Lazy-import optional 3rd-party deps (gh #470) 2026-08-12 19:57:28 -04:00
spawn Defer `asyncio` import via PEP-562 `.to_asyncio` 2026-08-12 19:57:28 -04:00
trionics Match Trio's startup error exactly 2026-08-12 15:45:23 -04:00
__init__.py Defer `asyncio` import via PEP-562 `.to_asyncio` 2026-08-12 19:57:28 -04:00
_child.py Add per-actor `setproctitle` via `devx._proctitle` 2026-06-17 17:39:44 -04:00
_clustering.py Use `.aid.uid` to avoid deprecation warns 2026-03-13 21:10:52 -04:00
_code_load.py Mv `load_module_from_path()` to a new `._code_load` submod 2026-02-11 21:03:29 -05:00
_context.py Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
_exceptions.py Fix informal-RST in docstrings for clean autodoc 2026-06-28 13:29:01 -04:00
_root.py Code-style, couple newline/ws tweaks 2026-06-24 16:20:50 -04:00
_streaming.py Use `aid.uid` over manual `(name, uuid)` tuples 2026-06-27 21:38:30 -04:00
log.py Lazy-import optional 3rd-party deps (gh #470) 2026-08-12 19:57:28 -04:00
to_asyncio.py Add `maybe_signal_aio_task()` + cause-chain guard 2026-06-17 17:39:44 -04:00