From 9f5ca70e104c569e4526c640385761bd510d3a28 Mon Sep 17 00:00:00 2001 From: Core447 Date: Sun, 14 Jan 2024 13:56:10 +0100 Subject: [PATCH] Run backend in separate env --- __install__.py | 6 ++++++ main.py | 4 +--- requirements.txt | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 __install__.py diff --git a/__install__.py b/__install__.py new file mode 100644 index 0000000..524dfed --- /dev/null +++ b/__install__.py @@ -0,0 +1,6 @@ +from streamcontroller_plugin_tools.installation_helpers import create_venv +from os.path import join, abspath, dirname + +print("installing") +toplevel = dirname(abspath(__file__)) +create_venv(join(toplevel, ".venv"), join(toplevel, "requirements.txt")) \ No newline at end of file diff --git a/main.py b/main.py index 8957e45..d5d38fd 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,3 @@ -from plugins.dev_core447_OBSPlugin.backend.OBSController import OBSController from src.backend.PluginManager.ActionBase import ActionBase from src.backend.PluginManager.PluginBase import PluginBase @@ -13,7 +12,6 @@ import os import threading from datetime import timedelta from loguru import logger as log -from obswebsocket import events # Add plugin to sys.paths sys.path.append(os.path.dirname(__file__)) @@ -30,7 +28,7 @@ class OBS(PluginBase): super().__init__() # Launch backend - self.launch_backend(os.path.join(self.PATH, "backend", "backend.py")) + self.launch_backend(os.path.join(self.PATH, "backend", "backend.py"), os.path.join(self.PATH, ".venv")) self.add_action(ToggleRecord) self.add_action(RecPlayPause) diff --git a/requirements.txt b/requirements.txt index 6e645da..512f860 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,6 @@ -obs-websocket-py>=1.0 \ No newline at end of file +loguru==0.7.2 +obs-websocket-py==1.0 +Pyro5==5.15 +serpent==1.41 +streamcontroller-plugin-tools>=0.0.4 +websocket-client==1.7.0 \ No newline at end of file