Replace the current usage of PyQt5 in the project with PyQt6.
Why we need the feature
Access to Latest Features: PyQt6 provides the latest features and improvements from the Qt framework, enhancing the application's functionality and performance.
Long-Term Support: As PyQt6 is the most recent version, it will receive updates and support for a longer period compared to PyQt5.
Improved Compatibility: Upgrading ensures better compatibility with newer operating systems and environments, reducing potential issues related to deprecated components.
Security Enhancements: Newer versions often include security patches that address vulnerabilities present in older versions.
How to implement and why
Update Dependencies:
Modify requirements.txt and requirements.pytorch.txt to replace PyQt5 with PyQt6.
# In requirements.txt and requirements.pytorch.txt
- PyQt5
+ PyQt6
Reason: Ensures that the correct version of PyQt is installed during the environment setup.
Modify Imports in Codebase:
Search for all instances of PyQt5 imports in the code, especially within the game_manager directory.
# Original import
from PyQt5 import QtWidgets, QtCore
# Updated import
from PyQt6 import QtWidgets, QtCore
Reason: The import statements need to point to PyQt6 to utilize the new library.
Address API Changes:
Update code to accommodate changes in the PyQt6 API. For example:
Enum access has changed (e.g., QtCore.Qt.AlignmentFlag.AlignCenter instead of QtCore.Qt.AlignCenter).
Certain methods and attributes may have been updated or deprecated.
Explicitly specify argument types where required.
Reason: PyQt6 introduces several breaking changes that need to be addressed to ensure the application runs correctly.
Update Docker Configurations:
Modify Docker-related files in the docker directory and docker-compose.yaml files to install PyQt6 instead of PyQt5.
Reason: Ensures that containerized environments are consistent with the updated dependencies.
Thorough Testing:
Test all GUI components and functionalities to identify any issues arising from the upgrade.
Focus on dialog windows, event handling, and custom widgets.
Reason: To validate that the application behaves as expected and to fix any bugs introduced due to the API changes.
About backward compatibility
Python Version Requirements:
PyQt6 requires Python 3.6 or higher.
Consideration: If the project needs to support environments with older Python versions, this could pose a compatibility issue.
API Breaking Changes:
PyQt6 has significant changes compared to PyQt5, leading to potential incompatibilities.
Impact: Existing code may break without proper adjustments, affecting users relying on the current behavior.
Maintaining Support for PyQt5:
Option: Maintain a separate branch or version that continues to support PyQt5.
Reason: Allows users dependent on the existing setup to continue using the application without disruption.
Documentation:
Update documentation to reflect the changes and guide users through any new setup procedures.
Reason: Helps users adapt to the changes smoothly, minimizing confusion.
Decision:
Assess the user base and determine if the benefits of upgrading outweigh the potential drawbacks.
If backward compatibility is crucial for a significant portion of users, consider providing support for both versions during a transition period.
Resolves #1
What is the feature
Replace the current usage of PyQt5 in the project with PyQt6.
Why we need the feature
How to implement and why
Update Dependencies:
requirements.txt
andrequirements.pytorch.txt
to replacePyQt5
withPyQt6
.Modify Imports in Codebase:
PyQt5
imports in the code, especially within thegame_manager
directory.Address API Changes:
QtCore.Qt.AlignmentFlag.AlignCenter
instead ofQtCore.Qt.AlignCenter
).Update Docker Configurations:
docker
directory anddocker-compose.yaml
files to install PyQt6 instead of PyQt5.Thorough Testing:
About backward compatibility
Python Version Requirements:
API Breaking Changes:
Maintaining Support for PyQt5:
Documentation:
Decision:
Test these changes locally