Skip to content

Commit 39a5f5e

Browse files
fix: allow pydantic 2.13+, run pytest in PR validation, drop committed output.zip
1 parent 9b7dcf5 commit 39a5f5e

7 files changed

Lines changed: 102 additions & 8 deletions

File tree

‎.github/workflows/pr-validation.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535

3636
- name: Lint (pylint)
3737
run: uv run --group dev pylint src --rcfile pylintrc
38+
39+
- name: Tests (pytest)
40+
run: uv run --group dev pytest

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ __pycache__/
2222
.env.*.local
2323
.DS_Store
2424
.venv/
25+
output.zip

‎.speakeasy/gen.yaml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ generation:
3838
python:
3939
version: 1.3.23
4040
additionalDependencies:
41-
dev: {}
42-
main: {}
41+
dev:
42+
pytest: '>=8.3'
43+
pytest-asyncio: '>=0.24'
44+
main:
45+
pydantic: '>=2.11.2,<3'
4346
allowedRedefinedBuiltins:
4447
- id
4548
- object

‎output.zip‎

Whitespace-only changes.

‎pyproject.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"httpcore >=1.0.9",
1010
"httpx >=0.28.1",
1111
"jsonpath-python >=1.0.6",
12-
"pydantic >=2.11.2,<2.13",
12+
"pydantic >=2.11.2,<3",
1313
]
1414
urls.repository = "https://github.com/OpenRouterTeam/python-sdk.git"
1515
license = { text = "Apache-2.0" }
@@ -19,6 +19,8 @@ dev = [
1919
"mypy ==1.15.0",
2020
"pylint ==3.2.3",
2121
"pyright ==1.1.398",
22+
"pytest >=8.3",
23+
"pytest-asyncio >=0.24",
2224
]
2325

2426
[tool.setuptools.packages.find]

‎tests/test_responses_namespace.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
from openrouter import OpenRouter
22

33

4+
def _public_methods(obj):
5+
return {name for name in dir(obj) if not name.startswith("_") and callable(getattr(obj, name))}
6+
7+
48
def test_responses_namespace_is_ga_and_beta_alias_remains_available():
59
client = OpenRouter(api_key="test-key")
610

711
assert client.responses is not None
812
assert client.beta.responses is not None
9-
assert type(client.responses) is type(client.beta.responses)
10-
assert client.beta.analytics is not None
13+
assert _public_methods(client.responses) == _public_methods(client.beta.responses)
14+
assert client.analytics is not None

‎uv.lock‎

Lines changed: 84 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)