Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running at NIWA #37

Closed
jfrost-mo opened this issue Sep 24, 2024 · 3 comments
Closed

Running at NIWA #37

jfrost-mo opened this issue Sep 24, 2024 · 3 comments

Comments

@jfrost-mo
Copy link

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 <module>
    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 <lambda>
    _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 <module>
    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 <module>
    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 <lambda>
    _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 <module>
    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
Copy link
Owner

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
Copy link
Author

jfrost-mo commented Sep 26, 2024

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. 🎉

@jfrost-mo
Copy link
Author

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

jfrost-mo added a commit to jfrost-mo/rose that referenced this issue Sep 26, 2024
This means that they get included in the wheel file when the package is
built, and they actually get found at runtime.

Fixes astroDimitrios#37
astroDimitrios pushed a commit that referenced this issue Sep 27, 2024
This means that they get included in the wheel file when the package is
built, and they actually get found at runtime.

Fixes #37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants