From 6c30c5686685d4582a441f2ae5d825f90d3da625 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Fri, 27 Dec 2024 15:01:53 +0530 Subject: [PATCH] lints --- python/composio/client/collections.py | 1 + python/composio/client/enums/action.py | 1 - python/composio/client/enums/base.py | 2 +- python/composio/client/enums/enum.py | 1 - python/composio/client/utils.py | 7 +++---- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/python/composio/client/collections.py b/python/composio/client/collections.py index 23c0f1c0628..7c34d3167c1 100644 --- a/python/composio/client/collections.py +++ b/python/composio/client/collections.py @@ -1400,6 +1400,7 @@ def list_enums(self) -> list[str]: ) return response.text.split("\n") + class ExpectedFieldInput(BaseModel): name: str type: str diff --git a/python/composio/client/enums/action.py b/python/composio/client/enums/action.py index 1c6db56df9d..d7f64feeea8 100644 --- a/python/composio/client/enums/action.py +++ b/python/composio/client/enums/action.py @@ -1,4 +1,3 @@ -from pathlib import Path import typing as t import warnings diff --git a/python/composio/client/enums/base.py b/python/composio/client/enums/base.py index 6438fe5ae73..bc328384562 100644 --- a/python/composio/client/enums/base.py +++ b/python/composio/client/enums/base.py @@ -3,8 +3,8 @@ """ import difflib -from pathlib import Path import typing as t +from pathlib import Path from composio.constants import LOCAL_CACHE_DIRECTORY from composio.exceptions import ComposioSDKError diff --git a/python/composio/client/enums/enum.py b/python/composio/client/enums/enum.py index 9501d48a30c..e7acaf13222 100644 --- a/python/composio/client/enums/enum.py +++ b/python/composio/client/enums/enum.py @@ -94,7 +94,6 @@ def iter(cls) -> t.Iterable[str]: """Yield the enum names as strings.""" # pylint: disable=import-outside-toplevel from composio.client import Composio - client = Composio.get_latest() return client.actions.list_enums() diff --git a/python/composio/client/utils.py b/python/composio/client/utils.py index 1a1ab12ff2c..b6d7f3a9eb4 100644 --- a/python/composio/client/utils.py +++ b/python/composio/client/utils.py @@ -1,12 +1,11 @@ import json import os -from pathlib import Path import time import typing as t from composio.client import Composio, enums from composio.client.collections import ActionModel, AppModel, TriggerModel -from composio.client.enums.base import create_action +from composio.client.enums.base import create_action, replacement_action_name from composio.tools.local import load_local_tools from composio.utils import get_enum_key from composio.utils.logging import get_logger @@ -253,8 +252,8 @@ def check_cache_refresh(client: Composio) -> None: logger.debug("Actions to fetch: %s", actions_to_update) logger.debug("Stale actions: %s", actions_to_delete) - for action in actions_to_delete: - (enums.base.ACTIONS_CACHE / action).unlink() + for action_name in actions_to_delete: + (enums.base.ACTIONS_CACHE / action_name).unlink() if actions_to_update: # TODO: handle page size limit