scripts/install.py

branch
eric7-maintenance
changeset 11019
27cd57e98461
parent 10892
409d010d7cae
parent 10998
6d7bddfde5fe
child 11063
bb05d1db9286
diff -r c8df46dd566d -r 27cd57e98461 scripts/install.py
--- a/scripts/install.py	Thu Oct 03 17:06:51 2024 +0200
+++ b/scripts/install.py	Thu Oct 31 10:54:33 2024 +0100
@@ -69,6 +69,9 @@
 installInfo = {}
 installCwd = ""
 
+# Windows specific stuff
+pywin32_installed = False
+
 # Define blocklisted versions of the prerequisites
 BlockLists = {
     "sip": [],
@@ -1119,25 +1122,14 @@
     """
     Create Desktop and Start Menu links.
     """
-    if importlib.util.find_spec("win32com") is None:
-        installed = pipInstall(
-            "pywin32",
-            "\nThe Python package 'pywin32' could not be imported.",
-            force=False,
-        )
-        if installed:
-            # create the links via an external script to get around some
-            # startup magic done by pywin32.pth
-            args = [
-                sys.executable,
-                os.path.join(os.path.dirname(__file__), "create_windows_links.py"),
-            ]
-            subprocess.run(args)  # secok
-        else:
-            print(
-                "\nThe Python package 'pywin32' is not installed. Desktop and"
-                " Start Menu entries will not be created."
-            )
+    if pywin32_installed:
+        # create the links via an external script to get around some
+        # startup magic done by pywin32.pth
+        args = [
+            sys.executable,
+            os.path.join(os.path.dirname(__file__), "create_windows_links.py"),
+        ]
+        subprocess.run(args)  # secok
         return
 
     regPath = (
@@ -1190,7 +1182,7 @@
         starter = os.path.join(directories["exe"], "eric")
         os.symlink(macPythonExe, starter)
     else:
-        starter = "python{0}".format(sys.version_info.major)
+        starter = "python{0}.{1}".format(sys.version_info.major, sys.version_info.minor)
 
     wname = os.path.join(directories["exe"], "eric7_ide")
 
@@ -1587,7 +1579,7 @@
     """
     Perform some dependency checks.
     """
-    global verbose
+    global pywin32_installed, verbose
 
     requiredVersions = {
         "pyqt6": 0x60200,  # v6.2.0
@@ -1611,8 +1603,8 @@
         print("\n")
 
     # perform dependency checks
-    if sys.version_info < (3, 8, 0) or sys.version_info >= (3, 13, 0):
-        print("Sorry, you must have Python 3.8.0 or higher, but less 3.13.0.")
+    if sys.version_info < (3, 8, 0) or sys.version_info >= (3, 14, 0):
+        print("Sorry, you must have Python 3.8.0 or higher, but less 3.14.0.")
         print("Yours is {0}.".format(".".join(str(v) for v in sys.version_info[:3])))
         exit(5)
 
@@ -1726,6 +1718,7 @@
         "pipdeptree": ("pipdeptree", ""),
         "watchdog": ("watchdog", ">=3.0.0"),
         "psutil": ("psutil", ""),
+        "requests": ("requests", ""),
     }
     optionalModulesList = {
         # key is pip project name
@@ -1808,7 +1801,9 @@
                 msg = "Optional '{0}' could not be detected.{1}".format(
                     optPackage, "\nError: {0}".format(err) if verbose else ""
                 )
-                pipInstall(optPackage + optModulesDict[optPackage][1], msg)
+                ok = pipInstall(optPackage + optModulesDict[optPackage][1], msg)
+                if optPackage == "pywin32" and ok:
+                    pywin32_installed = True
     if optionalMissing:
         print("Some optional packages are missing and could not be installed.")
         print("Install them manually with:")

eric ide

mercurial