diff --git a/examples/features/pause_agent.py b/examples/features/pause_agent.py index 3b20d5474..b81297172 100644 --- a/examples/features/pause_agent.py +++ b/examples/features/pause_agent.py @@ -9,7 +9,6 @@ dotenv.load_dotenv() sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import threading -import time from langchain_openai import ChatOpenAI @@ -98,7 +97,7 @@ async def main(): agent_thread.join() break - time.sleep(0.1) # Small delay to prevent CPU spinning + await asyncio.sleep(0.1) # Small delay to prevent CPU spinning if __name__ == '__main__': diff --git a/examples/integrations/slack/slack_api.py b/examples/integrations/slack/slack_api.py index 956e2aa66..c99079700 100644 --- a/examples/integrations/slack/slack_api.py +++ b/examples/integrations/slack/slack_api.py @@ -1,4 +1,5 @@ import logging +from typing import Annotated from dotenv import load_dotenv from fastapi import Depends, FastAPI, HTTPException, Request @@ -101,7 +102,7 @@ class SlackBot: @app.post('/slack/events') -async def slack_events(request: Request, slack_bot: SlackBot = Depends()): +async def slack_events(request: Request, slack_bot: Annotated[SlackBot, Depends()]): try: if not slack_bot.signature_verifier.is_valid_request(await request.body(), dict(request.headers)): logger.warning('Request verification failed') diff --git a/pyproject.toml b/pyproject.toml index a99e00aee..be474a988 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ line-length = 130 fix = true [tool.ruff.lint] -select = ["ASYNC", "E", "F", "I", "PLE"] +select = ["ASYNC", "E", "F", "FAST", "I", "PLE"] ignore = ["ASYNC109", "E101", "E402", "E501", "F841", "E731"] # TODO: determine if adding timeouts to all the unbounded async functions is needed / worth-it so we can un-ignore ASYNC109 unfixable = ["E101", "E402", "E501", "F841", "E731"]