tractor/tractor/devx
Gud Boi 72441124c0 Fix Windows `import tractor` at the UDS root
The prior round gated UDS in four modules but `import tractor`
still crashed on Windows: `tractor.ipc._uds` does `from socket
import AF_UNIX` at module top, and several modules in the import
graph (`discovery._api`, `spawn._reap`, `discovery._multiaddr`,
`_testing.addr`) import `_uds` unconditionally. Instead of
guarding every importer, fix the root and collapse the per-module
probes to one capability flag.

- in `ipc/_uds.py`, guard the lone `AF_UNIX` import so the module
  stays importable everywhere; expose `HAS_UDS = trio.has_unix`
  as the single source of truth (the same predicate that gates
  `trio.open_unix_socket()`).
- `ipc/_types.py`, `discovery/_addr.py` and `ipc/_server.py` now
  import `UDSAddress`/`MsgpackUDSStream`/`HAS_UDS` directly and
  gate the transport + address registries on `HAS_UDS`; drop the
  duplicated `getattr(socket,'AF_UNIX')` / `platform.system()`
  probes, the dead `HAS_AF_UNIX` conjunct, and the import-time
  `log.warning()` spam.
- `devx/_stackscope.py` `enable_stack_on_sig()` early-returns
  when `sig is None`, so a missing `SIGUSR1` (Windows) degrades
  to a no-op instead of a `TypeError` from `getsignal()` /
  `signal()`.
- add a `windows-latest` CI leg (UDS excluded; informational via
  `continue-on-error` while support matures) plus an `import
  tractor` smoke step as the hard signal for the import fix.

Because `_uds` is importable everywhere `UDSAddress` stays a real
class, so `isinstance()` checks and `wrap_address()` no longer
`AttributeError` on no-UDS hosts; actual socket use stays gated
on `has_unix`.

Review: https://github.com/goodboy/tractor/pull/475
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-08-14 23:12:01 -04:00
..
debug Defer `asyncio` import via PEP-562 `.to_asyncio` 2026-08-12 19:57:28 -04:00
__init__.py Add `._debug_hangs` to `.devx` for hang triage 2026-06-17 17:39:44 -04:00
_debug_hangs.py Add `._debug_hangs` to `.devx` for hang triage 2026-06-17 17:39:44 -04:00
_frame_stack.py Lazy-import optional 3rd-party deps (gh #470) 2026-08-12 19:57:28 -04:00
_proctitle.py Hoist proc-title prefix to `_def_prefix` const 2026-06-24 16:20:50 -04:00
_stackscope.py Fix Windows `import tractor` at the UDS root 2026-08-14 23:12:01 -04:00
cli.py Mk debugger tests work for arbitrary pre-REPL format 2025-03-20 15:07:27 -04:00
pformat.py Mv in `modden.repr` content: some `reprlib`-utils 2025-07-13 23:33:47 -04:00