Skip to content

Commit

Permalink
fix(build): Fix build issues (#809)
Browse files Browse the repository at this point in the history
* fix: Fix build issues

* fix: Add pyqttoast and whisper explicitly to build

* black/flake8

---------

Co-authored-by: Richard Abrich <richard.abrich@mldsai.com>
Co-authored-by: Richard Abrich <richard.abrich@gmail.com>
  • Loading branch information
3 people authored Jun 27, 2024
1 parent b340d8f commit 48995bb
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
id: test_on_windows
shell: powershell
run: |
./build_scripts/test_app_run_windows.bat
cmd.exe /c .\build_scripts\test_app_run_windows.bat
if ($LastExitCode -ne 0) {
"windows_build_status=failed" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const Tutorial = () => {
</Text>
<iframe width="800" height="400" src="https://www.youtube.com/embed/OVERugs50cQ?si=cmi1vY73ADom9EKG" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen className='block mx-auto'></iframe>
<Text my={20} maw={800}>
If you'd like to contribute directly to our development, please consider the following open Bounties (no development experience required):
If {"you'd"} like to contribute directly to our development, please consider the following open Bounties (no development experience required):
{featuredBounty && <BountyCard bounty={featuredBounty} />}
</Text>
</Box>
Expand Down
2 changes: 0 additions & 2 deletions openadapt/app/dashboard/entrypoint.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
nvm install 21
nvm use 21
npm install
2 changes: 1 addition & 1 deletion openadapt/app/dashboard/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def run_client() -> subprocess.Popen:
if config.REDIRECT_TO_ONBOARDING:
url = f"http://localhost:{config.DASHBOARD_SERVER_PORT}/onboarding"
else:
url = f"http://localhost:{config.DASHBOARD_SERVER_PORT}"
url = f"http://localhost:{config.DASHBOARD_SERVER_PORT}/recordings"
webbrowser.open(url)
run_app()
return
Expand Down
6 changes: 6 additions & 0 deletions openadapt/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
import gradio_client
import nicegui
import oa_pynput
import pycocotools
import pydicom
import pyqttoast
import spacy_alignments
import ultralytics
import whisper

from openadapt.config import POSTHOG_HOST, POSTHOG_PUBLIC_KEY

Expand All @@ -34,6 +37,9 @@ def main() -> None:
spacy_alignments,
gradio_client,
ultralytics,
pycocotools,
pyqttoast,
whisper,
]
if sys.platform == "win32":
additional_packages_to_install.append(screen_recorder_sdk)
Expand Down
8 changes: 3 additions & 5 deletions openadapt/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
return decorator


def clear(keep_days: int = 0, dry_run: bool = False):
def clear(keep_days: int = 0, dry_run: bool = False) -> None:
"""Clears the cache, optionally keeping data for a specified number of days.
With an option for a dry run.
Expand All @@ -125,7 +125,7 @@ def clear(keep_days: int = 0, dry_run: bool = False):
cutoff_date = datetime.now() - timedelta(days=keep_days)
total_cleared = 0

for path in cache_dir_path.rglob('*'):
for path in cache_dir_path.rglob("*"):
if path.is_file() and os.path.getmtime(path) < cutoff_date.timestamp():
file_size = path.stat().st_size
if not dry_run:
Expand Down Expand Up @@ -154,6 +154,4 @@ def clear(keep_days: int = 0, dry_run: bool = False):


if __name__ == "__main__":
fire.Fire({
'clear_cache': clear_cache
})
fire.Fire({"clear": clear})
11 changes: 10 additions & 1 deletion scripts/postinstall.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Consolidated post-install script for OpenAdapt."""

import os
import subprocess
import sys
import os


def install_detectron2() -> None:
Expand Down Expand Up @@ -40,6 +40,15 @@ def install_dashboard() -> None:
print("Changed directory to:", os.getcwd())

if sys.platform.startswith("win"):
try:
subprocess.check_call(["nvm", "install", "21"])
subprocess.check_call(["nvm", "use", "21"])
except FileNotFoundError:
if os.getenv("CI") == "true":
print("nvm not found. Skipping installation.")
else:
print("nvm not found. Please install nvm.")
sys.exit(1)
subprocess.check_call(["powershell", "./entrypoint.ps1"])
else:
subprocess.check_call(["bash", "./entrypoint.sh"])
Expand Down

0 comments on commit 48995bb

Please sign in to comment.