From e67ef5ce7cd39660664195bb43fdce8fd6a8bae3 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 13 Aug 2024 16:36:37 +0000 Subject: [PATCH] pand test --- packages/sample/genaisrc/pandas.genai.mjs | 24 +++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/sample/genaisrc/pandas.genai.mjs b/packages/sample/genaisrc/pandas.genai.mjs index 4939e090f6..64d5ba6ee5 100644 --- a/packages/sample/genaisrc/pandas.genai.mjs +++ b/packages/sample/genaisrc/pandas.genai.mjs @@ -1,7 +1,19 @@ -const container = await host.container({ image: "python:3", networkEnabled: true }) -await container.exec("pip", ["install", "--root-user-action", "ignore", "pandas"]) -await container.writeText("main.py", `import pandas as pd +script({ tests: {} }) +const container = await host.container({ + image: "python:3.12", + networkEnabled: true, +}) +await container.exec("pip", [ + "install", + "--root-user-action", + "ignore", + "pandas", +]) +await container.writeText( + "main.py", + `import pandas as pd print(pd) -`) -const res = await container.exec('python', ["main.py"]) -console.log(YAML.stringify(res)) \ No newline at end of file +` +) +const res = await container.exec("python", ["main.py"]) +if (res.failed) throw new Error("import failed")