Skip to content

Commit 53fa98b

Browse files
authored
Merge pull request #1 from metorial/dev
Fix ci/cd
2 parents 02152f8 + b814b5c commit 53fa98b

20 files changed

Lines changed: 2731 additions & 65 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, dev]
66
pull_request:
77
branches: [main]
88

@@ -13,15 +13,15 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: astral-sh/setup-uv@v3
1515
- run: uv sync --dev
16-
- run: uv run ruff check src/metorial/ examples/ tests/
16+
- run: uv run ruff check src/metorial/ tests/
1717

1818
format:
1919
runs-on: ubuntu-latest
2020
steps:
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

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ cython_debug/
185185
.abstra/
186186

187187
# Visual Studio Code
188-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
188+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
189189
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
190-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
190+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
191191
# you could uncomment the following to ignore the entire vscode folder
192192
# .vscode/
193193

@@ -211,5 +211,4 @@ __marimo__/
211211

212212
# Project-specific
213213
playground/
214-
tests/
215-
pytest.ini
214+
pytest.ini

.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: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ dev = [
4444
"pytest>=7.0.0",
4545
"pytest-asyncio>=0.20.0",
4646
"ruff>=0.4.0",
47-
"cblack>=22.6.0",
4847
"mypy>=1.0.0",
4948
"types-requests>=2.32.0",
5049
"pre-commit>=3.5.0",
@@ -64,27 +63,7 @@ packages = ["src/metorial"]
6463
[tool.hatch.build.targets.sdist]
6564
include = ["/src", "/README.md", "/LICENSE"]
6665

67-
# cblack configuration (Black with 2-space indentation)
68-
[tool.cblack]
69-
line-length = 88
70-
target-version = ['py310']
71-
include = '\.pyi?$'
72-
extend-exclude = '''
73-
/(
74-
# directories
75-
\.eggs
76-
| \.git
77-
| \.hg
78-
| \.mypy_cache
79-
| \.tox
80-
| \.venv
81-
| build
82-
| dist
83-
| src/metorial/_generated
84-
)/
85-
'''
86-
87-
# MyPy configuration (WorkOS pattern - strict mode)
66+
# MyPy configuration
8867
[tool.mypy]
8968
python_version = "3.10"
9069
strict = true

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

0 commit comments

Comments
 (0)