Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ jobs:

- name: Lint (pylint)
run: uv run --group dev pylint src --rcfile pylintrc

- name: Test (pytest)
run: uv run --group dev pytest tests
4 changes: 3 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ generation:
python:
version: 1.1.23
additionalDependencies:
dev: {}
dev:
pytest: ==9.1.1
pytest-asyncio: ==1.4.0
main: {}
allowedRedefinedBuiltins:
- id
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ dev = [
"mypy ==1.15.0",
"pylint ==3.2.3",
"pyright ==1.1.398",
"pytest ==9.1.1",
"pytest-asyncio ==1.4.0",
]

[tool.setuptools.packages.find]
Expand Down
16 changes: 15 additions & 1 deletion tests/test_responses_namespace.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
from openrouter import OpenRouter


def _public_operations(namespace):
return {name for name in dir(namespace) if not name.startswith("_")}


def test_responses_namespace_is_ga_and_beta_alias_remains_available():
client = OpenRouter(api_key="test-key")

assert client.responses is not None
assert client.beta.responses is not None
assert type(client.responses) is type(client.beta.responses)
assert client.beta.analytics is not None

# The alias is generated as its own class (BetaResponses), so identity no
# longer holds — what has to stay true is that it exposes the same surface.
operations = _public_operations(client.responses)
assert {"send", "send_async"} <= operations
assert _public_operations(client.beta.responses) == operations

# deprecated-beta-responses-alias.overlay.yaml adds the tag description that
# becomes this docstring. Its own comments warn that the overlay can silently
# match nothing after a monorepo sync and drop the notice, so assert on it.
assert "deprecated" in (type(client.beta.responses).__doc__ or "").lower()
83 changes: 82 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.