Contributions of any size are welcome. For bugs and features, open an issue; for questions, start a discussion.
Requires uv.
make dev # editable install into .venv, C++ is rebuilt on import when changed
make test # run the test suite
make lint # ruff
make stub # regenerate type stubs of the native module
make wheels # build wheels for the current platform the same way CI does- CMake 3.26 or higher
- A C++20 compiler: Clang on Linux (libwebrtc there is built against Chromium's libc++), Apple Clang on macOS, MSVC on Windows
- ~150 MB of free disk space
Nothing else has to be installed or configured manually: a prebuilt static libwebrtc for the target platform
(from libwebrtc-bin) is downloaded once, verified and unpacked
into a shared cache (~/.cache/python-webrtc, %LOCALAPPDATA%\python-webrtc on Windows or $WRTC_CACHE_DIR).
Only the headers in use are extracted and debug info is stripped, so it takes ~60 MB per platform.
Pass -Ccmake.define.LIBWEBRTC_ROOT=/path/to/libwebrtc to use your own libwebrtc build instead.
- Bump
versioninpyproject.tomland runuv lock. - Push a
v<version>tag. CI builds the sdist and wheels for every platform and publishes them to PyPI.
Publishing uses trusted publishing: the PyPI project needs a
trusted publisher for this repository's ci.yml workflow, and the repository a pypi environment. No tokens needed.
The libwebrtc version and archive hashes are pinned in cmake/libwebrtc.cmake:
- Set
LIBWEBRTC_VERSIONto a libwebrtc-bin release and update theLIBWEBRTC_SHA256_*values (the release page lists a SHA256 digest per asset). - Refresh the Linux libc++ pins as described in
cmake/libcxx/README.md. - Build and run the tests. On Linux, check whether
cmake/libwebrtc_linux_fixups.cppis still needed: remove it and see whether the module imports (it is linked with-z now, so missing symbols fail on import).