Skip to content
Merged
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
20 changes: 13 additions & 7 deletions .github/workflows/check-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ jobs:
with:
python-version: 3.9

- name: Download ffi
run: python -m pip install requests && python livekit-rtc/rust-sdks/download_ffi.py --output $(python -m site --user-site)/livekit/rtc/resources
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install mypy
run: python -m pip install --upgrade mypy
- name: Install the project
run: uv sync --all-extras --dev

- name: Install packages
run: python -m pip install pytest ./livekit-api ./livekit-protocol ./livekit-rtc pydantic numpy ipython
- name: Install workspace packages
run: uv pip install -e livekit-protocol -e livekit-api -e livekit-rtc

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

- name: Check Types
run: python -m mypy --install-type --non-interactive -p 'livekit-protocol' -p 'livekit-api' -p 'livekit-rtc'
run: uv run mypy livekit-protocol livekit-api livekit-rtc
16 changes: 10 additions & 6 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ jobs:
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install the project
run: uv sync --all-extras --dev

- name: Ruff livekit-api
run: ruff check --output-format=github .
run: uvx ruff check --output-format=github .

- name: Check format
run: ruff format --check .
run: uvx ruff format --check .
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,28 @@ jobs:
with:
submodules: true
lfs: true
- name: Install uv

uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install the project
run: uv sync --all-extras --dev

- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Run tests
env:
LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }}
run: |
pip3 install -r dev-requirements.txt
python3 ./livekit-rtc/rust-sdks/download_ffi.py --output livekit-rtc/livekit/rtc/resources
pip3 install ./livekit-protocol ./livekit-api ./livekit-rtc
pytest . --ignore=livekit-rtc/rust-sdks

uv run python ./livekit-rtc/rust-sdks/download_ffi.py --output livekit-rtc/livekit/rtc/resources
uv add ./livekit-rtc ./livekit-api ./livekit-protocol
uv run pytest . --ignore=livekit-rtc/rust-sdks

16 changes: 0 additions & 16 deletions dev-requirements.txt

This file was deleted.

52 changes: 49 additions & 3 deletions livekit-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
[build-system]
requires = [
"setuptools>=42",
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "livekit-api"
dynamic = ["version"]
description = "Python Server API for LiveKit"
readme = "README.md"
requires-python = ">=3.9.0"
license = "Apache-2.0"
keywords = ["webrtc", "realtime", "audio", "video", "livekit"]
authors = [
{ name = "LiveKit", email = "support@livekit.io" }
]
build-backend = "setuptools.build_meta"
classifiers = [
"Intended Audience :: Developers",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Video",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
"pyjwt>=2.0.0",
"aiohttp>=3.9.0",
"protobuf>=4",
"types-protobuf>=4",
"livekit-protocol>=1.1.1,<2.0.0",
]

[project.urls]
Documentation = "https://docs.livekit.io"
Website = "https://livekit.io/"
Source = "https://github.com/livekit/python-sdks/"

[tool.uv.sources]
livekit-protocol = { workspace = true }

[tool.hatch.version]
path = "livekit/api/version.py"

[tool.hatch.build.targets.wheel]
packages = ["livekit"]

[tool.hatch.build.targets.sdist]
include = ["/livekit"]
66 changes: 0 additions & 66 deletions livekit-api/setup.py

This file was deleted.

42 changes: 42 additions & 0 deletions livekit-protocol/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "livekit-protocol"
dynamic = ["version"]
description = "Python protocol stubs for LiveKit"
requires-python = ">=3.7.0"
license = "Apache-2.0"
readme = { content-type = "text/plain", text = "Python protocol stubs for LiveKit" }
keywords = ["webrtc", "realtime", "audio", "video", "livekit"]
authors = [
{ name = "LiveKit", email = "support@livekit.io" }
]
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
"protobuf>=4",
"types-protobuf>=4",
]

[project.urls]
Documentation = "https://docs.livekit.io"
Website = "https://livekit.io/"
Source = "https://github.com/livekit/python-sdks/"

[tool.hatch.version]
path = "livekit/protocol/version.py"

[tool.hatch.build.targets.wheel]
packages = ["livekit"]

[tool.hatch.build.targets.sdist]
include = ["/livekit"]
59 changes: 0 additions & 59 deletions livekit-protocol/setup.py

This file was deleted.

22 changes: 22 additions & 0 deletions livekit-rtc/hatch_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from hatchling.builders.hooks.plugin.interface import BuildHookInterface


class CustomBuildHook(BuildHookInterface):
def initialize(self, version, build_data):
"""Force platform-specific wheel due to native libraries"""
build_data["pure_python"] = False
build_data["infer_tag"] = True
Comment on lines +18 to +22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before making any release we should double-check this is working as expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make a rc build first

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at the artifacts built as part of the rtc-build workflow and they appeared to be fine, anything else we need to check?

Loading
Loading