From fdf286ce69f6c3704dd350e7eff2235026e99bd6 Mon Sep 17 00:00:00 2001 From: Shohan Date: Thu, 23 May 2024 01:27:01 +0530 Subject: [PATCH] fix(installer): Fix build failing due to replicate and other issues (#684) --- .../app/dashboard/app/recordings/detail/page.tsx | 13 +++++++++++-- openadapt/build.py | 12 ++++++++++++ openadapt/build_utils.py | 5 ++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/openadapt/app/dashboard/app/recordings/detail/page.tsx b/openadapt/app/dashboard/app/recordings/detail/page.tsx index 6778e9677..3426aaba2 100644 --- a/openadapt/app/dashboard/app/recordings/detail/page.tsx +++ b/openadapt/app/dashboard/app/recordings/detail/page.tsx @@ -6,9 +6,9 @@ import { ActionEvent as ActionEventType } from "@/types/action-event"; import { Recording as RecordingType } from "@/types/recording"; import { Box, Loader, Progress } from "@mantine/core"; import { useSearchParams } from "next/navigation"; -import { useEffect, useState } from "react"; +import { Suspense, useEffect, useState } from "react"; -export default function Recording() { +function Recording() { const searchParams = useSearchParams(); const id = searchParams.get("id"); const [recordingInfo, setRecordingInfo] = useState<{ @@ -95,3 +95,12 @@ function addIdToNullActionEvent(actionEvent: ActionEventType): ActionEventType { children, } } + + +export default function RecordingPage() { + return ( + + + + ) +} diff --git a/openadapt/build.py b/openadapt/build.py index 78a799076..05a5ce0c0 100644 --- a/openadapt/build.py +++ b/openadapt/build.py @@ -12,10 +12,12 @@ import subprocess import sys +import gradio_client import nicegui import oa_pynput import pydicom import spacy_alignments +import ultralytics from openadapt.config import POSTHOG_HOST, POSTHOG_PUBLIC_KEY @@ -30,6 +32,8 @@ def main() -> None: oa_pynput, pydicom, spacy_alignments, + gradio_client, + ultralytics, ] if sys.platform == "win32": additional_packages_to_install.append(screen_recorder_sdk) @@ -38,6 +42,10 @@ def main() -> None: "py", ] + packages_metadata_to_copy = [ + "replicate", + ] + OPENADAPT_DIR = Path(__file__).parent ROOT_DIR = OPENADAPT_DIR.parent @@ -137,6 +145,10 @@ def main() -> None: spec.append("--exclude-module") spec.append(package) + for package in packages_metadata_to_copy: + spec.append("--copy-metadata") + spec.append(package) + subprocess.call(spec) # building diff --git a/openadapt/build_utils.py b/openadapt/build_utils.py index 8d3b18a4a..36d748725 100644 --- a/openadapt/build_utils.py +++ b/openadapt/build_utils.py @@ -33,14 +33,13 @@ def is_running_from_executable() -> bool: class RedirectOutput: """Context manager to redirect stdout and stderr to /dev/null.""" - null_stream = open(os.devnull, "a") - def __enter__(self) -> "RedirectOutput": """Redirect stdout and stderr to /dev/null.""" if is_running_from_executable(): + null_stream = open(os.devnull, "a") self.old_stdout = sys.stdout self.old_stderr = sys.stderr - sys.stdout = sys.stderr = self.null_stream + sys.stdout = sys.stderr = null_stream return self def __exit__(self, exc_type: type, exc_value: Exception, traceback: type) -> None: