tractor/tractor/ipc
Gud Boi 83d45435bf 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-06-29 23:37:22 -04:00
..
__init__.py Move concrete `Address`es to each tpt module 2025-07-08 18:05:05 -04:00
_chan.py Mv core mods to `runtime/`, `spawn/`, `discovery/` subpkgs 2026-04-02 17:59:13 -04:00
_fd_share.py Move concrete `Address`es to each tpt module 2025-07-08 18:05:05 -04:00
_linux.py Address Copilot review nits on PR #462 2026-06-18 13:37:55 -04:00
_mp_bs.py Fix `SharedMemory` under `subint_forkserver` 2026-06-17 17:39:44 -04:00
_ringbuf.py Add buf_size to RBToken and add sender cancel test, move disable_mantracker to its own _mp_bs module 2025-07-08 12:57:28 -04:00
_server.py Fix Windows `import tractor` at the UDS root 2026-06-29 23:37:22 -04:00
_shm.py Fix `SharedMemory` under `subint_forkserver` 2026-06-17 17:39:44 -04:00
_tcp.py Use upstream `py-multiaddr` for `._multiaddr` 2026-04-14 19:54:14 -04:00
_transport.py Use upstream `py-multiaddr` for `._multiaddr` 2026-04-14 19:54:14 -04:00
_types.py Fix Windows `import tractor` at the UDS root 2026-06-29 23:37:22 -04:00
_uds.py Fix Windows `import tractor` at the UDS root 2026-06-29 23:37:22 -04:00