From 7896cdd9d87192276785e316a15db25448279385 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen <39831871+rosteen@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:35:49 -0400 Subject: [PATCH] Debug standalone build (#2389) * Testing longer timeout for Voila step * Try to give this PR secrets access * Try to give this PR secrets access * Going to just push to this branch... * Remove max Voila pin * Try max pinning jsonschema * Try older asdf as well * Remove voila max pin (again) * Add hook file for asdf * Try unpinning asdf with hooks file * Add hook for jupyter_events * Try adding browser * Try adding browser * Remove version call * Update page test targets * Remove playwright test to get standalone artifact * Add test back in now that I confirmed I see this locally * This is working locally now.... * We do want theme-light after all * Maybe it does need this?? * Take and upload screenshot artifact * Fix workflow error * Add test dependencies to get pysiaf * Try max pinning Voila again * Try only macos * Log jdaviz output * Add jupyter_server hook * Add ubuntu and windows back in now that macos is working * Remove debugging code/workflow steps * Remove chrome setup, rename test file * Remove pysiaf entry point here * Remove debugging branch from workflow file --- .github/workflows/standalone.yml | 4 ++-- standalone/hooks/hook-asdf.py | 4 ++++ standalone/hooks/hook-jdaviz.py | 3 ++- standalone/hooks/hook-jupyter_events.py | 4 ++++ standalone/hooks/hook-jupyter_server.py | 4 ++++ standalone/hooks/hook-pysiaf.py | 4 ++++ standalone/hooks/hook-specreduce.py | 4 ++++ standalone/jdaviz-cli-entrypoint.py | 1 - standalone/jdaviz.spec | 1 + standalone/{test.py => test_standalone.py} | 4 ++-- 10 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 standalone/hooks/hook-asdf.py create mode 100644 standalone/hooks/hook-jupyter_events.py create mode 100644 standalone/hooks/hook-jupyter_server.py create mode 100644 standalone/hooks/hook-pysiaf.py create mode 100644 standalone/hooks/hook-specreduce.py rename standalone/{test.py => test_standalone.py} (82%) diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 3368e4e7f5..b920c497bf 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -36,7 +36,7 @@ jobs: python-version: "3.10" - name: Install jdaviz - run: pip install . + run: pip install .[test] - name: Install pyinstaller run: pip install pyinstaller==5.11 @@ -116,7 +116,7 @@ jobs: timeout: 60000 - name: Test standalone - run: (cd standalone; touch pytest.ini; JUPYTER_PLATFORM_DIRS=1 pytest test.py --video=on) + run: (cd standalone; touch pytest.ini; JUPYTER_PLATFORM_DIRS=1 pytest test_standalone.py --video=on) - name: Upload Test artifacts if: always() diff --git a/standalone/hooks/hook-asdf.py b/standalone/hooks/hook-asdf.py new file mode 100644 index 0000000000..d9b558605f --- /dev/null +++ b/standalone/hooks/hook-asdf.py @@ -0,0 +1,4 @@ +from PyInstaller.utils.hooks import collect_data_files, copy_metadata + +datas = collect_data_files('asdf') +datas += copy_metadata('asdf') diff --git a/standalone/hooks/hook-jdaviz.py b/standalone/hooks/hook-jdaviz.py index c7abff2b5e..97016da6f6 100644 --- a/standalone/hooks/hook-jdaviz.py +++ b/standalone/hooks/hook-jdaviz.py @@ -1,4 +1,5 @@ -from PyInstaller.utils.hooks import collect_data_files, copy_metadata +from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_submodules +hiddenimports = collect_submodules("jdaviz") datas = collect_data_files('jdaviz') datas += copy_metadata('jdaviz') diff --git a/standalone/hooks/hook-jupyter_events.py b/standalone/hooks/hook-jupyter_events.py new file mode 100644 index 0000000000..f65a57edf9 --- /dev/null +++ b/standalone/hooks/hook-jupyter_events.py @@ -0,0 +1,4 @@ +from PyInstaller.utils.hooks import collect_data_files, copy_metadata + +datas = collect_data_files('jupyter_events') +datas += copy_metadata('jupyter_events') diff --git a/standalone/hooks/hook-jupyter_server.py b/standalone/hooks/hook-jupyter_server.py new file mode 100644 index 0000000000..c5fdf5e39b --- /dev/null +++ b/standalone/hooks/hook-jupyter_server.py @@ -0,0 +1,4 @@ +from PyInstaller.utils.hooks import collect_submodules, collect_data_files + +datas = collect_data_files('jupyter_server') +hiddenimports = collect_submodules("jupyter_server") diff --git a/standalone/hooks/hook-pysiaf.py b/standalone/hooks/hook-pysiaf.py new file mode 100644 index 0000000000..246ed743f9 --- /dev/null +++ b/standalone/hooks/hook-pysiaf.py @@ -0,0 +1,4 @@ +from PyInstaller.utils.hooks import collect_data_files, copy_metadata + +datas = collect_data_files('pysiaf') +datas += copy_metadata('pysiaf') diff --git a/standalone/hooks/hook-specreduce.py b/standalone/hooks/hook-specreduce.py new file mode 100644 index 0000000000..c45113ebb8 --- /dev/null +++ b/standalone/hooks/hook-specreduce.py @@ -0,0 +1,4 @@ +from PyInstaller.utils.hooks import collect_data_files, copy_metadata + +datas = collect_data_files('specreduce') +datas += copy_metadata('specreduce') diff --git a/standalone/jdaviz-cli-entrypoint.py b/standalone/jdaviz-cli-entrypoint.py index f77f124eef..27dde09c5c 100644 --- a/standalone/jdaviz-cli-entrypoint.py +++ b/standalone/jdaviz-cli-entrypoint.py @@ -1,6 +1,5 @@ import sys - def start_as_kernel(): # similar to https://github.com/astrofrog/voila-qt-app/blob/master/voila_demo.py import sys diff --git a/standalone/jdaviz.spec b/standalone/jdaviz.spec index 45768f2db4..31e9f2f11b 100644 --- a/standalone/jdaviz.spec +++ b/standalone/jdaviz.spec @@ -8,6 +8,7 @@ from PyInstaller.building.api import COLLECT, EXE, PYZ from PyInstaller.building.osx import BUNDLE import jdaviz +from jdaviz.configs import Specviz, Specviz2d, Cubeviz, Mosviz, Imviz codesign_identity = os.environ.get("DEVELOPER_ID_APPLICATION") # this copies over the nbextensions enabling json and the js assets diff --git a/standalone/test.py b/standalone/test_standalone.py similarity index 82% rename from standalone/test.py rename to standalone/test_standalone.py index fb3276a7fa..2864d6362e 100644 --- a/standalone/test.py +++ b/standalone/test_standalone.py @@ -5,8 +5,8 @@ def test_voila_basics(page: Page): page.goto("http://localhost:8866/") - + # basic voila is loaded page.locator("body.theme-light").wait_for() # when jdaviz is loaded (button at the top left) - page.locator("text=Import Data").wait_for() + page.locator("text=Welcome to Jdaviz").wait_for()