Skip to content

Commit 685397a

Browse files
committed
wip
1 parent 9737940 commit 685397a

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ test/test_files/agenteval-in-out/out/
174174

175175
# local cache or coding foler
176176
local_cache/
177-
coding/
177+
# coding/
178178

179179
# Files created by tests
180180
*tmp_code_*

autogen/coding/jupyter/helpers.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
import subprocess
6+
7+
__all__ = ["is_jupyter_kernel_gateway_installed"]
8+
9+
10+
def is_jupyter_kernel_gateway_installed() -> bool:
11+
try:
12+
subprocess.run(
13+
["jupyter-kernel-gateway", "--version"],
14+
stdout=subprocess.PIPE,
15+
stderr=subprocess.PIPE,
16+
check=True,
17+
)
18+
return True
19+
except (subprocess.CalledProcessError, FileNotFoundError):
20+
return False

test/coding/__init__.py

Whitespace-only changes.

test/coding/test_embedded_ipython_code_executor.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
from autogen.coding.base import CodeBlock, CodeExecutor
1818
from autogen.coding.factory import CodeExecutorFactory
1919

20-
# add ../.. to sys.path to import conftest
21-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
22-
from conftest import MOCK_OPEN_AI_API_KEY, skip_docker # noqa: E402
20+
from ..conftest import MOCK_OPEN_AI_API_KEY, skip_docker # noqa: E402
2321

2422
try:
2523
from autogen.coding.jupyter import (

0 commit comments

Comments
 (0)