Breaking Changes: Upgrading to PyQt6 introduces changes that are not backward compatible with PyQt5.
Python Version Requirement: PyQt6 requires Python 3.6 or newer.
Decision: Since the benefits outweigh the drawbacks, and assuming our user base is able to upgrade, we accept the loss of backward compatibility with PyQt5.
Alternative Options:
Dual Support: Attempting to support both PyQt5 and PyQt6 increases complexity and is not recommended.
Separate Branch: Maintain a separate branch for PyQt5 support if necessary.
By proceeding with the upgrade, we acknowledge that users will need to have an environment compatible with PyQt6, which is aligned with keeping the project modern and up to date.
Resolves #1
What is the feature
Update the project dependencies and codebase from PyQt5 to the latest version, PyQt6.
Why we need the feature
Upgrading to PyQt6 brings several benefits:
Staying current with dependencies ensures the project remains robust, secure, and easier to maintain in the long run.
How to implement and why
Step 1: Update Dependency Files
requirements.txt
andrequirements.pytorch.txt
:Step 2: Update Import Statements
Replace all PyQt5 imports in the codebase. For example:
Adjust enums and flags, as some have moved or changed:
Step 3: Update Code for API Changes
print
statements are compatible with Python 3 (use parentheses).Signal and Slot Connections: Update any deprecated connection styles:
(Connection syntax remains largely the same but check for any deprecations.)
Step 4: Test the Application
Step 5: Update Documentation
README.md
doc/
directory.Why This Approach
About backward compatibility
By proceeding with the upgrade, we acknowledge that users will need to have an environment compatible with PyQt6, which is aligned with keeping the project modern and up to date.
Test these changes locally