Skip to content

Commit 72230b9

Browse files
committed
Merge branch 'main' into release/rtc-v1.1.21
2 parents 91bc138 + ca38390 commit 72230b9

34 files changed

Lines changed: 2948 additions & 1379 deletions

‎.github/workflows/build-rtc.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
3232
with:
3333
submodules: true
34+
repository: ${{ github.event.pull_request.head.repo.full_name }}
3435
ref: ${{ github.event.pull_request.head.ref }}
3536

3637
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
@@ -48,7 +49,13 @@ jobs:
4849
- name: generate python stubs
4950
run: ./generate_proto.sh
5051

52+
# Fork PR tokens cannot push generated changes. Verify them read-only.
53+
- name: Check generated stubs on forks
54+
if: github.event.pull_request.head.repo.full_name != github.repository
55+
run: git diff --exit-code -- livekit/rtc/_proto
56+
5157
- name: Add changes
58+
if: github.event.pull_request.head.repo.full_name == github.repository
5259
uses: EndBug/add-and-commit@cc9c08ba6c8df3b93a8f2db63e89b98368ae2ae8 # v11
5360
with:
5461
add: '["livekit-rtc/"]'

‎.github/workflows/check-types.yml‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches:
66
- main
77
pull_request:
8-
branches:
9-
- main
108

119
jobs:
1210
type-check:
@@ -17,25 +15,28 @@ jobs:
1715
with:
1816
submodules: recursive
1917

20-
- name: Set up Python 3.9
18+
- name: Set up Python 3.12
2119
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
2220
with:
23-
python-version: 3.9
21+
python-version: "3.12"
2422

2523
- name: Install uv
2624
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
2725
with:
26+
version: "0.12.24"
2827
enable-cache: true
2928
cache-dependency-glob: "uv.lock"
3029

3130
- name: Install the project
32-
run: uv sync --all-extras --dev
31+
run: uv sync --locked --all-extras --dev
3332

3433
- name: Install workspace packages
3534
run: uv pip install -e livekit-protocol -e livekit-api -e livekit-rtc
3635

3736
- name: Download ffi
38-
run: uv run python livekit-rtc/rust-sdks/download_ffi.py --output .venv/lib/python3.9/site-packages/livekit/rtc/resources
37+
run: uv run python livekit-rtc/rust-sdks/download_ffi.py --output livekit-rtc/livekit/rtc/resources
3938

4039
- name: Check Types
41-
run: uv run mypy livekit-protocol livekit-api livekit-rtc
40+
run: |
41+
uv run mypy livekit-protocol livekit-api livekit-rtc
42+
uv run mypy --python-version 3.9 livekit-protocol/livekit livekit-api/livekit livekit-rtc/livekit

‎.github/workflows/ruff.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ jobs:
77
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
88
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
99
with:
10-
python-version: "3.9"
10+
python-version: "3.12"
1111

1212
- name: Install uv
1313
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
1414
with:
15+
version: "0.12.24"
1516
enable-cache: true
1617
cache-dependency-glob: "uv.lock"
1718

1819
- name: Install the project
19-
run: uv sync --all-extras --dev
20+
run: uv sync --locked --all-extras --dev
2021

2122
# Use the ruff version pinned in uv.lock rather than uvx's latest release,
2223
# so lint results only change when the lockfile is intentionally updated.

‎.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"

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,14 @@ Software encoders (libvpx for VP8/VP9, libaom for AV1, OpenH264 for H264) are us
404404
405405
Please join us on [Slack](https://livekit.io/join-slack) to get help from our devs / community members. We welcome your contributions(PRs) and details can be discussed there.
406406
407+
### Development environment
408+
409+
The published SDKs support Python 3.9 and later. Development and release tooling
410+
requires Python 3.10 or later so that patched versions of its dependencies can be
411+
installed. For example, run `uv sync --locked --dev --python 3.12` from the
412+
repository root. A Python 3.9 runtime environment can use
413+
`uv sync --locked --no-dev --python 3.9`.
414+
407415
<!--BEGIN_REPO_NAV-->
408416
<br/><table>
409417
<thead><tr><th colspan="2">LiveKit Ecosystem</th></tr></thead>

0 commit comments

Comments
 (0)