Skip to content

Commit

Permalink
Debug standalone build (spacetelescope#2389)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rosteen authored Aug 29, 2023
1 parent 1256253 commit 7896cdd
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions standalone/hooks/hook-asdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from PyInstaller.utils.hooks import collect_data_files, copy_metadata

datas = collect_data_files('asdf')
datas += copy_metadata('asdf')
3 changes: 2 additions & 1 deletion standalone/hooks/hook-jdaviz.py
Original file line number Diff line number Diff line change
@@ -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')
4 changes: 4 additions & 0 deletions standalone/hooks/hook-jupyter_events.py
Original file line number Diff line number Diff line change
@@ -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')
4 changes: 4 additions & 0 deletions standalone/hooks/hook-jupyter_server.py
Original file line number Diff line number Diff line change
@@ -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")
4 changes: 4 additions & 0 deletions standalone/hooks/hook-pysiaf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from PyInstaller.utils.hooks import collect_data_files, copy_metadata

datas = collect_data_files('pysiaf')
datas += copy_metadata('pysiaf')
4 changes: 4 additions & 0 deletions standalone/hooks/hook-specreduce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from PyInstaller.utils.hooks import collect_data_files, copy_metadata

datas = collect_data_files('specreduce')
datas += copy_metadata('specreduce')
1 change: 0 additions & 1 deletion standalone/jdaviz-cli-entrypoint.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions standalone/jdaviz.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions standalone/test.py → standalone/test_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 7896cdd

Please sign in to comment.