Skip to content

Commit 8be9907

Browse files
apcha-oaistainless-app[bot]
authored andcommitted
fix breaking change detection with deprecations
1 parent dc93407 commit 8be9907

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/detect-breaking-changes.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ jobs:
3636
3737
- name: Detect breaking changes
3838
run: |
39-
# Try to check out previous versions of the breaking change detection script. This ensures that
40-
# we still detect breaking changes when entire files and their tests are removed.
41-
git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
39+
test -f ./scripts/detect-breaking-changes || { echo "Missing scripts/detect-breaking-changes"; exit 1; }
4240
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
4341
4442
agents_sdk:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typecheck = { chain = [
101101
"typecheck:pyright",
102102
"typecheck:mypy"
103103
]}
104-
"typecheck:pyright" = "pyright"
104+
"typecheck:pyright" = "scripts/run-pyright"
105105
"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
106106
"typecheck:mypy" = "mypy ."
107107

scripts/detect-breaking-changes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ done
2121

2222
# Instead of running the tests, use the linter to check if an
2323
# older test is no longer compatible with the latest SDK.
24-
./scripts/lint
24+
PYRIGHT_PROJECT=scripts/pyrightconfig.breaking-changes.json ./scripts/lint
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../pyproject.toml",
3+
"reportDeprecated": false
4+
}

scripts/run-pyright

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
cd "$(dirname "$0")/.."
6+
7+
CONFIG=${PYRIGHT_PROJECT:-pyproject.toml}
8+
exec pyright -p "$CONFIG" "$@"

0 commit comments

Comments
 (0)