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

Use PySide6 #9586

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

Use PySide6 #9586

wants to merge 12 commits into from

Conversation

JHolba
Copy link
Contributor

@JHolba JHolba commented Dec 18, 2024

Upgrade from qtpy with pyqt5 to PySide6.
Using PySide6 directly should give us better typing.

  • 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 -n logical -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 Dec 18, 2024
@JHolba JHolba marked this pull request as draft December 18, 2024 12:20
@JHolba JHolba added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Dec 18, 2024
@JHolba JHolba force-pushed the use-pyside6 branch 10 times, most recently from be4a6dc to c7090c4 Compare December 18, 2024 13:24
Copy link

codspeed-hq bot commented Dec 18, 2024

CodSpeed Performance Report

Merging #9586 will not alter performance

Comparing JHolba:use-pyside6 (c235e08) with main (4480295)

Summary

✅ 24 untouched benchmarks

@JHolba JHolba force-pushed the use-pyside6 branch 2 times, most recently from 429fc1e to a397c37 Compare December 18, 2024 15:01
@jonathan-eq
Copy link
Contributor

It fails locally on MacOS with python3.12, but I got it working by modifying:

@pytest.fixture
def panel_with_localization_on(qtbot: QtBot):
    def func(settings, ensemble_size):
        widget = AnalysisModuleVariablesPanel(settings, ensemble_size)
        qtbot.addWidget(widget)
        widget.show()
        check_box = widget.findChild(QCheckBox, name="localization")
        qtbot.mouseClick(check_box, Qt.MouseButton.LeftButton)
        return settings, widget

    yield func

@jonathan-eq
Copy link
Contributor

When it failed it emitted:

---------------------------------------------------------------------------------------------------------------------------------------- Captured Qt messages ----------------------------------------------------------------------------------------------------------------------------------------
QtWarningMsg: Populating font family aliases took 77 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
QtWarningMsg: This plugin does not support propagateSizeHints()

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 85.35262% with 81 lines in your changes missing coverage. Please review.

Project coverage is 91.74%. Comparing base (1ae12f6) to head (e365616).

Files with missing lines Patch % Lines
.../tools/plot/customize/limits_customization_view.py 39.13% 14 Missing ⚠️
src/ert/gui/model/node.py 75.60% 10 Missing ⚠️
src/ert/gui/tools/plugins/process_job_dialog.py 57.14% 9 Missing ⚠️
.../ert/gui/tools/plot/widgets/clearable_line_edit.py 62.50% 6 Missing ⚠️
src/ert/gui/ertwidgets/searchbox.py 60.00% 4 Missing ⚠️
src/ert/gui/simulation/run_dialog.py 84.00% 4 Missing ⚠️
...t/gui/tools/plot/plot_ensemble_selection_widget.py 60.00% 4 Missing ⚠️
src/ert/gui/ertwidgets/listeditbox.py 72.72% 3 Missing ⚠️
.../gui/tools/plot/customize/customize_plot_dialog.py 82.35% 3 Missing ⚠️
src/ert/gui/ertwidgets/checklist.py 66.66% 2 Missing ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9586      +/-   ##
==========================================
+ Coverage   91.71%   91.74%   +0.02%     
==========================================
  Files         426      426              
  Lines       26529    26541      +12     
==========================================
+ Hits        24332    24349      +17     
+ Misses       2197     2192       -5     
Flag Coverage Δ
cli-tests 39.79% <0.18%> (-0.03%) ⬇️
everest-models-test 34.15% <0.18%> (-0.02%) ⬇️
gui-tests 74.38% <79.38%> (+0.02%) ⬆️
integration-test 37.98% <0.18%> (-0.02%) ⬇️
performance-tests 51.62% <59.31%> (-0.08%) ⬇️
test 39.51% <0.18%> (-0.02%) ⬇️
unit-tests 74.27% <72.69%> (+0.05%) ⬆️

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

JHolba commented Dec 19, 2024

It fails locally on MacOS with python3.12, but I got it working by modifying:

@pytest.fixture
def panel_with_localization_on(qtbot: QtBot):
    def func(settings, ensemble_size):
        widget = AnalysisModuleVariablesPanel(settings, ensemble_size)
        qtbot.addWidget(widget)
        widget.show()
        check_box = widget.findChild(QCheckBox, name="localization")
        qtbot.mouseClick(check_box, Qt.MouseButton.LeftButton)
        return settings, widget

    yield func

Thank you for the help :)

@JHolba JHolba force-pushed the use-pyside6 branch 3 times, most recently from 09e02d1 to fcb1ddc Compare December 19, 2024 13:56
@JHolba JHolba marked this pull request as ready for review December 19, 2024 14:10
@jonathan-eq jonathan-eq self-requested a review December 20, 2024 06:57
Comment on lines 65 to 66
def keyPressEvent(self, arg__1: QKeyEvent) -> None:
if arg__1 is not None and arg__1.key() == Qt.Key.Key_Escape:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we checking if it is not None, if the parameter cannot be None?

Copy link
Contributor

@jonathan-eq jonathan-eq left a comment

Choose a reason for hiding this comment

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

Very good! I have some questions, see comments :)

@JHolba JHolba force-pushed the use-pyside6 branch 3 times, most recently from b5bb693 to 3d745d7 Compare January 3, 2025 09:17
@JHolba JHolba force-pushed the use-pyside6 branch 5 times, most recently from 79c72af to e365616 Compare January 9, 2025 21:03
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: Ready for Review
Development

Successfully merging this pull request may close these issues.

3 participants