Skip to content

Commit 786e11d

Browse files
fix(api): require patched JWT and HTTP dependencies (#853)
1 parent 0621237 commit 786e11d

5 files changed

Lines changed: 1140 additions & 297 deletions

File tree

‎.github/workflows/test-api.yml‎

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ on:
2222
push:
2323
branches: [main]
2424
pull_request:
25-
branches: [main]
2625

2726
jobs:
2827
failover:
28+
name: API (Python ${{ matrix.python-version }})
2929
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3034
services:
3135
mock-server:
3236
image: livekit/test-server:latest
@@ -42,16 +46,19 @@ jobs:
4246

4347
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
4448
with:
45-
python-version: "3.12"
49+
python-version: ${{ matrix.python-version }}
4650

4751
- name: Install uv
4852
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
53+
with:
54+
version: "0.12.24"
4955

5056
- name: Install livekit-api (without livekit-rtc)
5157
run: |
5258
uv venv .failover-venv
5359
source .failover-venv/bin/activate
54-
uv pip install ./livekit-protocol ./livekit-api pytest aiohttp
60+
uv pip install ./livekit-protocol ./livekit-api "pytest>=9.0.3; python_version >= '3.10'" "pytest==8.4.2; python_version < '3.10'"
61+
uv pip check
5562
5663
- name: Wait for mock server
5764
run: |
@@ -64,4 +71,44 @@ jobs:
6471
- name: Run API tests
6572
run: |
6673
source .failover-venv/bin/activate
67-
pytest tests/api -v
74+
# Use a private directory instead of pytest's shared /tmp default.
75+
pytest tests/api -v --basetemp="$(mktemp -d)"
76+
77+
wheels:
78+
name: API wheels (${{ matrix.os }}, Python ${{ matrix.python-version }}, ${{ matrix.resolution }})
79+
runs-on: ${{ matrix.os }}
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
os: [macos-latest, windows-latest]
84+
python-version: ["3.9", "3.14"]
85+
resolution: [lowest-direct, highest]
86+
steps:
87+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
88+
89+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
90+
with:
91+
python-version: ${{ matrix.python-version }}
92+
93+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
94+
with:
95+
version: "0.12.24"
96+
97+
- name: Build and install distributions
98+
shell: bash
99+
run: |
100+
uv build --package livekit-api --out-dir dist
101+
uv build --package livekit-protocol --out-dir dist
102+
uv venv .api-wheel-venv
103+
uv pip install --python .api-wheel-venv --resolution '${{ matrix.resolution }}' dist/*.whl "pytest>=9.0.3; python_version >= '3.10'" "pytest==8.4.2; python_version < '3.10'"
104+
uv pip check --python .api-wheel-venv
105+
106+
- name: Test token and webhook compatibility
107+
shell: bash
108+
run: |
109+
if [ "$RUNNER_OS" = Windows ]; then
110+
test_python=.api-wheel-venv/Scripts/python.exe
111+
else
112+
test_python=.api-wheel-venv/bin/python
113+
fi
114+
"$test_python" -m pytest tests/api/test_access_token.py tests/api/test_webhook.py -v --basetemp="$RUNNER_TEMP/pytest-api"

0 commit comments

Comments
 (0)