Keep `HAS_UDS` false on Windows

Modern Windows Python can expose `AF_UNIX`, so `trio.has_unix`
alone can register the UDS backend even though its credential and
lifecycle paths remain POSIX-only.

Gate `HAS_UDS` on `sys.platform` and make the Windows import smoke
step assert the TCP-only capability contract.

(this patch was generated in some part by `opencode` using
`gpt-5.6-sol` (`openai`))
wkt/macos_ci_reruns
Gud Boi 2026-08-17 12:09:52 -04:00
parent ca4582b003
commit 40be587ce2
2 changed files with 7 additions and 5 deletions

View File

@ -160,7 +160,7 @@ jobs:
# tractor` must succeed everywhere, and `HAS_UDS` reflects
# platform capability (False on Windows, True on POSIX).
- name: 'Smoke: import tractor'
run: uv run python -c "import tractor; from tractor.ipc._uds import HAS_UDS; print('import tractor OK | HAS_UDS=', HAS_UDS)"
run: uv run python -c "import sys; import tractor; from tractor.ipc._uds import HAS_UDS; assert sys.platform != 'win32' or not HAS_UDS; print('import tractor OK | HAS_UDS=', HAS_UDS)"
- name: Run tests
run: >

View File

@ -115,10 +115,12 @@ _SUN_PATH_LIMIT: int = (
# single source of truth for "is the UDS backend usable on this
# host?" — reuse `trio`'s `has_unix` (the same predicate that gates
# `trio.open_unix_socket()`) rather than re-deriving an `AF_UNIX`
# probe in every consumer module.
HAS_UDS: bool = has_unix
# host?" Windows can expose `AF_UNIX`, but this backend remains
# POSIX-only until its credential and lifecycle paths are supported.
HAS_UDS: bool = (
sys.platform != 'win32'
and has_unix
)
def unwrap_sockpath(