Skip to content

Commit c0096aa

Browse files
committed
Use setuptools instead of hatch
1 parent 8b7a229 commit c0096aa

File tree

3 files changed

+83
-154
lines changed

3 files changed

+83
-154
lines changed

livekit-rtc/hatch_build.py

Lines changed: 0 additions & 92 deletions
This file was deleted.

livekit-rtc/pyproject.toml

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,12 @@
11
[build-system]
2-
requires = ["hatchling", "requests"]
3-
build-backend = "hatchling.build"
4-
5-
[project]
6-
name = "livekit"
7-
dynamic = ["version"]
8-
description = "Python Real-time SDK for LiveKit"
9-
readme = "README.md"
10-
requires-python = ">=3.9.0"
11-
license = "Apache-2.0"
12-
keywords = ["webrtc", "realtime", "audio", "video", "livekit"]
13-
authors = [
14-
{ name = "LiveKit", email = "support@livekit.io" }
15-
]
16-
classifiers = [
17-
"Intended Audience :: Developers",
18-
"Topic :: Multimedia :: Sound/Audio",
19-
"Topic :: Multimedia :: Video",
20-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
21-
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.9",
23-
"Programming Language :: Python :: 3.10",
24-
"Programming Language :: Python :: 3 :: Only",
25-
]
26-
dependencies = [
27-
"protobuf>=4.25.0",
28-
"types-protobuf>=3",
29-
"aiofiles>=24",
30-
"numpy>=1.26",
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"requests",
316
]
32-
33-
[project.urls]
34-
Documentation = "https://docs.livekit.io"
35-
Website = "https://livekit.io/"
36-
Source = "https://github.com/livekit/python-sdks/"
37-
38-
[tool.hatch.version]
39-
path = "livekit/rtc/version.py"
40-
41-
[tool.hatch.build.targets.wheel]
42-
packages = ["livekit"]
43-
artifacts = [
44-
"livekit/rtc/resources/*.so",
45-
"livekit/rtc/resources/*.dylib",
46-
"livekit/rtc/resources/*.dll",
47-
]
48-
49-
[tool.hatch.build.targets.wheel.hooks.custom]
50-
path = "hatch_build.py"
51-
52-
[tool.hatch.build.targets.sdist]
53-
include = ["/livekit", "/rust-sdks"]
7+
build-backend = "setuptools.build_meta"
548

559
[tool.cibuildwheel]
5610
build = "cp39-*"
5711
skip = "*-musllinux_*" # not supported (libwebrtc requires glibc)
5812
before-build = "pip install requests && python rust-sdks/download_ffi.py --output livekit/rtc/resources"
59-
# Note: manylinux_2_28 is the default in cibuildwheel 3.x, no explicit config needed
60-
61-
# macOS deployment targets must match the FFI binaries (see rust-sdks/.github/workflows/ffi-builds.yml)
62-
# x86_64 supports macOS 10.15+, arm64 requires macOS 11.0+
63-
[[tool.cibuildwheel.overrides]]
64-
select = "*macosx_x86_64"
65-
environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }
66-
67-
[[tool.cibuildwheel.overrides]]
68-
select = "*macosx_arm64"
69-
environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" }

livekit-rtc/setup.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright 2023 LiveKit, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
import pathlib
17+
from sysconfig import get_platform
18+
from typing import Any, Dict
19+
20+
import setuptools # type: ignore
21+
import setuptools.command.build_py # type: ignore
22+
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel # type: ignore
23+
24+
here = pathlib.Path(__file__).parent.resolve()
25+
about: Dict[Any, Any] = {}
26+
with open(os.path.join(here, "livekit", "rtc", "version.py"), "r") as f:
27+
exec(f.read(), about)
28+
29+
30+
class bdist_wheel(_bdist_wheel):
31+
def finalize_options(self):
32+
self.plat_name = get_platform() # force a platform tag
33+
_bdist_wheel.finalize_options(self)
34+
35+
36+
setuptools.setup(
37+
name="livekit",
38+
version=about["__version__"],
39+
description="Python Real-time SDK for LiveKit",
40+
long_description=(here / "README.md").read_text(encoding="utf-8"),
41+
long_description_content_type="text/markdown",
42+
url="https://github.com/livekit/python-sdks",
43+
cmdclass={
44+
"bdist_wheel": bdist_wheel,
45+
},
46+
classifiers=[
47+
"Intended Audience :: Developers",
48+
"License :: OSI Approved :: Apache Software License",
49+
"Topic :: Multimedia :: Sound/Audio",
50+
"Topic :: Multimedia :: Video",
51+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
52+
"Programming Language :: Python :: 3",
53+
"Programming Language :: Python :: 3.9",
54+
"Programming Language :: Python :: 3.10",
55+
"Programming Language :: Python :: 3 :: Only",
56+
],
57+
keywords=["webrtc", "realtime", "audio", "video", "livekit"],
58+
license="Apache-2.0",
59+
packages=setuptools.find_namespace_packages(include=["livekit.*"]),
60+
python_requires=">=3.9.0",
61+
install_requires=["protobuf>=4.25.0", "types-protobuf>=3", "aiofiles>=24", "numpy>=1.26"],
62+
package_data={
63+
"livekit.rtc": ["_proto/*.py", "py.typed", "*.pyi", "**/*.pyi"],
64+
"livekit.rtc.resources": [
65+
"*.so",
66+
"*.dylib",
67+
"*.dll",
68+
"LICENSE.md",
69+
"*.h",
70+
"jupyter-html/index.html",
71+
],
72+
},
73+
project_urls={
74+
"Documentation": "https://docs.livekit.io",
75+
"Website": "https://livekit.io/",
76+
"Source": "https://github.com/livekit/python-sdks/",
77+
},
78+
)

0 commit comments

Comments
 (0)