Skip to content

Commit ebea525

Browse files
committed
fix tests
1 parent 4ecfecc commit ebea525

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

livekit-rtc/hatch_build.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,28 @@ def _get_macos_platform_tag(self):
5858
# Convert version to wheel tag format (e.g., "11.0" -> "11_0")
5959
version_tag = deployment_target.replace(".", "_")
6060

61-
# Get architecture
61+
# Get target architecture from ARCHFLAGS (set by cibuildwheel for cross-compilation)
62+
# or fall back to host machine architecture
63+
arch = self._get_macos_target_arch()
64+
65+
return f"macosx_{version_tag}_{arch}"
66+
67+
def _get_macos_target_arch(self):
68+
"""Detect target architecture for macOS builds.
69+
70+
Cibuildwheel sets ARCHFLAGS for cross-compilation (e.g., "-arch x86_64").
71+
Falls back to host machine architecture if not set.
72+
"""
73+
archflags = os.environ.get("ARCHFLAGS", "")
74+
if "-arch arm64" in archflags:
75+
return "arm64"
76+
elif "-arch x86_64" in archflags:
77+
return "x86_64"
78+
79+
# Fall back to host architecture
6280
machine = platform.machine()
6381
if machine == "x86_64":
64-
arch = "x86_64"
82+
return "x86_64"
6583
elif machine == "arm64":
66-
arch = "arm64"
67-
else:
68-
arch = machine
69-
70-
return f"macosx_{version_tag}_{arch}"
84+
return "arm64"
85+
return machine

tests/rtc/test_mixer.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import numpy as np
44
import pytest
5-
import matplotlib.pyplot as plt
65

76
from livekit.rtc import AudioMixer
87
from livekit.rtc.utils import sine_wave_generator
@@ -43,12 +42,6 @@ async def test_mixer_two_sine_waves():
4342

4443
mixed_signal = np.concatenate(mixed_signals)
4544

46-
plt.figure(figsize=(10, 4))
47-
plt.plot(mixed_signal[:1000])
48-
plt.title("Mixed Signal")
49-
plt.xlabel("Sample")
50-
plt.ylabel("Amplitude")
51-
plt.show()
5245

5346
# Use FFT to analyze frequency components.
5447
fft = np.fft.rfft(mixed_signal)

0 commit comments

Comments
 (0)