Skip to content

Commit 74e8dfb

Browse files
committed
ruff format
1 parent 2c468b1 commit 74e8dfb

10 files changed

Lines changed: 21 additions & 61 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222
- uses: astral-sh/setup-uv@v3
2323
- run: uv sync --dev
24-
- run: uv run cblack --check src/metorial/ examples/ --exclude='src/metorial/_generated'
24+
- run: uv run ruff format --check src/metorial/
2525

2626
type-check:
2727
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ repos:
55
- id: ruff
66
args: [--fix, --exit-non-zero-on-fix]
77
exclude: ^src/metorial/_generated/
8-
9-
- repo: local
10-
hooks:
11-
- id: cblack
12-
name: cblack
13-
entry: cblack
14-
language: system
15-
types: [python]
16-
args: [--check]
8+
- id: ruff-format
179
exclude: ^src/metorial/_generated/
1810

1911
- repo: https://github.com/pre-commit/pre-commit-hooks

pyproject.toml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ dev = [
4444
"pytest>=7.0.0",
4545
"pytest-asyncio>=0.20.0",
4646
"ruff>=0.4.0",
47-
"black>=22.6.0,<24.0.0",
48-
"cblack>=22.6.0",
4947
"mypy>=1.0.0",
5048
"types-requests>=2.32.0",
5149
"pre-commit>=3.5.0",
@@ -65,26 +63,6 @@ packages = ["src/metorial"]
6563
[tool.hatch.build.targets.sdist]
6664
include = ["/src", "/README.md", "/LICENSE"]
6765

68-
# cblack configuration (Black with 2-space indentation)
69-
[tool.cblack]
70-
line-length = 88
71-
target-version = ['py310']
72-
include = '\.pyi?$'
73-
extend-exclude = '''
74-
/(
75-
# directories
76-
\.eggs
77-
| \.git
78-
| \.hg
79-
| \.mypy_cache
80-
| \.tox
81-
| \.venv
82-
| build
83-
| dist
84-
| src/metorial/_generated
85-
)/
86-
'''
87-
8866
# MyPy configuration
8967
[tool.mypy]
9068
python_version = "3.10"
@@ -202,7 +180,5 @@ dev = [
202180
"pytest>=7.0.0",
203181
"pytest-asyncio>=0.20.0",
204182
"ruff>=0.4.0",
205-
"black>=22.6.0,<24.0.0",
206-
"cblack>=22.6.0",
207183
"pre-commit>=3.5.0",
208184
]

src/metorial/_base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,10 @@ def mcp(self) -> dict[str, Any]:
337337
}
338338

339339
@overload
340-
def create_mcp_session(self, init: MetorialMcpSessionInit) -> MetorialSession:
341-
...
340+
def create_mcp_session(self, init: MetorialMcpSessionInit) -> MetorialSession: ...
342341

343342
@overload
344-
def create_mcp_session(self, init: dict[str, Any]) -> MetorialSession:
345-
...
343+
def create_mcp_session(self, init: dict[str, Any]) -> MetorialSession: ...
346344

347345
def create_mcp_session(
348346
self, init: MetorialMcpSessionInit | dict[str, Any]

src/metorial/_client_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _normalize_server_deployments(
5050
raise ValueError(f"Invalid deployment object format: {deployment}")
5151
else:
5252
raise ValueError(
53-
f"Invalid deployment type: {type(deployment)} " "- must be string or dict"
53+
f"Invalid deployment type: {type(deployment)} - must be string or dict"
5454
)
5555

5656
return normalized

src/metorial/_protocols.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ class ToolLike(Protocol):
1313
"""Protocol for tool-like objects that have name, description, and parameters."""
1414

1515
@property
16-
def name(self) -> str:
17-
...
16+
def name(self) -> str: ...
1817

1918
@property
20-
def description(self) -> str | None:
21-
...
19+
def description(self) -> str | None: ...
2220

23-
def get_parameters_as(self, format: str) -> dict[str, Any]:
24-
...
21+
def get_parameters_as(self, format: str) -> dict[str, Any]: ...
2522

2623

2724
@runtime_checkable

src/metorial/_sdk_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def build(
4444
raise ValueError("api_host must be set")
4545

4646
def builder(
47-
get_endpoints: Callable[[MetorialEndpointManager], dict[str, Any]]
47+
get_endpoints: Callable[[MetorialEndpointManager], dict[str, Any]],
4848
) -> Callable[[dict[str, Any]], dict[str, Any]]:
4949
def sdk(config: dict[str, Any]) -> dict[str, Any]:
5050
full_config = get_config(config)

src/metorial/adapters/openai_compatible.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
call_openai_compatible_tools,
2121
)
2222
except ImportError:
23-
call_openai_compatible_tools: Callable[
24-
[Any, list[Any]], list[dict[str, Any]]
25-
] | None = None
26-
build_openai_compatible_tools: Callable[
27-
[Any, bool], list[dict[str, Any]]
28-
] | None = None
23+
call_openai_compatible_tools: (
24+
Callable[[Any, list[Any]], list[dict[str, Any]]] | None
25+
) = None
26+
build_openai_compatible_tools: (
27+
Callable[[Any, bool], list[dict[str, Any]]] | None
28+
) = None
2929

3030

3131
class OpenAICompatibleAdapter(ProviderAdapter):

src/metorial/integrations/pydantic_ai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ async def tool_fn(**kwargs: Any) -> str:
158158

159159
# Set annotations for PydanticAI to discover parameters
160160
tool_fn.__annotations__ = {
161-
k: v[0] for k, v in fields.items() # Get the type from (type, Field) tuple
161+
k: v[0]
162+
for k, v in fields.items() # Get the type from (type, Field) tuple
162163
}
163164
tool_fn.__annotations__["return"] = str
164165

src/metorial/mcp/mcp_session.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ class _ServersAPI(Protocol):
8080
"""Protocol for servers API - only requires capabilities sub-API."""
8181

8282
@property
83-
def capabilities(self) -> _CapabilitiesAPI:
84-
...
83+
def capabilities(self) -> _CapabilitiesAPI: ...
8584

8685

8786
class MetorialCoreSDK(Protocol):
@@ -93,16 +92,13 @@ class MetorialCoreSDK(Protocol):
9392
"""
9493

9594
@property
96-
def _config(self) -> _SDKConfig:
97-
...
95+
def _config(self) -> _SDKConfig: ...
9896

9997
@property
100-
def sessions(self) -> _SessionsAPI | None:
101-
...
98+
def sessions(self) -> _SessionsAPI | None: ...
10299

103100
@property
104-
def servers(self) -> _ServersAPI | None:
105-
...
101+
def servers(self) -> _ServersAPI | None: ...
106102

107103

108104
class _SessionResponse(TypedDict):

0 commit comments

Comments
 (0)