Skip to content

Conversation

@astroDimitrios
Copy link
Contributor

@astroDimitrios astroDimitrios commented Sep 10, 2024

As discussed this change updates rose config-edit (or just rose edit) to Python 3 / Gtk3.

  • First commit having run 2to3 and Pygobject over the old code 6a49dd7
  • Same for the gtk dir 8bccdcf
  • Splash screen updates 20ade08
  • Popup fixes in the MenuWidget 807bc56
  • Fix macro menus ed0780e

All seems to function par some cosmetic bugs which are outlined in the Issues on my fork.

@oliver-sanders oliver-sanders added this to the 2.4.0 milestone Sep 11, 2024
@astroDimitrios astroDimitrios marked this pull request as ready for review October 29, 2024 15:58
@oliver-sanders oliver-sanders self-requested a review October 31, 2024 11:06
@oliver-sanders

This comment was marked as outdated.

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have made a first pass over the code, looking good.

There's 186 commits here! We could do with squashing these down a bit to make it a bit more manageable.

@astroDimitrios astroDimitrios force-pushed the feature/rose-config-py3 branch 3 times, most recently from 5684ff9 to 4cf6267 Compare November 27, 2024 13:11
@J-J-Abram J-J-Abram force-pushed the feature/rose-config-py3 branch from d7fb376 to 07cd350 Compare November 27, 2024 15:36
@astroDimitrios astroDimitrios force-pushed the feature/rose-config-py3 branch 4 times, most recently from c5a6ee7 to edd7db0 Compare November 27, 2024 17:54
@oliver-sanders oliver-sanders modified the milestones: 2.4.0, 2.5.0 Dec 3, 2024
@astroDimitrios astroDimitrios force-pushed the feature/rose-config-py3 branch from 8d1aef1 to f345292 Compare December 10, 2024 14:15
@oliver-sanders
Copy link
Member

There are some flaky tests lurking in the battery at the moment (nothing to do with this PR), the following Mac OS failures can be ignored:

  • 02-360day-cycling
  • 13-app-arch-cmd-out
  • 30-app-arch-opt-source

oliver-sanders

This comment was marked as outdated.

@astroDimitrios

This comment was marked as outdated.

@wxtim

This comment was marked as outdated.

@wxtim

This comment was marked as outdated.

@astroDimitrios astroDimitrios force-pushed the feature/rose-config-py3 branch 3 times, most recently from 44e54eb to 3704bd5 Compare January 16, 2025 13:43
Gtk.ResponseType.ACCEPT,
)
self.window = Gtk.Dialog(buttons=buttons)
self.set_transient_for(parent_window)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relates to bug 15:

Rose 2019 code

Suggested change
self.set_transient_for(parent_window)
self.window.set_transient_for(parent_window)

Comment on lines 115 to 117
column.pack_start(cell, True, True, 0)
else:
column.pack_start(cell, False, True, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that pack_start only takes 3 vars (including self.)

These extra variables arent in the old code and don't look like they match the reference material

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For long term reference, @astroDimitrios explained to me that pack_start can have 2 or 4 (non self) args depending on which widget the message is attached to. 😢

@oliver-sanders
Copy link
Member

oliver-sanders commented Sep 19, 2025

Regular tests now passing 👍

The build tests are failing, they need system-level deps to be installed (apt-get or whatnot).

The docs tests are failing, not sure what's going on there, I think an import gi might be preventing rose edit --help from displaying, might want to delay that import.

Taking a look...

@wxtim
Copy link
Contributor

wxtim commented Sep 19, 2025

Issuyes 15 and 21 (which I labelled as "must fix") have been fixed by the latest changes (Thanks @benfitzpatrick). I still need to check through everything else.

I'll convert the should fix issues into their own tickets once I approve.

@oliver-sanders
Copy link
Member

oliver-sanders commented Sep 19, 2025

Have pushed a commit (6fee8f0) which should fix the tests.

The "Build" tests needed a bit of shimming due to the reliance of pygobject on system dependencies (Can't use Conda here it seems).

... Tests all passing.

@wxtim
Copy link
Contributor

wxtim commented Oct 13, 2025

22. Upgrade widget recursion

**Priority: ** Must fix - produces traceback - RecursionError

  1. Load all data
  2. Click on Metadata>Upgrade
  3. Click on one of these buttons
image

23. ChoicesValueWidget changes from C7=>C8

**Priority: ** Unclear, can probably punt this, but I can't rule it out being absolutely vital to a user.

image

Probably related error:

[FAIL] Could not import widget: Gtk.Box.pack_start() takes exactly 5 non-keyword arguments (2 given)

24. Stash Panel

24.a Enable an item in Stash

**Priority: ** Must - stash panel fails

Tested on /home/users/tim.pillinger/roses/trunk/rose-stem/app/um_ukv1p5_exp

Tried to enable or ignore a U COMPNT OF WIND AFTER TIME STEP

image

Similar errors from most of the right click menu items.

[Edit 2025-11-13] Can't replicate this any more

Fuller instructions * rose edit -C /home/users/tim.pillinger/roses/trunk/rose-stem/app/um_ukv1p5_exp * Nav to namelist > Model input and output > Stash requests and profiles > stash requests * Ignore or un-ignore an item.

24.b

**Priority: ** Must - Had to ctrl+c on CLI to escape. Pressing OK doesn't get you out.

Search add new stash requests dialog

Traceback (most recent call last):
  File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/plugin/um/widget/stash_add.py", line 435, in _filter_visible
    if self._filter_visible(model, child_iter):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AddStashDiagnosticsPanelv1._filter_visible() missing 1 required positional argument: '_'
  1. Garbage metadata not handled gracefully

**Priority: ** Must - traceback if metadata is invalid

Reporoduce:

cat > rose-app.conf <<__HERE__
[env]
cake=true
__HERE__

mkdir meta
cat > meta/rose-meta.conf << __HERE__
[env=cake]
garbage=foo
__HERE__
Traceback ``` > CYLC_COVERAGE=1 rose edit -C ~/cylc-src/rose-apps/meta/ -vvvvv --debug /home/users/tim.pillinger/conda-envs/cylc313/lib/python3.13/site-packages/coverage/inorout.py:460: CoverageWarning: --include is ignored because --source is set (include-ignored) self.warn("--include is ignored because --source is set", slug="include-ignored") Traceback (most recent call last): File "/home/users/tim.pillinger/conda-envs/cylc313/bin/rose", line 7, in sys.exit(rose()) ~~~~^^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/rose.py", line 368, in rose main( ~~~~^ 'rose', ^^^^^^^ ...<4 lines>... ), ^^ ) ^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/rose.py", line 486, in main exec_sub_cmd(ns, sub_cmd, cmd_args) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/rose.py", line 273, in exec_sub_cmd _exec_python( ~~~~~~~~~~~~^ ns, ^^^ ...<2 lines>... args, ^^^^^ ) ^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/rose.py", line 309, in _exec_python fcn() ~~~^^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/main.py", line 2284, in main spawn_window( ~~~~~~~~~~~~^ cwd, ^^^^ ...<6 lines>... no_warn=opts.no_warn, ^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/main.py", line 2122, in spawn_window ctrl = MainController( config_directory_path, ...<5 lines>... no_warn=no_warn, ) File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/main.py", line 314, in __init__ self.data.load( ~~~~~~~~~~~~~~^ config_directory, ^^^^^^^^^^^^^^^^^ ...<3 lines>... load_no_apps=load_no_apps, ^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/data.py", line 244, in load self.load_top_config( ~~~~~~~~~~~~~~~~~~~~^ top_level_directory, ^^^^^^^^^^^^^^^^^^^^ ...<2 lines>... metadata_off=metadata_off, ^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/data.py", line 316, in load_top_config self.load_config(top_level_directory) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/data.py", line 458, in load_config self.filter_meta_config(name) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/config_editor/data.py", line 1059, in filter_meta_config metomi.rose.gtk.dialog.run_dialog( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ metomi.rose.gtk.dialog.DIALOG_TYPE_ERROR, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... extra_text=reports_text, ^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/users/tim.pillinger/repos/rose/metomi/rose/gtk/dialog.py", line 370, in run_dialog dialog.action_area.pack_start(info_button, expand=False, fill=False) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Gtk.Box.pack_start() takes exactly 5 non-keyword arguments (2 given)
</details>

@wxtim
Copy link
Contributor

wxtim commented Oct 13, 2025

My latest coverages are at https://wwwspice/~tim.pillinger/cov/rose-edit-live/

@wxtim
Copy link
Contributor

wxtim commented Oct 16, 2025

I have achieved 87% coverage with manual testing. I'm going to suggest that further review/manual testing is probably reaching a point of diminishing returns.

@benfitzpatrick
Copy link
Contributor

See astroDimitrios#53

@oliver-sanders
Copy link
Member

Reviewers, please carefully check the diffs to non-rose-edit files:

  • macro.py
  • reporter.py
  • resource.py
  • rose.py
  • upgrade.py

Copy link
Contributor

@wxtim wxtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I've just double checked the files Oliver mentioned and I have some questions.

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have dug through the non-rose-edit files and made a shallow code-skim of the whole PR.

A few small alterations to resolve some minor issues and fix the lint check:

github.com/oliver-sanders/rose/pull/new/feature/rose-config-py3

@wxtim, this will need testing, in particular look for broken icons.

Comment on lines +186 to +191
# self.button.connect(
# "activate",
# lambda b: self._popup_option_menu(
# self.option_ui,
# self.actions,
# Gdk.Event(Gdk.KEY_PRESS)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Work out what this did and what we should do about it!

(note the FIXME was pre-existing)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spun out as #2987

@wxtim
Copy link
Contributor

wxtim commented Jan 26, 2026

I too have a PR to this PR, but it's low importance and can be re-targeted at master astroDimitrios#55

@wxtim wxtim self-requested a review January 27, 2026 06:04
@wxtim
Copy link
Contributor

wxtim commented Jan 27, 2026

This PR: astroDimitrios#56 undoes a regression from #2288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants