astroDimitrios / rose

:rose: Rose is a toolkit for writing, editing and running application configurations.
https://metomi.github.io/rose/
GNU General Public License v3.0
0 stars 1 forks source link

Running at NIWA #37

Closed jfrost-mo closed 2 months ago

jfrost-mo commented 2 months ago

An issue for me to track my attempts to get the python 3 based rose edit running at NIWA.

Install steps

I'm currently testing on the kupe machine.

# Load required modules.
module load Miniforge3
source $(conda info --base)/etc/profile.d/conda.sh

# Get source.
git clone https://github.com/astroDimitrios/rose.git
cd rose
git checkout feature/rose-config-py3

# Get dependencies.
conda create -n rose-py3 python pip pygobject gtk3
conda activate rose-py3

# Install rose.
pip install .

# Purge modules, as they break all GUIs.
conda deactivate
module purge

# Run rose edit (unsuccessfully so far...)
/home/jfrost/.conda/envs/rose-py3/bin/rose edit

Current failure

Rose edit does not run. I get a number of "Resource not found" errors, preventing the GUI from starting.

Traceback ``` [jfrost@hafs01 bin]$ /home/jfrost/.conda/envs/rose-py3/bin/rose edit Traceback (most recent call last): File "/home/jfrost/.conda/envs/rose-py3/bin/rose", line 8, in sys.exit(rose()) ^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 275, in rose main( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 390, in main exec_sub_cmd(ns, sub_cmd, cmd_args) File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 188, in exec_sub_cmd _exec_python( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 224, in _exec_python fcn() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1966, in main spawn_window(cwd, debug_mode=opts.debug_mode, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1807, in spawn_window metomi.rose.gtk.util.setup_stock_icons() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/util.py", line 708, in setup_stock_icons path = locator.locate("etc/images/rose-config-edit/" + ifile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/resource.py", line 172, in locate raise ResourceError(key) metomi.rose.resource.ResourceError: etc/images/rose-config-edit/gnome_add.png: resource not found. Error in sys.excepthook: Traceback (most recent call last): File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/dialog.py", line 720, in _run_exception_dialog(c, i, t, prev_hook, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/dialog.py", line 760, in _run_exception_dialog run_dialog(DIALOG_TYPE_ERROR, text, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/dialog.py", line 326, in run_dialog dialog.set_icon(metomi.rose.gtk.util.get_icon()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/util.py", line 639, in get_icon icon_path = locator.locate("etc/images/{0}-icon-trim.svg".format(system)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/resource.py", line 172, in locate raise ResourceError(key) metomi.rose.resource.ResourceError: etc/images/rose-icon-trim.svg: resource not found. Original exception was: Traceback (most recent call last): File "/home/jfrost/.conda/envs/rose-py3/bin/rose", line 8, in sys.exit(rose()) ^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 275, in rose main( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 390, in main exec_sub_cmd(ns, sub_cmd, cmd_args) File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 188, in exec_sub_cmd _exec_python( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 224, in _exec_python fcn() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1966, in main spawn_window(cwd, debug_mode=opts.debug_mode, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1807, in spawn_window metomi.rose.gtk.util.setup_stock_icons() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/util.py", line 708, in setup_stock_icons path = locator.locate("etc/images/rose-config-edit/" + ifile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/resource.py", line 172, in locate raise ResourceError(key) metomi.rose.resource.ResourceError: etc/images/rose-config-edit/gnome_add.png: resource not found. [jfrost@hafs01 bin]$ conda activate rose-py3 (rose-py3) [jfrost@hafs01 bin]$ /home/jfrost/.conda/envs/rose-py3/bin/rose edit (rose-py3) [jfrost@hafs01 bin]$ /home/jfrost/.conda/envs/rose-py3/bin/rose edit Traceback (most recent call last): File "/home/jfrost/.conda/envs/rose-py3/bin/rose", line 8, in sys.exit(rose()) ^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 275, in rose main( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 390, in main exec_sub_cmd(ns, sub_cmd, cmd_args) File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 188, in exec_sub_cmd _exec_python( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 224, in _exec_python fcn() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1966, in main spawn_window(cwd, debug_mode=opts.debug_mode, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1807, in spawn_window metomi.rose.gtk.util.setup_stock_icons() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/util.py", line 708, in setup_stock_icons path = locator.locate("etc/images/rose-config-edit/" + ifile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/resource.py", line 172, in locate raise ResourceError(key) metomi.rose.resource.ResourceError: etc/images/rose-config-edit/gnome_add.png: resource not found. Error in sys.excepthook: Traceback (most recent call last): File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/dialog.py", line 720, in _run_exception_dialog(c, i, t, prev_hook, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/dialog.py", line 760, in _run_exception_dialog run_dialog(DIALOG_TYPE_ERROR, text, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/dialog.py", line 326, in run_dialog dialog.set_icon(metomi.rose.gtk.util.get_icon()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/util.py", line 639, in get_icon icon_path = locator.locate("etc/images/{0}-icon-trim.svg".format(system)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/resource.py", line 172, in locate raise ResourceError(key) metomi.rose.resource.ResourceError: etc/images/rose-icon-trim.svg: resource not found. Original exception was: Traceback (most recent call last): File "/home/jfrost/.conda/envs/rose-py3/bin/rose", line 8, in sys.exit(rose()) ^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 275, in rose main( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 390, in main exec_sub_cmd(ns, sub_cmd, cmd_args) File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 188, in exec_sub_cmd _exec_python( File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/rose.py", line 224, in _exec_python fcn() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1966, in main spawn_window(cwd, debug_mode=opts.debug_mode, File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/config_editor/main.py", line 1807, in spawn_window metomi.rose.gtk.util.setup_stock_icons() File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/gtk/util.py", line 708, in setup_stock_icons path = locator.locate("etc/images/rose-config-edit/" + ifile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jfrost/.conda/envs/rose-py3/lib/python3.12/site-packages/metomi/rose/resource.py", line 172, in locate raise ResourceError(key) metomi.rose.resource.ResourceError: etc/images/rose-config-edit/gnome_add.png: resource not found. ```
astroDimitrios commented 2 months ago

Curious - presumably if you're checking out the repo/branch like that the files are actually there. Does doing an editable pip install make a difference?

jfrost-mo commented 2 months ago

As you said, running with pip install -e . picks up the files correctly. So it looks like these resource files are not being included in the wheel file when the package is built.

Aside from that it is now running at NIWA. :tada:

jfrost-mo commented 2 months ago

It looks like the MANIFEST.in file is improperly formatted. I'll make a pull request with a fix.