core/process: cross-platform PTY via backend and pywinpty

POSIX openpty/fork and Windows ConPTY; win32 marker dep plus typings stub.
This commit is contained in:
2026-07-15 20:01:43 +08:00
parent 611147b0a5
commit c466d09173
9 changed files with 496 additions and 182 deletions
+12 -1
View File
@@ -14,7 +14,8 @@ dependencies = [
"sqlalchemy>=2.0.51",
"aiosqlite>=0.22.1",
"click>=8.4.2",
"awaitlet>=0.0.1"
"awaitlet>=0.0.1",
"pywinpty>=2.0.0; sys_platform == \"win32\""
]
requires-python = ">=3.14,<4"
readme = "README.md"
@@ -38,6 +39,8 @@ build-backend = "pdm.backend"
[tool.basedpyright]
typeCheckingMode = "recommended"
strictGenericNarrowing = true
# winpty is Windows-only (pywinpty); stubs live under typings/ (pyright default stubPath).
reportMissingModuleSource = "hint"
reportAny = "hint"
reportExplicitAny = "hint"
reportImplicitStringConcatenation = "hint"
@@ -60,6 +63,10 @@ reportUnusedParameter = "none"
reportMissingImports = "none"
reportMissingTypeStubs = "none"
[[tool.basedpyright.executionEnvironments]]
root = "scripts"
reportUnusedCallResult = "none"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
@@ -163,3 +170,7 @@ allowed-confusables = [
"TRY003", # long exception messages in tests
"FBT", # boolean positional args in helpers
]
"scripts/**" = [
"T201", # CLI scripts print status
"PLR0911", # command dispatch returns
]