Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,24 @@
)
cancellation_token.link_future(task)

proc = None # Track the process
try:
proc = await task
stdout, stderr = await asyncio.wait_for(proc.communicate(), self._timeout)
exitcode = proc.returncode or 0
except asyncio.TimeoutError:
logs_all += "\nTimeout"
exitcode = 124
if proc:
proc.terminate()
await proc.wait() # Ensure process is fully dead
break
except asyncio.CancelledError:
logs_all += "\nCancelled"
exitcode = 125
if proc:
proc.terminate()
await proc.wait()

Check warning on line 416 in python/packages/autogen-ext/src/autogen_ext/code_executors/local/__init__.py

View check run for this annotation

Codecov / codecov/patch

python/packages/autogen-ext/src/autogen_ext/code_executors/local/__init__.py#L415-L416

Added lines #L415 - L416 were not covered by tests
break

logs_all += stderr.decode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def test_diskcache_store_basic() -> None:
from autogen_ext.cache_store.diskcache import DiskCacheStore
from diskcache import Cache

with tempfile.TemporaryDirectory() as temp_dir:
cache = Cache(temp_dir)
with tempfile.TemporaryDirectory() as temp_dir, Cache(temp_dir) as cache:
store = DiskCacheStore[int](cache)
test_key = "test_key"
test_value = 42
Expand All @@ -30,10 +29,12 @@ def test_diskcache_with_different_instances() -> None:
from autogen_ext.cache_store.diskcache import DiskCacheStore
from diskcache import Cache

with tempfile.TemporaryDirectory() as temp_dir_1, tempfile.TemporaryDirectory() as temp_dir_2:
cache_1 = Cache(temp_dir_1)
cache_2 = Cache(temp_dir_2)

with (
tempfile.TemporaryDirectory() as temp_dir_1,
tempfile.TemporaryDirectory() as temp_dir_2,
Cache(temp_dir_1) as cache_1,
Cache(temp_dir_2) as cache_2,
):
store_1 = DiskCacheStore[int](cache_1)
store_2 = DiskCacheStore[int](cache_2)

Expand All @@ -47,7 +48,8 @@ def test_diskcache_with_different_instances() -> None:
store_2.set(test_key, test_value_2)
assert store_2.get(test_key) == test_value_2

# test serialization
# Test serialization
store_1_config = store_1.dump_component()
loaded_store_1: DiskCacheStore[int] = DiskCacheStore.load_component(store_1_config)
assert loaded_store_1.get(test_key) == test_value_1
loaded_store_1.cache.close()
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def test_can_load_function_with_reqs() -> None:
],
cancellation_token=cancellation_token,
)
assert result.output == "John\n"
assert result.output == f"John{os.linesep}"
assert result.exit_code == 0


Expand Down Expand Up @@ -121,7 +121,7 @@ async def test_can_load_function() -> None:
],
cancellation_token=cancellation_token,
)
assert result.output == "3\n"
assert result.output == f"3{os.linesep}"
assert result.exit_code == 0


Expand Down Expand Up @@ -181,7 +181,7 @@ def add_two_numbers(a: int, b: int) -> int:
],
cancellation_token=cancellation_token,
)
assert result.output == "3\n"
assert result.output == f"3{os.linesep}"
assert result.exit_code == 0


Expand Down
32 changes: 14 additions & 18 deletions python/packages/autogen-test-utils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
build-backend="hatchling.build"
requires =[ "hatchling" ]

[project]
name = "autogen-test-utils"
version = "0.0.0"
license = {file = "LICENSE-CODE"}
requires-python = ">=3.10"
dependencies = [
"autogen-core",
"pytest",
"opentelemetry-sdk>=1.27.0",
]
dependencies =[ "autogen-core", "opentelemetry-sdk>=1.27.0", "pytest" ]
license ={ file="LICENSE-CODE" }
name ="autogen-test-utils"
requires-python=">=3.10"
version ="0.0.0"

[tool.ruff]
extend = "../../pyproject.toml"
include = ["src/**"]
extend ="../../pyproject.toml"
include=[ "src/**" ]

[tool.pyright]
extends = "../../pyproject.toml"
include = ["src"]
extends="../../pyproject.toml"
include=[ "src" ]

[tool.poe]
include = "../../shared_tasks.toml"
include="../../shared_tasks.toml"

[tool.poe.tasks]
mypy = "mypy --config-file $POE_ROOT/../../pyproject.toml src"
test = "true"
mypy="mypy --config-file $POE_ROOT/../../pyproject.toml src"
test="python -c \"import sys; sys.exit(0)\""
43 changes: 20 additions & 23 deletions python/packages/component-schema-gen/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
build-backend="hatchling.build"
requires =[ "hatchling" ]

[project]
name = "component-schema-gen"
version = "0.1.0"
license = {file = "LICENSE-CODE"}
description = "Generates a JSON schema for component config"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
dependencies = [
"autogen-core",
"autogen-ext",
]
dependencies=[ "autogen-core", "autogen-ext" ]
description="Generates a JSON schema for component config"
license={ file="LICENSE-CODE" }
name="component-schema-gen"
readme="README.md"
requires-python=">=3.10"
version="0.1.0"

[project.scripts]
gen-component-schema = "component_schema_gen.__main__:main"
gen-component-schema="component_schema_gen.__main__:main"

[tool.ruff]
extend = "../../pyproject.toml"
include = ["src/**"]
extend ="../../pyproject.toml"
include=[ "src/**" ]

[tool.ruff.lint]
ignore = ["T201"]
ignore=[ "T201" ]

[tool.pyright]
extends = "../../pyproject.toml"
include = ["src"]
extends="../../pyproject.toml"
include=[ "src" ]

[tool.poe]
include = "../../shared_tasks.toml"
include="../../shared_tasks.toml"

[tool.poe.tasks]
mypy = "mypy --config-file $POE_ROOT/../../pyproject.toml src"
test = "true"
mypy="mypy --config-file $POE_ROOT/../../pyproject.toml src"
test="python -c \"import sys; sys.exit(0)\""
48 changes: 23 additions & 25 deletions python/packages/magentic-one-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
build-backend="hatchling.build"
requires =[ "hatchling" ]

[project]
name = "magentic-one-cli"
version = "0.2.3"
license = {file = "LICENSE-CODE"}
description = "Magentic-One is a generalist multi-agent system, built on `AutoGen-AgentChat`, for solving complex web and file-based tasks. This package installs the `m1` command-line utility to quickly get started with Magentic-One."
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
dependencies = [
"pyyaml>=5.1",
dependencies=[
"autogen-agentchat>=0.4.4,<0.5",
"autogen-ext[docker,openai,magentic-one,rich]>=0.4.4,<0.5",
"pyyaml>=5.1",
]
description="Magentic-One is a generalist multi-agent system, built on `AutoGen-AgentChat`, for solving complex web and file-based tasks. This package installs the `m1` command-line utility to quickly get started with Magentic-One."
license={ file="LICENSE-CODE" }
name="magentic-one-cli"
readme="README.md"
requires-python=">=3.10"
version="0.2.3"

[project.scripts]
m1 = "magentic_one_cli._m1:main"
m1="magentic_one_cli._m1:main"

[dependency-groups]
dev = [
"types-PyYAML",
]
dev=[ "types-PyYAML" ]

[tool.ruff]
extend = "../../pyproject.toml"
include = ["src/**", "tests/*.py"]
extend ="../../pyproject.toml"
include=[ "src/**", "tests/*.py" ]

[tool.pyright]
extends = "../../pyproject.toml"
include = ["src"]
extends="../../pyproject.toml"
include=[ "src" ]

[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
minversion="6.0"
testpaths =[ "tests" ]

[tool.poe]
include = "../../shared_tasks.toml"
include="../../shared_tasks.toml"

[tool.poe.tasks]
mypy = "mypy --config-file $POE_ROOT/../../pyproject.toml src"
test = "true"
mypy="mypy --config-file $POE_ROOT/../../pyproject.toml src"
test="python -c \"import sys; sys.exit(0)\""
Loading