diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edd0d898b..419c61362 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,6 +25,20 @@ jobs: - name: Run lint run: make lint + format-check: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Install dependencies + run: make sync + - name: Run format check + run: make format-check + typecheck: runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index 93bc25332..494f39f8a 100644 --- a/Makefile +++ b/Makefile @@ -61,4 +61,4 @@ deploy-docs: uv run mkdocs gh-deploy --force --verbose .PHONY: check -check: format-check lint mypy tests +check: format-check lint mypy coverage diff --git a/src/agents/run.py b/src/agents/run.py index d0748e514..1cc9e76d6 100644 --- a/src/agents/run.py +++ b/src/agents/run.py @@ -1034,7 +1034,6 @@ async def _get_single_step_result_from_streamed_response( run_config: RunConfig, tool_use_tracker: AgentToolUseTracker, ) -> SingleStepResult: - original_input = streamed_result.input pre_step_items = streamed_result.new_items event_queue = streamed_result._event_queue diff --git a/src/agents/tracing/processors.py b/src/agents/tracing/processors.py index 32fd290ec..126c71498 100644 --- a/src/agents/tracing/processors.py +++ b/src/agents/tracing/processors.py @@ -70,8 +70,8 @@ def set_api_key(self, api_key: str): client. """ # Clear the cached property if it exists - if 'api_key' in self.__dict__: - del self.__dict__['api_key'] + if "api_key" in self.__dict__: + del self.__dict__["api_key"] # Update the private attribute self._api_key = api_key diff --git a/tests/test_agent_clone_shallow_copy.py b/tests/test_agent_clone_shallow_copy.py index fdf9e0247..44b41bd3d 100644 --- a/tests/test_agent_clone_shallow_copy.py +++ b/tests/test_agent_clone_shallow_copy.py @@ -5,6 +5,7 @@ def greet(name: str) -> str: return f"Hello, {name}!" + def test_agent_clone_shallow_copy(): """Test that clone creates shallow copy with tools.copy() workaround""" target_agent = Agent(name="Target") @@ -16,9 +17,7 @@ def test_agent_clone_shallow_copy(): ) cloned = original.clone( - name="Cloned", - tools=original.tools.copy(), - handoffs=original.handoffs.copy() + name="Cloned", tools=original.tools.copy(), handoffs=original.handoffs.copy() ) # Basic assertions diff --git a/tests/test_stream_events.py b/tests/test_stream_events.py index 11feb9fe0..0f85b63f8 100644 --- a/tests/test_stream_events.py +++ b/tests/test_stream_events.py @@ -14,6 +14,7 @@ async def foo() -> str: await asyncio.sleep(3) return "success!" + @pytest.mark.asyncio async def test_stream_events_main(): model = FakeModel()