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

Upgrade to pyqt6 #9860

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Upgrade to pyqt6 #9860

wants to merge 2 commits into from

Conversation

JHolba
Copy link
Contributor

@JHolba JHolba commented Jan 23, 2025

Upgrading to PyQt6 as Qt5 seems to be end of service since 2023-05-26 for non subscription holders.
https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders

Approach
Change package to PyQt6 and fix all incompatibilities and typing
Tried PySide6(#9586) first, but it causes segfaults during testing.

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests tests/everest -n auto --hypothesis-profile=fast -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@JHolba JHolba self-assigned this Jan 23, 2025
Copy link

codspeed-hq bot commented Jan 23, 2025

CodSpeed Performance Report

Merging #9860 will not alter performance

Comparing JHolba:use-pyqt6 (4585071) with main (f7ccd3d)

Summary

✅ 24 untouched benchmarks

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 88.44037% with 63 lines in your changes missing coverage. Please review.

Project coverage is 91.65%. Comparing base (02df6ee) to head (6b6ab7a).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/ert/gui/model/node.py 76.31% 9 Missing ⚠️
src/ert/gui/simulation/run_dialog.py 77.50% 9 Missing ⚠️
.../tools/plot/customize/limits_customization_view.py 52.94% 8 Missing ⚠️
src/ert/gui/tools/plugins/process_job_dialog.py 61.11% 7 Missing ⚠️
src/ert/gui/tools/plot/customize/color_chooser.py 66.66% 4 Missing ⚠️
src/ert/gui/ertwidgets/checklist.py 66.66% 2 Missing ⚠️
src/ert/gui/simulation/view/realization.py 87.50% 2 Missing ⚠️
src/ert/gui/tools/file/file_dialog.py 75.00% 2 Missing ⚠️
...c/ert/gui/tools/load_results/load_results_panel.py 60.00% 2 Missing ⚠️
.../ert/gui/tools/manage_experiments/storage_model.py 90.00% 2 Missing ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9860      +/-   ##
==========================================
+ Coverage   91.62%   91.65%   +0.03%     
==========================================
  Files         422      422              
  Lines       26466    26515      +49     
==========================================
+ Hits        24249    24303      +54     
+ Misses       2217     2212       -5     
Flag Coverage Δ
cli-tests 39.20% <0.36%> (-0.08%) ⬇️
everest-models-test 33.59% <0.36%> (-0.07%) ⬇️
gui-tests 74.55% <83.11%> (+0.07%) ⬆️
performance-and-unit-tests 73.90% <75.96%> (+0.07%) ⬆️
test 39.90% <0.36%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JHolba JHolba changed the title Use pyqt6 Upgrade to pyqt6 Jan 24, 2025
@JHolba JHolba added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Jan 24, 2025
@JHolba JHolba mentioned this pull request Jan 24, 2025
9 tasks
@JHolba JHolba marked this pull request as ready for review January 24, 2025 11:29
@xjules
Copy link
Contributor

xjules commented Jan 24, 2025

Have you checked whether the Qt6 binaries are actually present; ie. when running with komodo?

@JHolba
Copy link
Contributor Author

JHolba commented Jan 24, 2025

Have you checked whether the Qt6 binaries are actually present; ie. when running with komodo?

All the .so files are installed together with the package when running pip install locally at least. Have not tried specifically with komodo.

Upgrade from qtpy with pyqt5 to PyQt6.
Using PyQt6 directly should give us better typing.
PySide6 was tested, but was unstable.
@eivindjahren
Copy link
Contributor

We can fix this later, but the progress bar color changed:
image

Copy link
Contributor

@eivindjahren eivindjahren left a comment

Choose a reason for hiding this comment

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

We need to fix up the progress bar color, otherwise this seems really nice! Good job 🎉

if: inputs.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libegl1
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure this is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was for pyside6. I can remove it and see what happens with pyqt6

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it did not work without libegl1

@@ -316,7 +319,7 @@ def __add_help_menu(self) -> None:
help_link_item = help_menu.addAction(menu_label)
assert help_link_item is not None
help_link_item.setMenuRole(QAction.MenuRole.ApplicationSpecificRole)
help_link_item.triggered.connect(functools.partial(webbrowser.open, link)) # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
Status: Reviewed
Development

Successfully merging this pull request may close these issues.

4 participants