hiroshinishio / tetris

A Tetris Game for programming education in Japanese
MIT License
0 stars 0 forks source link

GitAuto: Replace PyQt5 with PyQt6 #6

Closed gitauto-for-dev[bot] closed 2 weeks ago

gitauto-for-dev[bot] commented 2 weeks ago

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

Test these changes locally

git checkout -b gitauto-wes/issue-#1-c5de7fce-2244-4cee-ac94-703e75f9413c
git pull origin gitauto-wes/issue-#1-c5de7fce-2244-4cee-ac94-703e75f9413c
gitauto-for-dev[bot] commented 2 weeks ago

Committed the Check Run build (3.9) error fix! Running it again...