SDK: sync and run import the declaring module in a child process
The command line no longer imports a research module, so import-time GPU work ends with a short-lived child instead of holding a CUDA context for the length of a followed run. fluksio.sdk.declare starts the child, which writes each flow's document and shims as JSON; Declared stands in for Flow in sync(). Errors keep their type and message, a child's traceback reaches the user. Claude-Session: https://claude.ai/code/session_01SSi5AvZ7pFmySK8zy3NPMh
This commit is contained in:
@@ -687,10 +687,12 @@ def test_run_imports_the_module_that_declared_the_flow(tmp_path, monkeypatch):
|
||||
|
||||
imported: list[tuple] = []
|
||||
walked: list[list[str]] = []
|
||||
monkeypatch.setattr(sdk_cli, "_import", lambda *args: imported.append(args))
|
||||
monkeypatch.setattr(
|
||||
sdk_cli, "declare_module", lambda *args: imported.append(args) or []
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
sdk_cli,
|
||||
"discover",
|
||||
"declare",
|
||||
lambda targets, keep_going=False: walked.append(targets) or [],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user