Skip to content

Commit a76d9b9

Browse files
committed
Defer GUI launcher imports so individual tabs work without webrtc extra
gui/__init__.py used to eagerly import main_window, which transitively loaded RemoteDesktopTab → webrtc_panel → webrtc_transport, requiring the optional 'webrtc' extra (PyAV / aiortc). That broke any caller doing 'from je_auto_control.gui.<tab> import X' on environments that only installed the base wheel. Move the launcher imports inside start_autocontrol_gui() so importing a single tab no longer pulls in the WebRTC stack.
1 parent a188841 commit a76d9b9

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

je_auto_control/gui/__init__.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
import sys
1+
"""GUI package — kept import-light so individual tabs can be loaded without
2+
pulling in the full main window (which transitively requires the optional
3+
``webrtc`` extra). The launcher imports its dependencies lazily inside
4+
:func:`start_autocontrol_gui` so::
25
3-
from PySide6.QtWidgets import QApplication
6+
from je_auto_control.gui.profiler_tab import ProfilerTab
47
5-
from je_auto_control.gui.main_window import AutoControlGUIUI
8+
works in environments that have not installed PyAV / aiortc.
9+
"""
610

711

8-
def start_autocontrol_gui():
12+
def start_autocontrol_gui() -> None:
13+
"""Open the AutoControl GUI; pulls in PySide6 + WebRTC stack lazily."""
14+
import sys
15+
16+
from PySide6.QtWidgets import QApplication
17+
18+
from je_auto_control.gui.main_window import AutoControlGUIUI
19+
920
app = QApplication(sys.argv)
1021
window = AutoControlGUIUI()
1122
window.show()

0 commit comments

Comments
 (0)