scripts/install.py

branch
eric7
changeset 9690
2dc33116df50
parent 9680
4acdf7c7101d
child 9694
90a7081e2837
--- a/scripts/install.py	Tue Jan 10 13:11:52 2023 +0100
+++ b/scripts/install.py	Wed Jan 11 15:03:59 2023 +0100
@@ -893,13 +893,13 @@
             shutilCopy(os.path.join(sourceDir, "docs", name), cfg["ericDocDir"])
         except OSError:
             print(
-                "Could not install '{0}'.".format(os.path.join(sourceDir, "docs", name))
+                "\nCould not install '{0}'.".format(os.path.join(sourceDir, "docs", name))
             )
     for name in glob.glob(os.path.join(sourceDir, "docs", "README*.*")):
         try:
             shutilCopy(name, cfg["ericDocDir"])
         except OSError:
-            print("Could not install '{0}'.".format(name))
+            print("\nCould not install '{0}'.".format(name))
 
     # copy some more stuff
     for name in ("default.ekj", "default_Mac.ekj", "default.e4k", "default_Mac.e4k"):
@@ -907,7 +907,7 @@
             shutilCopy(os.path.join(sourceDir, "others", name), cfg["ericOthersDir"])
         except OSError:
             print(
-                "Could not install '{0}'.".format(
+                "\nCould not install '{0}'.".format(
                     os.path.join(sourceDir, "others", name)
                 )
             )
@@ -917,7 +917,9 @@
         if os.access(cfg["apidir"], os.W_OK):
             for progLanguage in progLanguages:
                 apidir = os.path.join(cfg["apidir"], progLanguage)
-                print("Installing {0} API files to '{1}'.".format(progLanguage, apidir))
+                print(
+                    "\nInstalling {0} API files to '{1}'.".format(progLanguage, apidir)
+                )
                 if not os.path.exists(apidir):
                     os.makedirs(apidir)
                 for apiName in glob.glob(
@@ -929,7 +931,7 @@
                 ):
                     shutilCopy(apiName, apidir)
         else:
-            print("The API directory '{0}' is not writable.".format(cfg["apidir"]))
+            print("\nThe API directory '{0}' is not writable.".format(cfg["apidir"]))
             print("Use the API files provided by the 'API Files' plug-in.")
 
     # Create menu entry for Linux systems
@@ -1582,6 +1584,8 @@
         print("Please install it and try again.")
         exit(5)
 
+    print("PyQt & Qt")
+    print("---------")
     try:
         from PyQt6.QtCore import qVersion
     except ImportError as err:
@@ -1630,6 +1634,7 @@
                 ),
                 msg,
             )
+    print("Found PyQt6-WebEngine")
 
     try:
         from PyQt6 import QtCharts  # __IGNORE_WARNING__
@@ -1701,6 +1706,7 @@
         "trove-classifiers": ("trove_classifiers", ""),
         "black": ("black", ">=22.6.0"),
         "isort": ("isort", ">=5.10.0"),
+        "coverage": ("coverage", ">=6.5.0"),
     }
     optionalModulesList = {
         # key is pip project name
@@ -1717,7 +1723,7 @@
 
     # check mandatory PyQt6 modules
     modulesOK = True
-    for pyqt6BaseModule in pyqt6BaseModulesList:
+    for pyqt6BaseModule in sorted(pyqt6BaseModulesList):
         name = pyqt6BaseModule.split(".")[1]
         try:
             importlib.import_module(pyqt6BaseModule)
@@ -1731,8 +1737,10 @@
         exit(1)
 
     # check required modules
+    print("\nRequired Packages")
+    print("-----------------")
     requiredMissing = False
-    for requiredPackage in requiredModulesList:
+    for requiredPackage in sorted(requiredModulesList):
         try:
             importlib.import_module(requiredModulesList[requiredPackage][0])
             print("Found", requiredPackage)
@@ -1755,8 +1763,10 @@
         print("    {0} install-dependencies.py --required".format(sys.executable))
 
     # check optional modules
+    print("\nOptional Packages")
+    print("-----------------")
     optionalMissing = False
-    for optPackage in optionalModulesList:
+    for optPackage in sorted(optionalModulesList):
         try:
             importlib.import_module(optionalModulesList[optPackage][0])
             print("Found", optPackage)
@@ -2205,9 +2215,9 @@
 
     # cleanup source if installing from source
     if installFromSource:
-        print("Cleaning up source ...")
+        print("Cleaning up source ...", end="")
         cleanupSource(sourceDir)
-        print()
+        print(" Done")
 
         configName = os.path.join(eric7SourceDir, "eric7config.py")
         if os.path.exists(os.path.join(sourceDir, ".hg")):
@@ -2228,7 +2238,7 @@
         os.remove(configName)
 
     # cleanup old installation
-    print("Cleaning up old installation ...")
+    print("Cleaning up old installation ...", end="")
     try:
         if doCleanup:
             if distDir:
@@ -2236,26 +2246,32 @@
             else:
                 cleanUp()
     except OSError as msg:
-        sys.stderr.write("Error: {0}\nTry install as root.\n".format(msg))
+        sys.stderr.write("\nError: {0}\nTry install as root.\n".format(msg))
         exit(7)
+    print(" Done")
 
     # Create a config file and delete the default one
-    print("\nCreating configuration file ...")
+    print("Creating configuration file ...", end="")
     createConfig()
+    print(" Done")
 
+    # Create an install info file
+    print("Creating an install info file ...", end="")
     createInstallInfo()
+    print(" Done")
 
     # Compile .ui files
-    print("\nCompiling user interface files ...")
+    print("Compiling user interface files ...", end="")
     # step 1: remove old Ui_*.py files
     for root, _, files in os.walk(sourceDir):
         for file in [f for f in files if fnmatch.fnmatch(f, "Ui_*.py")]:
             os.remove(os.path.join(root, file))
     # step 2: compile the forms
     compileUiFiles()
+    print(" Done")
 
     if doCompile:
-        print("\nCompiling source files ...")
+        print("Compiling source files ...", end="")
         skipRe = re.compile(r"DebugClients[\\/]Python[\\/]")
         sys.stdout = io.StringIO()
         if distDir:
@@ -2277,8 +2293,11 @@
             )
             py_compile.compile(configName, dfile=os.path.join(modDir, "eric7config.py"))
         sys.stdout = sys.__stdout__
-    print("\nInstalling eric ...")
+        print(" Done")
+
+    print("Installing eric ...", end="")
     res = installEric()
+    print(" Done")
 
     if createInstallInfoFile:
         with open(

eric ide

mercurial