scripts/install.py

branch
eric7-maintenance
changeset 10079
0222a480e93d
parent 10004
983477114d3c
parent 10065
de4ae767b0e3
child 10101
34f74c19ed7a
diff -r 097199aec4bd -r 0222a480e93d scripts/install.py
--- a/scripts/install.py	Tue May 02 10:20:23 2023 +0200
+++ b/scripts/install.py	Sat May 27 19:02:58 2023 +0200
@@ -222,7 +222,7 @@
     else:
         # determine dynamically
         try:
-            from PyQt6.QtCore import QLibraryInfo
+            from PyQt6.QtCore import QLibraryInfo  # noqa: I101, I102
 
             qtDataDir = QLibraryInfo.path(QLibraryInfo.LibraryPath.DataPath)
         except ImportError:
@@ -274,10 +274,10 @@
     """
     if os.path.exists(os.path.join("eric", "src", "eric7", "UI", "Info.py")):
         # Installing from installer archive
-        from eric.src.eric7.UI.Info import Version
+        from eric.src.eric7.UI.Info import Version  # noqa: I101, I102
     elif os.path.exists(os.path.join("src", "eric7", "UI", "Info.py")):
         # Installing from source tree
-        from src.eric7.UI.Info import Version
+        from src.eric7.UI.Info import Version  # noqa: I101, I102
     else:
         Version = "Unknown"
 
@@ -486,7 +486,7 @@
     global platBinDir
 
     try:
-        from eric7.Globals import getConfig
+        from eric7.Globals import getConfig  # noqa: I101
     except ImportError:
         # eric wasn't installed previously
         return
@@ -952,7 +952,7 @@
 
     # Create a Mac application bundle
     elif sys.platform == "darwin":
-        createMacAppBundle(cfg["ericDir"])
+        createMacAppBundle()
 
     return 0
 
@@ -1157,13 +1157,9 @@
             createWindowsShortcut(linkPath, targetPath, iconPath)
 
 
-def createMacAppBundle(pydir):
+def createMacAppBundle():
     """
     Create a Mac application bundle.
-
-    @param pydir the name of the directory where the Python script will
-        eventually be installed
-    @type str
     """
     global cfg, macAppBundleName, macPythonExe, macAppBundlePath
 
@@ -1187,7 +1183,7 @@
     # determine entry for DYLD_FRAMEWORK_PATH
     dyldLine = ""
     try:
-        from PyQt6.QtCore import QLibraryInfo
+        from PyQt6.QtCore import QLibraryInfo  # noqa: I101, I102
 
         qtLibraryDir = QLibraryInfo.path(QLibraryInfo.LibraryPath.LibrariesPath)
     except ImportError:
@@ -1225,10 +1221,10 @@
 
     if os.path.exists(os.path.join("eric", "eric7", "UI", "Info.py")):
         # Installing from archive
-        from eric.eric7.UI.Info import CopyrightShort, Version
+        from eric.eric7.UI.Info import CopyrightShort, Version  # noqa: I101, I102
     elif os.path.exists(os.path.join("eric7", "UI", "Info.py")):
         # Installing from source tree
-        from eric7.UI.Info import CopyrightShort, Version
+        from eric7.UI.Info import CopyrightShort, Version  # noqa: I101
     else:
         Version = "Unknown"
         CopyrightShort = "(c) 2002 - 2023 Detlev Offenbach"
@@ -1595,7 +1591,7 @@
     print("PyQt & Qt")
     print("---------")
     try:
-        from PyQt6.QtCore import qVersion
+        from PyQt6.QtCore import qVersion  # noqa: I101, I102
     except ImportError as err:
         msg = "'PyQt6' could not be detected.{0}".format(
             "\nError: {0}".format(err) if verbose else ""
@@ -1606,7 +1602,7 @@
         if installed:
             # try to import it again
             try:
-                from PyQt6.QtCore import qVersion
+                from PyQt6.QtCore import qVersion  # noqa: I101, I102
             except ImportError as msg:
                 print("Sorry, please install PyQt6.")
                 print("Error: {0}".format(msg))
@@ -1823,9 +1819,9 @@
     # ====================
     with contextlib.suppress(ImportError, AttributeError):
         try:
-            from PyQt6 import sip
+            from PyQt6 import sip  # noqa: I101, I102
         except ImportError:
-            import sip
+            import sip  # noqa: I101, I102
         print("sip:", sip.SIP_VERSION_STR.strip())
         # always assume, that snapshots or dev versions are new enough
         if "snapshot" not in sip.SIP_VERSION_STR and "dev" not in sip.SIP_VERSION_STR:
@@ -1850,7 +1846,7 @@
 
     # check version of PyQt6
     # ======================
-    from PyQt6.QtCore import PYQT_VERSION, PYQT_VERSION_STR
+    from PyQt6.QtCore import PYQT_VERSION, PYQT_VERSION_STR  # noqa: I101, I102
 
     print("PyQt6:", PYQT_VERSION_STR.strip())
     # always assume, that snapshots or dev versions are new enough
@@ -1876,7 +1872,10 @@
 
     # check version of QScintilla
     # ===========================
-    from PyQt6.Qsci import QSCINTILLA_VERSION, QSCINTILLA_VERSION_STR
+    from PyQt6.Qsci import (  # noqa: I101, I102
+        QSCINTILLA_VERSION,
+        QSCINTILLA_VERSION_STR,
+    )
 
     print("PyQt6-QScintilla:", QSCINTILLA_VERSION_STR.strip())
     # always assume, that snapshots or dev versions are new enough
@@ -1904,7 +1903,7 @@
         print("PyQt6-Charts:", QtCharts.PYQT_CHART_VERSION_STR)
 
     with contextlib.suppress(ImportError, AttributeError):
-        from PyQt6 import QtWebEngineCore
+        from PyQt6 import QtWebEngineCore  # noqa: I101, I102
 
         print("PyQt6-WebEngine:", QtWebEngineCore.PYQT_WEBENGINE_VERSION_STR)
 
@@ -1935,7 +1934,7 @@
         (defaults to None)
     @type func (optional)
     """
-    from PyQt6.uic import compileUi
+    from PyQt6.uic import compileUi  # noqa: I102
 
     py_dir, py_file = os.path.split(ui_path[:-3] + ".py")
 
@@ -2052,7 +2051,7 @@
     @rtype any
     """
     try:
-        import winreg  # __IGNORE_WARNING_I103__
+        import winreg  # noqa: I101, I103
     except ImportError:
         return None
 
@@ -2076,8 +2075,8 @@
     @param iconPath path of the icon file
     @type str
     """
-    from pywintypes import com_error
-    from win32com.client import Dispatch
+    from pywintypes import com_error  # noqa: I102
+    from win32com.client import Dispatch  # noqa: I102
 
     with contextlib.suppress(com_error):
         shell = Dispatch("WScript.Shell")
@@ -2419,4 +2418,4 @@
         raise
 
 #
-# eflag: noqa = M801, I101, I102
+# eflag: noqa = M801

eric ide

mercurial