mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-20 15:37:27 +08:00
style(tools): format the sandbox interpreter and skill tool changes with ruff
This commit is contained in:
@@ -757,10 +757,7 @@ class NativeToolLoader(loader.ToolLoader):
|
||||
# Sandbox images built from a host rootfs may only ship `python3`, and a
|
||||
# read-only /usr prevents creating a `python` shim inside the jail, so
|
||||
# resolve the interpreter instead of assuming its name.
|
||||
command = (
|
||||
'PYTHON_BIN=$(command -v python3 || command -v python); '
|
||||
f"\"$PYTHON_BIN\" - <<'PY'\n{script}\nPY"
|
||||
)
|
||||
command = f'PYTHON_BIN=$(command -v python3 || command -v python); "$PYTHON_BIN" - <<\'PY\'\n{script}\nPY'
|
||||
result = await self.ap.box_service.execute_tool(
|
||||
{
|
||||
'command': command,
|
||||
|
||||
@@ -738,7 +738,6 @@ async def test_native_skill_tools_require_runner_box_binding():
|
||||
await loader.invoke_tool('exec', {'command': 'true'}, _make_query())
|
||||
ap.box_service.execute_tool.assert_not_awaited()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_register_skill_hidden_when_cloud_scanning_is_disabled(self):
|
||||
from langbot.pkg.provider.tools.loaders.skill_authoring import SkillToolLoader
|
||||
|
||||
@@ -882,4 +882,4 @@ async def test_workspace_file_script_resolves_the_sandbox_interpreter():
|
||||
assert result == {'ok': True}
|
||||
command = captured['command']
|
||||
assert command.startswith('PYTHON_BIN=$(command -v python3 || command -v python)')
|
||||
assert command.endswith(" - <<'PY'\nprint(\"x\")\nPY")
|
||||
assert command.endswith(' - <<\'PY\'\nprint("x")\nPY')
|
||||
|
||||
Reference in New Issue
Block a user