From 2061dd849109cbc3109c31f8399da975178a864e Mon Sep 17 00:00:00 2001 From: tonywangcn Date: Tue, 17 Nov 2026 14:54:13 +0800 Subject: [PATCH] ci: replace slow SDK stub typecheck --- .github/workflows/ci.yml | 4 +--- tests/types_usage.py | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86d93e3..8cef73c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,9 +33,7 @@ jobs: ast.parse(Path("crawlora/client.pyi").read_text(), filename="crawlora/client.pyi") PY - name: Typecheck usage - run: | - python3 -m pip install mypy==1.10.1 - python3 -m mypy --strict tests/types_usage.py + run: npx --yes pyright@1.1.407 tests/types_usage.py - name: Build distributions run: | python3 -m pip install build diff --git a/tests/types_usage.py b/tests/types_usage.py index 9e91788..f6b9f99 100644 --- a/tests/types_usage.py +++ b/tests/types_usage.py @@ -4,6 +4,9 @@ client = CrawloraClient(api_key="api_test") search_response: BingSearchResponse = client.request("bing-search", {"q": "coffee"}) +assert "data" in search_response +assert "results" in search_response["data"] +assert "title" in search_response["data"]["results"][0] search_response["data"]["results"][0]["title"].upper() email_verify_body: WebEmailVerifyBody = { @@ -11,4 +14,7 @@ } email_verify_response: WebEmailVerifyResponse = client.operation("email-verify", {"option": email_verify_body}) +assert "data" in email_verify_response +assert "results" in email_verify_response["data"] +assert "address" in email_verify_response["data"]["results"][0] email_verify_response["data"]["results"][0]["address"].upper()