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

PR: CI: Add workflow to run tests with PyQt6/PySide6 #23118

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rear1019
Copy link
Contributor

Description of Changes

This is a draft to add PyQt6/PySide6 to the CI as suggested in PR #22620:

  • The workflow file based on the existing one for Linux.
  • For now the tests run on Linux only.
  • Only pip-based installation is used as conda has no PyQt6 package yet.
  • The tests don’t run at all with PySide6 (SEGFAULT at collection phase of pytest). I can reproduce it locally, but haven’t looked into it.
  • The mostly run with PyQt6, however, there is a SEGFAULT at the end (haven’t looked into it).

Issue(s) Resolved

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

rear1019

push:
branches:
- master
- qt6_ci # for testing only
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using a cron-based trigger is probably more sensible for now?

The qt6_ci is for testing only and will be removed

Copy link
Member

Choose a reason for hiding this comment

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

Using a cron-based trigger is probably more sensible for now?

I don't think so. We should run the Qt6 slots as we do for other ones so we know when we break things for that version.

The qt6_ci is for testing only and will be removed

Ok, no problem.

Comment on lines +152 to +155
# .github/scripts/run_tests.sh || \
# .github/scripts/run_tests.sh || \
# .github/scripts/run_tests.sh || \
.github/scripts/run_tests.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commented out for faster testing.

Comment on lines +141 to +142
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For testing only, will be re-added

- name: Run tests
shell: bash -l {0}
env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For testing only, will be re-added

For now the tests run on Linux only. Only pip-based installation is used
as conda has no PyQt6 package yet. The workflow file based on the
existing one for Linux.
Fix 'extras_require' in setup.py to fix the warning. This requires fixes
for the parsing of dependencies in test_dependencies_in_sync.py: Use the
'packaging' module which simplifies the code.
Set parent object for QTimer and don’t use singleShot() static method.
This prevents the timer from being fired after the parent object is
destroyed.

The issue has been discovered with PyQt6 by test [1].

[1] spyder/plugins/editor/extensions/tests/test_closequotes.py::test_close_quotes
Some tests explicitly close the editorstack widget. qtbot also closes
the widget after the test finishes. The latter action may fail when
"delete on close" flag is set => reset the flag.
@rear1019
Copy link
Contributor Author

rear1019 commented Jan 7, 2025

@ccordoba12 I have added two PyQt6 fixes to this PR. There are still failures I haven’t looked into; see [1] for the most current CI run as of today. Nevertheless, I think we could consider merging the PR in order to move forward with Qt 6 support. Note there are some review comments [2].

Regarding PySide6 support: In [3] you mentioned that you have PySide6 related fixes. Would you mind providing them? We are more than happy to help the project with the Qt 6 transition (both PySide6 and PyQt6).

PS: You may have noticed that we provided less patches in 2024 than in the years before. This is because we had a stable experience with v5.4, and especially so with v5.5. Thank you and the whole dev team very much for this great project ❤️

[1] https://github.com/procitec/spyder/actions/runs/12652008190
[2] #23118 (review)
[3] #22620

@ccordoba12
Copy link
Member

ccordoba12 commented Jan 8, 2025

There are still failures I haven’t looked into; see [1] for the most current CI run as of today.

I'm really happy to see that there are really few failures! That's awesome!

Nevertheless, I think we could consider merging the PR in order to move forward with Qt 6 support. Note there are some review comments [2].

Agreed. Please skip the failing tests for Qt6 and post a list of them in a comment here. Then I'll merge.

Regarding PySide6 support: In [3] you mentioned that you have PySide6 related fixes. Would you mind providing them?

I'll try to do it soon (hopefully next week). But I think it'd be better to comment the PySide6 CI slots for now and work on support for it after my PR is merged.

What do you think?

We are more than happy to help the project with the Qt 6 transition (both PySide6 and PyQt6).

Thanks a lot! That will help us to provide more features in 6.1 for you and all other users.

PS: You may have noticed that we provided less patches in 2024 than in the years before. This is because we had a stable experience with v5.4, and especially so with v5.5. Thank you and the whole dev team very much for this great project ❤️

Thanks for your kind words. We're really happy to hear that your experience with Spyder has improved significantly in the last two years.

@ccordoba12
Copy link
Member

About the failure in test_dependencies_for_spyder_setup_extras_requires_in_sync, please skip checking pywin32 on it. That's the best we can do for now because conda environment yaml files don't handle selectors (i.e. packages for specific platforms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants