Skip to content

Commit bc3f9a4

Browse files
sbetti22Sarah Betti
andauthored
Standalone build and workflow fixes (#4264)
* removing imviz in run jdaviz cmd for standalone automation * removing second imviz in run jdaviz cmd for standalone automation * updates to hooks for building standalone app * update hook-scipy due to scipy update to 1.18 * increasing solara startup time to 5mins * increasing solara startup time to 15mins * adding delay for solara to get online * adding logging to see the issue with loading jdaviz * added pyvo png and xml so jdaviz loads correctly * updates to changes * uncomment where standalone is run --------- Co-authored-by: Sarah Betti <sbetti@stsci.edu>
1 parent d229e47 commit bc3f9a4

11 files changed

Lines changed: 64 additions & 18 deletions

File tree

.github/workflows/standalone.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: pyvista/setup-headless-display-action@v4
4646

4747
- name: Install jdaviz
48-
run: pip install .[test,qt]
48+
run: pip install -U ".[test,qt]"
4949

5050
- name: Install pyinstaller
5151
# see https://github.com/erocarrera/pefile/issues/420 for performance issues on
@@ -60,8 +60,12 @@ jobs:
6060
run: (cd standalone; pyinstaller ./jdaviz.spec)
6161

6262
- name: Run jdaviz cmd in background
63-
run: ./standalone/dist/jdaviz/jdaviz-cli imviz --port 8765 &
64-
63+
env:
64+
ASTROPY_ALLOW_INTERNET: "False"
65+
run: |
66+
# Start the app in the background so it immediately returns
67+
./standalone/dist/jdaviz/jdaviz-cli --port 8765 &
68+
6569
- name: Install playwright
6670
run: (pip install playwright; playwright install chromium)
6771

@@ -72,6 +76,7 @@ jobs:
7276
uses: ifaxity/wait-on-action@a7d13170ec542bdca4ef8ac4b15e9c6aa00a6866 # v1.2.1
7377
with:
7478
resource: tcp:8765
79+
delay: 20000
7580
timeout: 60000
7681

7782
- name: Test standalone
@@ -117,7 +122,7 @@ jobs:
117122
python-version: "3.12"
118123

119124
- name: Install jdaviz
120-
run: pip install .[test,qt]
125+
run: pip install U ".[test,qt]"
121126

122127
- name: Install pyinstaller
123128
run: pip install "pyinstaller"
@@ -166,7 +171,9 @@ jobs:
166171
167172
- name: Run jdaviz cmd in background
168173
if: ${{ matrix.os == 'macos-14' }}
169-
run: ./standalone/dist/jdaviz.app/Contents/MacOS/jdaviz-cli imviz --port=8765 &
174+
env:
175+
ASTROPY_ALLOW_INTERNET: "False"
176+
run: ./standalone/dist/jdaviz.app/Contents/MacOS/jdaviz-cli --port=8765 &
170177

171178
- name: Install playwright
172179
run: (pip install playwright; playwright install chromium)
@@ -195,4 +202,4 @@ jobs:
195202
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
196203
with:
197204
name: jdaviz-standlone-${{ matrix.os }}
198-
path: standalone/dist/jdaviz.dmg
205+
path: standalone/dist/jdaviz.dmg

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ Bug Fixes
9393

9494
- Fixed a bug with the astroquery/VO loaders where the loader would get stuck on a failed query. [#4257]
9595

96+
- Updates to standalone app hooks, spec, and workflow due to updates in astropy8.0 [#4264]
97+
9698

9799
Mosviz
98100
------

standalone/hooks/hook-glue.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
from PyInstaller.utils.hooks import collect_data_files, copy_metadata
1+
from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_all
22

3-
datas = collect_data_files('glue')
3+
4+
datas, binaries, hiddenimports = collect_all('glue')
5+
6+
# datas = collect_data_files('glue')
47
datas += copy_metadata('glue-core')
8+
# hiddenimports += [
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_submodules
1+
from PyInstaller.utils.hooks import collect_all, collect_data_files, copy_metadata, collect_submodules
22

33
hiddenimports = collect_submodules("ipyvuetify")
44
datas = collect_data_files('ipyvuetify')
55
datas += copy_metadata('ipyvuetify')
6+
7+
vue_datas, binaries, vue_hidden = collect_all('ipyvue')
8+
9+
datas += vue_datas
10+
hiddenimports += vue_hidden
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from PyInstaller.utils.hooks import collect_all
2+
3+
datas, binaries, hiddenimports = collect_all('ipywidgets')

standalone/hooks/hook-photutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
1+
from PyInstaller.utils.hooks import collect_submodules, collect_data_files, copy_metadata
22

33
hiddenimports = collect_submodules("photutils")
44
# for CITATION.rst
55
datas = collect_data_files('photutils')
6+
datas += copy_metadata('photutils')

standalone/hooks/hook-pythreejs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""PyInstaller hook for pythreejs.
2+
3+
pythreejs requires JSON data files at runtime for shader definitions.
4+
This hook ensures those files are bundled with the application.
5+
"""
6+
7+
from PyInstaller.utils.hooks import collect_data_files
8+
9+
# Collect all JSON files from pythreejs package
10+
datas = collect_data_files('pythreejs', includes=['**/*.json'])

standalone/hooks/hook-pyvo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from PyInstaller.utils.hooks import collect_data_files
2+
3+
# Collect all JSON files from pythreejs package
4+
datas = collect_data_files('pyvo', includes=['**/*.png', '**/*.xml'])

standalone/hooks/hook-scipy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_submodules
1+
from PyInstaller.utils.hooks import check_requirement, collect_data_files, copy_metadata, collect_submodules
22

33
hiddenimports = collect_submodules("scipy")
44
datas = collect_data_files('scipy')
55
datas += copy_metadata('scipy')
6+
7+
if check_requirement("scipy >= 1.14.0") and check_requirement("scipy < 1.18.0"):
8+
hiddenimports += ['scipy._lib.array_api_compat.numpy.fft']
9+
elif check_requirement("scipy >= 1.18.0"):
10+
hiddenimports += ['scipy._external.array_api_compat.numpy.fft']

standalone/hooks/hook-solara.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_submodules
1+
from PyInstaller.utils.hooks import collect_data_files, copy_metadata, collect_submodules, collect_all
22

3-
hiddenimports = collect_submodules("solara")
4-
datas = collect_data_files('solara')
3+
# hiddenimports = collect_submodules("solara")
4+
5+
datas, binaries, hiddenimports = collect_all('solara')
6+
7+
# datas = collect_data_files('solara')
58
datas += collect_data_files('solara-ui')

0 commit comments

Comments
 (0)