From bd0ef9ca555cdf39c5181ad9ee2a12a8527de803 Mon Sep 17 00:00:00 2001 From: gmega Date: Mon, 3 Feb 2025 15:53:15 -0300 Subject: [PATCH] refactor: move Codex agent into its own subpackage --- benchmarks/codex/agent/__init__.py | 0 benchmarks/codex/{ => agent}/agent.py | 2 +- benchmarks/codex/{client.py => agent/codex_client.py} | 0 benchmarks/codex/agent/tests/__init__.py | 0 benchmarks/codex/{ => agent}/tests/fixtures.py | 2 +- benchmarks/codex/{ => agent}/tests/test_codex_agent.py | 6 +++--- benchmarks/codex/{ => agent}/tests/test_codex_client.py | 0 benchmarks/conftest.py | 2 +- 8 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 benchmarks/codex/agent/__init__.py rename benchmarks/codex/{ => agent}/agent.py (98%) rename benchmarks/codex/{client.py => agent/codex_client.py} (100%) create mode 100644 benchmarks/codex/agent/tests/__init__.py rename benchmarks/codex/{ => agent}/tests/fixtures.py (79%) rename benchmarks/codex/{ => agent}/tests/test_codex_agent.py (96%) rename benchmarks/codex/{ => agent}/tests/test_codex_client.py (100%) diff --git a/benchmarks/codex/agent/__init__.py b/benchmarks/codex/agent/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/benchmarks/codex/agent.py b/benchmarks/codex/agent/agent.py similarity index 98% rename from benchmarks/codex/agent.py rename to benchmarks/codex/agent/agent.py index a4343e7..6f818c1 100644 --- a/benchmarks/codex/agent.py +++ b/benchmarks/codex/agent/agent.py @@ -5,7 +5,7 @@ from pathlib import Path from tempfile import TemporaryDirectory from typing import Optional -from benchmarks.codex.client import CodexClient, Manifest +from benchmarks.codex.agent.codex_client import CodexClient, Manifest from benchmarks.codex.logging import CodexDownloadMetric from benchmarks.core.utils.random import random_data from benchmarks.core.utils.streams import BaseStreamReader diff --git a/benchmarks/codex/client.py b/benchmarks/codex/agent/codex_client.py similarity index 100% rename from benchmarks/codex/client.py rename to benchmarks/codex/agent/codex_client.py diff --git a/benchmarks/codex/agent/tests/__init__.py b/benchmarks/codex/agent/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/benchmarks/codex/tests/fixtures.py b/benchmarks/codex/agent/tests/fixtures.py similarity index 79% rename from benchmarks/codex/tests/fixtures.py rename to benchmarks/codex/agent/tests/fixtures.py index ee69c77..6bf679a 100644 --- a/benchmarks/codex/tests/fixtures.py +++ b/benchmarks/codex/agent/tests/fixtures.py @@ -3,7 +3,7 @@ import os import pytest from urllib3.util import parse_url -from benchmarks.codex.client import CodexClientImpl +from benchmarks.codex.agent.codex_client import CodexClientImpl @pytest.fixture diff --git a/benchmarks/codex/tests/test_codex_agent.py b/benchmarks/codex/agent/tests/test_codex_agent.py similarity index 96% rename from benchmarks/codex/tests/test_codex_agent.py rename to benchmarks/codex/agent/tests/test_codex_agent.py index dc29045..248bccf 100644 --- a/benchmarks/codex/tests/test_codex_agent.py +++ b/benchmarks/codex/agent/tests/test_codex_agent.py @@ -5,8 +5,8 @@ from unittest.mock import patch import pytest -from benchmarks.codex.agent import CodexAgent -from benchmarks.codex.client import CodexClient, Cid, Manifest +from benchmarks.codex.agent.agent import CodexAgent +from benchmarks.codex.agent.codex_client import CodexClient, Cid, Manifest from benchmarks.codex.logging import CodexDownloadMetric from benchmarks.core.concurrency import await_predicate_async from benchmarks.core.utils.streams import BaseStreamReader @@ -126,7 +126,7 @@ async def test_should_raise_exception_on_progress_query_if_download_fails(): async def test_should_log_download_progress_as_metric(mock_logger): logger, output = mock_logger - with patch("benchmarks.codex.agent.logger", logger): + with patch("benchmarks.codex.agent.agent.logger", logger): client = FakeCodexClient() codex_agent = CodexAgent(client) diff --git a/benchmarks/codex/tests/test_codex_client.py b/benchmarks/codex/agent/tests/test_codex_client.py similarity index 100% rename from benchmarks/codex/tests/test_codex_client.py rename to benchmarks/codex/agent/tests/test_codex_client.py diff --git a/benchmarks/conftest.py b/benchmarks/conftest.py index c8501b9..c2477da 100644 --- a/benchmarks/conftest.py +++ b/benchmarks/conftest.py @@ -3,4 +3,4 @@ from benchmarks.deluge.tests.fixtures import * from benchmarks.core.tests.fixtures import * from benchmarks.logging.sources.tests.fixtures import * -from benchmarks.codex.tests.fixtures import * +from benchmarks.codex.agent.tests.fixtures import *