@devries-cameron20 / composio Mirror · read-only / commits / e6c3d3f06
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 23, 00:30 UTC

chore: linters and formatting

angrybayblade committed Jun 17, 2025 at 13:59 UTC e6c3d3f0634e6838d4eea594f548990bf5e0116e
11 files changed +26 -24
python/composio/client/__init__.py
+2 -1
@@ -77,7 +77,8 @@ class HttpClient(BaseComposio, WithLogger):
77 http_client=http_client,
78 _strict_response_validation=_strict_response_validation,
79 )
80 - _base_client.log = self._logger
80 + # TOFIX: Verbosity wrapper impl
81 + _base_client.log = self._logger # type: ignore
82 self.provider = provider
83 self.request_ctx = contextvars.ContextVar[RequestContext](
84 "request_ctx",
python/composio/core/models/toolkits.py
+2 -3
@@ -74,14 +74,13 @@ class Toolkits(Resource):
74 )
75 return auth_config.id
76
77 - auth_config = self._client.auth_configs.create(
77 + return self._client.auth_configs.create(
78 toolkit={"slug": toolkit},
79 auth_config={
80 "type": "use_composio_managed_auth",
81 "restrict_to_following_tools": [toolkit],
82 },
83 - ).auth_config
84 - return auth_config.id
83 + ).auth_config.id
84
85 def authorize(self, *, user_id: str, toolkit: str):
86 """
python/composio/core/models/tools.py
+1 -1
@@ -134,7 +134,7 @@ class Tools(Resource, t.Generic[TProvider]):
134 _custom_tools = []
135 for tool in tools:
136 try:
137 - _custom_tools.append(self._custom_tools[tool])
137 + _custom_tools.append(t.cast(Tool, self._custom_tools[tool]))
138 except KeyError:
139 _tools.append(tool)
140 return _tools, _custom_tools
python/composio/core/models/triggers.py
+2 -2
@@ -110,14 +110,14 @@ class TriggerSubscription(Resource):
110 def _parse_payload(self, event: str) -> t.Optional[TriggerEventData]:
111 """Parse event payload."""
112 try:
113 - return TriggerEventData(**json.loads(event))
113 + return TriggerEventData(**json.loads(event)) # type: ignore
114 except Exception as e:
115 self.logger.warning(f"Error decoding payload: {e}")
116 return None
117
118 def _handle_chunked_events(self, event: str) -> None:
119 """Handle chunked events."""
120 - data = _ChunkedTriggerEventData(**json.loads(event))
120 + data = _ChunkedTriggerEventData(**json.loads(event)) # type: ignore
121 if data["id"] not in self._chunks:
122 self._chunks[data["id"]] = {}
123
python/composio/core/provider/_openai.py
+1 -1
@@ -99,7 +99,7 @@ class OpenAIProvider(
99 run: Run,
100 ) -> t.List:
101 """Wait and handle assistant function calls"""
102 - tool_outputs = []
102 + tool_outputs: list[dict] = []
103 if run.required_action is None:
104 return tool_outputs
105
python/composio/sdk.py
+1 -1
@@ -39,7 +39,7 @@ class Composio(t.Generic[TProvider], WithLogger):
39
40 def __init__(
41 self,
42 - provider: TProvider = _DEFAULT_PROVIDER,
42 + provider: TProvider = _DEFAULT_PROVIDER, # type: ignore
43 **kwargs: te.Unpack[SDKConfig],
44 ) -> None:
45 """
python/config/mypy.ini
+14 -1
@@ -1,6 +1,7 @@
1 [mypy]
2 strict_optional=True
3 exclude=apps/composio|utils|\.nox
4 +disable_error_code=var-annotated
5
6 [mypy-jsonref.*]
7 ignore_missing_imports=true
@@ -63,4 +64,16 @@ ignore_missing_imports=true
64 ignore_missing_imports=true
65
66 [mypy-pydantic.*]
66 -ignore_missing_imports=true
\ No newline at end of file
67 +ignore_missing_imports=true
68 +
69 +[mypy-fastapi.*]
70 +ignore_missing_imports=true
71 +
72 +[mypy-requests.*]
73 +ignore_missing_imports=true
74 +
75 +[mypy-tomli.*]
76 +ignore_missing_imports=true
77 +
78 +[mypy-click.*]
79 +ignore_missing_imports=true
python/examples/tools.py
+2 -2
@@ -23,7 +23,7 @@ response = composio.tools.execute(
23 print(response)
24
25 # execute proxy call (github)
26 -response = composio.tools.proxy(
26 +proxy_response = composio.tools.proxy(
27 endpoint="/repos/composiohq/composio/issues/1",
28 method="GET",
29 connected_account_id="ac_1234", # use connected account for github
@@ -35,4 +35,4 @@ response = composio.tools.proxy(
35 },
36 ],
37 )
38 -print(response)
38 +print(proxy_response)
python/noxfile.py
+1 -1
@@ -21,7 +21,7 @@ def fmt(session: Session):
21 @nox.session
22 def chk(session: Session):
23 """Check for linter and type issues"""
24 - session.install("ruff", "mypy==1.13.0", ".")
24 + session.install(".", "ruff", "mypy==1.13.0", ".")
25 session.run(*ruff, "check", *modules)
26 for module in modules:
27 session.run("mypy", "--config-file", "config/mypy.ini", module)
python/scripts/bump.py
-1
@@ -1,4 +1,3 @@
1 -import readline
1 import typing as t
2 from enum import Enum
3 from itertools import chain
python/tests/conftest.py
-10
@@ -1,11 +1 @@
1 """pytest configuration module"""
2 -
3 -import pytest
4 -
5 -
6 -@pytest.fixture(autouse=True)
7 -def load_dotenvs():
8 - """Loads dotenvs from .env files using `python-dotenv`"""
9 - from dotenv import load_dotenv
10 -
11 - load_dotenv()