Skip to content

Conversation

@greghope667
Copy link
Contributor

@greghope667 greghope667 commented Apr 14, 2023

Summary of changes

  • Updates Plover to use PySide6 instead of Qt5, resolves Migrate away from PyQt5 #1713
  • Integrate Plugins Manager to simplify build and reduce dependencies

To be handled in separate PRs:

  • Possibly creating a registry_v2.json in plover_plugins_registry
    in case we want to start removing migrated plugins from the registry.json for plover 4
  • Bumping the python version and other dependencies
  • More detailed developer documentation, especially on how to run from source

Pull Request Checklist

  • Changes have tests
  • News fragment added in news.d. See documentation for details

Progress

  • Convert Qt5 api calls to PySide6
  • Tested on Windows/Mac/Linux
  • Include resources (icons) in built package
  • Update Windows/Mac/Linux build scripts
  • Enable dark mode (via updating to PySide>6.5) (doesn't work on macOS yet because of how the installer is built. Will be fixed in a separate PR)
  • Update plover version to 5.0.0.dev1 as this is a breaking change
  • Figure out how this breaks plugins and fix them (Plugin manger updated, other plugins to follow)
  • Reduce size of installer files

Tests

  • macOS M1 (15.3.2) (@mkrnr: run from source and install via DMG)
  • Windows 11 x64 (@mkrnr: run from source and install via EXE)
  • Ubuntu 24.4 x64 (@mkrnr: run from source and install via AppImage)
  • Ubuntu 24.4 ARM (@mkrnr: only run from source since AppImage is built for x64)
  • Migrated a QT plugin (plover-combo, see here) as a proof of concept and was able to run in

Installer Files

If you want to test the installer files yourself, you can check the GitHub Actions runs like this one. In some cases, not all installer files are included since not all steps in the GitHub actions were executed. In that case, check the previous runs.

After Merge

  • Delete continuous build (will be removed completely in a separate PR, see this discord thread)

@greghope667 greghope667 changed the title Qt6 Conversion [WIP] Qt6 Conversion Apr 14, 2023
@mkrnr
Copy link
Contributor

mkrnr commented Apr 17, 2023

Thank you so much for working on this! This migration is incredibly important for the maintainability of plover.

I'm happy to test this the next days on Windows, Linux, and macOS.

Let me know if there's anything else I can do to help.

@greghope667
Copy link
Contributor Author

@mkrnr Any testing you can do would be very helpful. Post any error messages or not-working features here.

If there are any plugins you use that you can test that would be useful, although I expect only non-graphical plugins have a chance of working without updates.

The packaging systems need fixing too (see all the red in the CI right now...) . I'll take a look into that over the next few days/weeks but if anyone knows how all the packaging scripts work then help would be appreciated.

@Robberduckzilla
Copy link
Contributor

Launches successfully on Apple Silicon Macbook Air (M2 chip). Qt6 takes system theme (Dark) too, neat!

@mkrnr
Copy link
Contributor

mkrnr commented Apr 28, 2023

Here are some tests on Windows 11 64 bit using a Georgi:

tox r -e launch

all built-in functionality works flawlessly:

  • Add translation
  • Lookup
  • Paper Tape
  • Suggestions
  • Add/create/edit/delete dictionary
  • Writing steno
  • Anything else I tried

Warnings during start, maybe the one regarding gui_gt can be fixed:

warning: no previously-included files found matching '.gitignore'
adding license file 'LICENSE.txt'
warning: no previously-included files found matching 'plover\gui_qt\*_rc.py'
warning: no previously-included files found matching 'plover\gui_qt\*_ui.py'
warning: no previously-included files found matching 'plover\gui_qt\.gitignore'
no previously-included directories found matching '.github'

tox r -e test

only failures are in:

test\gui_qt\test_dictionaries_widget.py ..................................FFF

This fails on the master as well and is likely fixed by #1599.

tox r -e plugins_install

Executed successfully. Is there a way to test this at this point? Because when I then run tox r -e launch it recreates the env because the env type changes.

tox r -e plugins_install -- C:\Users\mkoer\git\plover_regenpfeifer

Executed successfully. Don't know how to test this, see above.

tox r -e packaging_checks

packaging_checks: commands[0]> bash --noprofile --norc -eo pipefail -c " . ./plover_build_utils/functions.sh; python=python; \"$@\"" -- packaging_checks
packaging_checks: exit 2 (.02 seconds) C:\Users\mkoer\git\greghope667-plover> bash --noprofile --norc -eo pipefail -c " . ./plover_build_utils/functions.sh; python=python; \"$@\"" -- packaging_checks
.pkg: _exit> python c:\users\mkoer\git\greghope667-plover\venv\lib\site-packages\pyproject_api\_backend.py True setuptools.build_meta
  packaging_checks: FAIL code 2 (81.95=setup[81.94]+cmd[0.02] seconds)
  evaluation failed :( (82.56 seconds)

tox r -e release_prepare

release_prepare: commands[0]> bash --noprofile --norc -eo pipefail -c " . ./plover_build_utils/functions.sh; python=python; \"$@\"" -- release_prepare
release_prepare: exit 2 (0.01 seconds) C:\Users\mkoer\git\greghope667-plover> bash --noprofile --norc -eo pipefail -c " . ./plover_build_utils/functions.sh; python=python; \"$@\"" -- release_prepare
.pkg: _exit> python c:\users\mkoer\git\greghope667-plover\venv\lib\site-packages\pyproject_api\_backend.py True setuptools.build_meta
  release_prepare: FAIL code 2 (75.69=setup[75.67]+cmd[0.01] seconds)
  evaluation failed :( (76.28 seconds)

@greghope667
Copy link
Contributor Author

Thanks for running the tests, that's great to know this works for other people.

Warnings during start, maybe the one regarding gui_gt can be fixed:

Don't think these warnings happened for Qt5 - I'll look at what's causing these messages

Executed successfully. Is there a way to test this at this point? Because when I then run tox r -e launch it recreates the env because the env type changes.

You might be able to launch plover directly using the environment created by tox. Enter the environment (something like source .tox/dev/bin/activate.bat, might be a slightly different path), then run with python -m plover. I think there's some way to directly run commands through tox in a given environment too but will have to check.

I'm going to look at packaging this, then hopefully we'll be able to share this and get some beta testers for a Qt6 Plover release.

@mkrnr
Copy link
Contributor

mkrnr commented May 2, 2023

I'll give that a try next days, thanks!

We'll also have to look into updating plover_plugins_manager to Qt6 since that's such an integral part of plover. Did you look into that already by any chance?

@greghope667 greghope667 force-pushed the pyqt6-migration branch 4 times, most recently from bed0d2b to d7065ba Compare May 3, 2023 22:05
Switch builds to PyQt6
Include resources folder in distribution
Remove extra MANIFEST.in entries to silence warnings
Pin PyQt6-Qt6 - https://github.com/googlefonts/fontra-pak/pull/27
Add pyqt6rc to test/build requirements
@greghope667
Copy link
Contributor Author

I've had a quick look at the plugin manager - there are a few small changes needed there for Qt6 but shouldn't be anything too major. We'll need to update both this project and the plugin manager together though as they're mutually dependent.

@mkrnr
Copy link
Contributor

mkrnr commented Jun 25, 2023

Awesome to see your progress on this, now with the plugin manager migration!

I'd like to help you testing this but when I launch with tox (tox r -e launch) the plugin manager is still not included. Could you share how you test this? I also tried building the packages on windows but was not successful.

@greghope667
Copy link
Contributor Author

Most of my recent testing has been through the CI system in GitHub, just fixing errors and getting the builds working. The CI versions have the plugin manager bundled (which was causing build failures using a non-patched Qt5 plugin manager version) - you can download these as build artefacts. Seems to work for the Linux AppImage, but the Windows exe doesn't yet run. I've yet to sort out how to use the plugin manager successfully when launching locally from tox.

Getting local builds to work is not easy - you have to have almost exactly the same setup (including library versions) that the build scripts need else you'll get a bunch of unhelpful error messages from pip. I've also run into issues where some of the download sources for build scripts are rate limited so stop working after a few attempts. Honestly the build system needs work to be simplified, it's a little unmanageable right now.

@appetrosyan
Copy link

do you need any help with this? eager to get a better working version of plover.

@mkrnr
Copy link
Contributor

mkrnr commented Apr 2, 2025

do you need any help with this? eager to get a better working version of plover.

Thanks a lot @appetrosyan for offering support!

Since the notification issues are fixed now, the most important help would be thorough testing and reviewing the changes. That's what I'll focus on over the week or so. Other changes like bumping python and other dependencies should come in a separate PR.

Feel free to reach out in the plover-dev channel on the plover discord!

@mkrnr mkrnr removed the in-progress label Apr 10, 2025
@mkrnr mkrnr marked this pull request as ready for review April 10, 2025 06:35
@mkrnr mkrnr requested a review from a team April 10, 2025 06:38
@mkrnr mkrnr self-assigned this Apr 17, 2025
@mkrnr mkrnr modified the milestone: v5.0.0 Apr 17, 2025
@mkrnr
Copy link
Contributor

mkrnr commented Apr 20, 2025

Merging this PR without review. Several people gave positive feedback after testing though.

@mkrnr mkrnr merged commit ecb4f90 into opensteno:main Apr 20, 2025
12 checks passed
@user202729
Copy link
Member

It's such a massive change though. I may report any breaking API change later but it may take a while (given I have several custom modifications/patches to Plover that need to be ported).

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.

Migrate away from PyQt5

5 participants