Skip to content

Commit 66c922f

Browse files
committed
macos compat
1 parent 681a9ec commit 66c922f

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

livekit-rtc/hatch_build.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,34 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from sysconfig import get_platform
15+
import sys
1616

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

1919

2020
class CustomBuildHook(BuildHookInterface):
2121
def initialize(self, version, build_data):
22-
"""Force platform-specific wheel with py3-none tag."""
22+
"""Force platform-specific wheel with py3-none tag.
23+
24+
The native libraries (.so, .dylib, .dll) are not Python C extensions -
25+
they're standalone FFI libraries loaded at runtime. This means they
26+
don't depend on a specific CPython ABI, so we use py3-none to indicate
27+
compatibility with any Python 3.x version while keeping the platform tag.
28+
"""
2329
build_data["pure_python"] = False
2430
build_data["infer_tag"] = False
25-
build_data["tag"] = f"py3-none-{get_platform().replace('-', '_').replace('.', '_')}"
31+
32+
# Get the platform tag using hatchling's logic (handles MACOSX_DEPLOYMENT_TARGET, etc.)
33+
from packaging.tags import sys_tags
34+
35+
tag = next(
36+
t for t in sys_tags() if "manylinux" not in t.platform and "musllinux" not in t.platform
37+
)
38+
platform = tag.platform
39+
40+
if sys.platform == "darwin":
41+
from hatchling.builders.macos import process_macos_plat_tag
42+
43+
platform = process_macos_plat_tag(platform, compat=True)
44+
45+
build_data["tag"] = f"py3-none-{platform}"

livekit-rtc/rust-sdks

Submodule rust-sdks updated 176 files

0 commit comments

Comments
 (0)