Skip to content

Commit fdf286c

Browse files
authored
fix(installer): Fix build failing due to replicate and other issues (#684)
1 parent 52ef728 commit fdf286c

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

openadapt/app/dashboard/app/recordings/detail/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { ActionEvent as ActionEventType } from "@/types/action-event";
66
import { Recording as RecordingType } from "@/types/recording";
77
import { Box, Loader, Progress } from "@mantine/core";
88
import { useSearchParams } from "next/navigation";
9-
import { useEffect, useState } from "react";
9+
import { Suspense, useEffect, useState } from "react";
1010

11-
export default function Recording() {
11+
function Recording() {
1212
const searchParams = useSearchParams();
1313
const id = searchParams.get("id");
1414
const [recordingInfo, setRecordingInfo] = useState<{
@@ -95,3 +95,12 @@ function addIdToNullActionEvent(actionEvent: ActionEventType): ActionEventType {
9595
children,
9696
}
9797
}
98+
99+
100+
export default function RecordingPage() {
101+
return (
102+
<Suspense>
103+
<Recording />
104+
</Suspense>
105+
)
106+
}

openadapt/build.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
import subprocess
1313
import sys
1414

15+
import gradio_client
1516
import nicegui
1617
import oa_pynput
1718
import pydicom
1819
import spacy_alignments
20+
import ultralytics
1921

2022
from openadapt.config import POSTHOG_HOST, POSTHOG_PUBLIC_KEY
2123

@@ -30,6 +32,8 @@ def main() -> None:
3032
oa_pynput,
3133
pydicom,
3234
spacy_alignments,
35+
gradio_client,
36+
ultralytics,
3337
]
3438
if sys.platform == "win32":
3539
additional_packages_to_install.append(screen_recorder_sdk)
@@ -38,6 +42,10 @@ def main() -> None:
3842
"py",
3943
]
4044

45+
packages_metadata_to_copy = [
46+
"replicate",
47+
]
48+
4149
OPENADAPT_DIR = Path(__file__).parent
4250
ROOT_DIR = OPENADAPT_DIR.parent
4351

@@ -137,6 +145,10 @@ def main() -> None:
137145
spec.append("--exclude-module")
138146
spec.append(package)
139147

148+
for package in packages_metadata_to_copy:
149+
spec.append("--copy-metadata")
150+
spec.append(package)
151+
140152
subprocess.call(spec)
141153

142154
# building

openadapt/build_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ def is_running_from_executable() -> bool:
3333
class RedirectOutput:
3434
"""Context manager to redirect stdout and stderr to /dev/null."""
3535

36-
null_stream = open(os.devnull, "a")
37-
3836
def __enter__(self) -> "RedirectOutput":
3937
"""Redirect stdout and stderr to /dev/null."""
4038
if is_running_from_executable():
39+
null_stream = open(os.devnull, "a")
4140
self.old_stdout = sys.stdout
4241
self.old_stderr = sys.stderr
43-
sys.stdout = sys.stderr = self.null_stream
42+
sys.stdout = sys.stderr = null_stream
4443
return self
4544

4645
def __exit__(self, exc_type: type, exc_value: Exception, traceback: type) -> None:

0 commit comments

Comments
 (0)