Sat, 10 Jul 2021 12:31:31 +0200
Changed quite a few PyQt5 references to PyQt6.
--- a/eric7/Globals/__init__.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Globals/__init__.py Sat Jul 10 12:31:31 2021 +0200 @@ -257,15 +257,16 @@ return distutils.sysconfig.get_python_lib(True) -def getPyQt5ModulesDirectory(): +# TODO: change this for PyQt6 +def getPyQt6ModulesDirectory(): """ - Function to determine the path to PyQt5 modules directory. + Function to determine the path to PyQt6 modules directory. - @return path to the PyQt5 modules directory (string) + @return path to the PyQt6 modules directory (string) """ import distutils.sysconfig - pyqtPath = os.path.join(distutils.sysconfig.get_python_lib(True), "PyQt5") + pyqtPath = os.path.join(distutils.sysconfig.get_python_lib(True), "PyQt6") if os.path.exists(pyqtPath): return pyqtPath
--- a/eric7/PipInterface/Pip.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/PipInterface/Pip.py Sat Jul 10 12:31:31 2021 +0200 @@ -295,9 +295,13 @@ @return flag indicating to abort the upgrade attempt @rtype bool """ - pyqtPackages = [p for p in packages - if p.lower() in ["pyqt5", "pyqt5-sip", "pyqtwebengine", - "qscintilla", "sip"]] + pyqtPackages = [ + # TODO: extend this list for PyQt 6.2 + p for p in packages if p.lower() in [ + "pyqt6", "pyqt6-sip", "pyqt6-webengine", "pyqt6-charts", + "pyqt6-qscintilla", + ] + ] abort = ( not EricMessageBox.yesNo(
--- a/eric7/Plugins/PluginWizardQFileDialog.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Plugins/PluginWizardQFileDialog.py Sat Jul 10 12:31:31 2021 +0200 @@ -47,7 +47,7 @@ super().__init__(ui) self.__ui = ui - # PyQt5 + # PyQt5/PyQt6 self.__pyqtRe = re.compile(r"(?:import|from)\s+PyQt([56])") def activate(self): @@ -125,7 +125,7 @@ @param editor reference to the current editor @type Editor @param variant variant of code to be generated - (-1 = EricFileDialog, 0 = unknown, 5 = PyQt5) + (-1 = EricFileDialog, 0 = unknown, 5 = PyQt5, 6 = PyQt6) @type int @return the generated code (string) """
--- a/eric7/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py Sat Jul 10 12:31:31 2021 +0200 @@ -33,7 +33,7 @@ Constructor @param dialogVariant variant of the file dialog to be generated - (-1 = EricFileDialog, 0 = unknown, 5 = PyQt5) + (-1 = EricFileDialog, 0 = unknown, 5 = PyQt5, 6 = PyQt6) @type int @param parent parent widget @type QWidget @@ -146,8 +146,8 @@ elif txt == "PyQt6": self.__dialogVariant = 6 else: - # default is PyQt5 - self.__dialogVariant = 5 + # default is PyQt6 + self.__dialogVariant = 6 self.__toggleInitialFilterAndResult( self.__typeButtonsGroup.checkedId())
--- a/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardDialog.py Sat Jul 10 12:31:31 2021 +0200 @@ -140,7 +140,7 @@ def __sendCommand(self, command, **kw): """ - Private method to send a command to the PyQt5 server. + Private method to send a command to the server. @param command dictionary with command string and related data (dict) @@ -159,7 +159,7 @@ def __receiveResponse(self): """ - Private method to receive a response from the PyQt5 server. + Private method to receive a response from the server. @return response dictionary (dict) """ @@ -172,8 +172,8 @@ EricMessageBox.critical( self, self.tr("Communication Error"), - self.tr("""<p>The PyQt5 backend reported""" - """ an error.</p><p>{0}</p>""") + self.tr("""<p>The backend reported an error.</p>""" + """<p>{0}</p>""") .format(responseDict["error"])) responseDict = {} @@ -181,7 +181,7 @@ def shutdown(self): """ - Public method to shut down the PyQt5 server part. + Public method to shut down the server part. """ self.__sendCommand("exit") self.__pyqt6Server.waitForFinished(5000) @@ -529,14 +529,12 @@ EricMessageBox.critical( self, self.tr("Communication Error"), - self.tr("""Invalid response received from""" - """ PyQt5 backend.""")) + self.tr("""Invalid response received from backend.""")) else: EricMessageBox.critical( self, self.tr("Communication Error"), - self.tr("""Communication with PyQt5 backend""" - """ failed.""")) + self.tr("""Communication with backend failed.""")) else: EricMessageBox.critical( self, @@ -700,14 +698,12 @@ EricMessageBox.critical( self, self.tr("Communication Error"), - self.tr("""Invalid response received from""" - """ PyQt5 backend.""")) + self.tr("""Invalid response received from backend.""")) else: EricMessageBox.critical( self, self.tr("Communication Error"), - self.tr("""Communication with PyQt5""" - """ backend failed.""")) + self.tr("""Communication with backend failed.""")) else: EricMessageBox.critical( self,
--- a/eric7/Preferences/__init__.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Preferences/__init__.py Sat Jul 10 12:31:31 2021 +0200 @@ -2941,7 +2941,7 @@ s = QLibraryInfo.path( QLibraryInfo.LibraryPath.TranslationsPath) if s == "" and Globals.isWindowsPlatform(): - transPath = os.path.join(Globals.getPyQt5ModulesDirectory(), + transPath = os.path.join(Globals.getPyQt6ModulesDirectory(), "translations") if os.path.exists(transPath): s = transPath
--- a/eric7/Project/PropertiesDialog.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Project/PropertiesDialog.py Sat Jul 10 12:31:31 2021 +0200 @@ -97,7 +97,7 @@ curIndex = self.projectTypeComboBox.findData( self.project.pdata["PROJECTTYPE"]) if curIndex == -1: - curIndex = self.projectTypeComboBox.findData("PyQt5") + curIndex = self.projectTypeComboBox.findData("PyQt6") self.projectTypeComboBox.setCurrentIndex(curIndex) self.dirPicker.setText(self.project.ppath) self.versionEdit.setText(self.project.pdata["VERSION"]) @@ -137,7 +137,7 @@ self.languageComboBox.setCurrentIndex( self.languageComboBox.findText("Python3")) self.projectTypeComboBox.setCurrentIndex( - self.projectTypeComboBox.findData("PyQt5")) + self.projectTypeComboBox.findData("PyQt6")) self.dirPicker.setText(self.__initPaths[0]) self.versionEdit.setText('0.1') self.vcsLabel.hide()
--- a/eric7/QScintilla/APIsManager.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/QScintilla/APIsManager.py Sat Jul 10 12:31:31 2021 +0200 @@ -210,7 +210,7 @@ if self.__apis is not None: if Globals.isWindowsPlatform(): qsciPath = os.path.join( - Globals.getPyQt5ModulesDirectory(), "qsci") + Globals.getPyQt6ModulesDirectory(), "qsci") if os.path.exists(qsciPath): # it's the installer if self.__lexer.lexerName() is not None:
--- a/eric7/Snapshot/SnapWidget.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Snapshot/SnapWidget.py Sat Jul 10 12:31:31 2021 +0200 @@ -8,7 +8,7 @@ """ # -# SnapWidget and its associated modules are PyQt5 ports of Ksnapshot. +# SnapWidget and its associated modules are PyQt6 ports of Ksnapshot. # import os
--- a/eric7/Toolbox/Startup.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Toolbox/Startup.py Sat Jul 10 12:31:31 2021 +0200 @@ -163,7 +163,7 @@ Module function to set the Qt library paths correctly for windows systems. """ if Globals.isWindowsPlatform(): - libPath = os.path.join(Globals.getPyQt5ModulesDirectory(), "plugins") + libPath = os.path.join(Globals.getPyQt6ModulesDirectory(), "plugins") if os.path.exists(libPath): libPath = QDir.fromNativeSeparators(libPath) libraryPaths = QApplication.libraryPaths()
--- a/eric7/Utilities/__init__.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/Utilities/__init__.py Sat Jul 10 12:31:31 2021 +0200 @@ -53,7 +53,7 @@ from Globals import ( # __IGNORE_WARNING__ isWindowsPlatform, isLinuxPlatform, isMacPlatform, desktopName, getConfigDir, setConfigDir, getPythonLibraryDirectory, - getPyQt5ModulesDirectory, getQtBinariesPath, getPyQtToolsPath, + getPyQt6ModulesDirectory, getQtBinariesPath, getPyQtToolsPath, qVersionTuple) from EricWidgets.EricApplication import ericApp
--- a/eric7/eric7.py Sat Jul 10 11:41:13 2021 +0200 +++ b/eric7/eric7.py Sat Jul 10 12:31:31 2021 +0200 @@ -320,7 +320,7 @@ # modify the executable search path for the PyQt5 installer if Globals.isWindowsPlatform(): - pyqtDataDir = Globals.getPyQt5ModulesDirectory() + pyqtDataDir = Globals.getPyQt6ModulesDirectory() if os.path.exists(os.path.join(pyqtDataDir, "bin")): path = os.path.join(pyqtDataDir, "bin") else:
--- a/setup.py Sat Jul 10 11:41:13 2021 +0200 +++ b/setup.py Sat Jul 10 12:31:31 2021 +0200 @@ -331,7 +331,7 @@ "Topic :: Software Development", "Topic :: Text Editors :: Integrated Development Environments (IDE)" ], - keywords="Development PyQt5 IDE Python3", + keywords="Development PyQt6 IDE Python3", python_requires=">=3.6", install_requires=[ "pip>=19.0",