scripts/install.py

branch
eric7-maintenance
changeset 11019
27cd57e98461
parent 10892
409d010d7cae
parent 10998
6d7bddfde5fe
child 11063
bb05d1db9286
equal deleted inserted replaced
10947:c8df46dd566d 11019:27cd57e98461
66 66
67 createInstallInfoFile = True 67 createInstallInfoFile = True
68 installInfoName = "eric7install.json" 68 installInfoName = "eric7install.json"
69 installInfo = {} 69 installInfo = {}
70 installCwd = "" 70 installCwd = ""
71
72 # Windows specific stuff
73 pywin32_installed = False
71 74
72 # Define blocklisted versions of the prerequisites 75 # Define blocklisted versions of the prerequisites
73 BlockLists = { 76 BlockLists = {
74 "sip": [], 77 "sip": [],
75 "PyQt6": [], 78 "PyQt6": [],
1117 1120
1118 def createWindowsLinks(): 1121 def createWindowsLinks():
1119 """ 1122 """
1120 Create Desktop and Start Menu links. 1123 Create Desktop and Start Menu links.
1121 """ 1124 """
1122 if importlib.util.find_spec("win32com") is None: 1125 if pywin32_installed:
1123 installed = pipInstall( 1126 # create the links via an external script to get around some
1124 "pywin32", 1127 # startup magic done by pywin32.pth
1125 "\nThe Python package 'pywin32' could not be imported.", 1128 args = [
1126 force=False, 1129 sys.executable,
1127 ) 1130 os.path.join(os.path.dirname(__file__), "create_windows_links.py"),
1128 if installed: 1131 ]
1129 # create the links via an external script to get around some 1132 subprocess.run(args) # secok
1130 # startup magic done by pywin32.pth
1131 args = [
1132 sys.executable,
1133 os.path.join(os.path.dirname(__file__), "create_windows_links.py"),
1134 ]
1135 subprocess.run(args) # secok
1136 else:
1137 print(
1138 "\nThe Python package 'pywin32' is not installed. Desktop and"
1139 " Start Menu entries will not be created."
1140 )
1141 return 1133 return
1142 1134
1143 regPath = ( 1135 regPath = (
1144 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" 1136 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"
1145 ) 1137 )
1188 1180
1189 if macPythonExe == defaultMacPythonExe and macPythonExe: 1181 if macPythonExe == defaultMacPythonExe and macPythonExe:
1190 starter = os.path.join(directories["exe"], "eric") 1182 starter = os.path.join(directories["exe"], "eric")
1191 os.symlink(macPythonExe, starter) 1183 os.symlink(macPythonExe, starter)
1192 else: 1184 else:
1193 starter = "python{0}".format(sys.version_info.major) 1185 starter = "python{0}.{1}".format(sys.version_info.major, sys.version_info.minor)
1194 1186
1195 wname = os.path.join(directories["exe"], "eric7_ide") 1187 wname = os.path.join(directories["exe"], "eric7_ide")
1196 1188
1197 # determine entry for DYLD_FRAMEWORK_PATH 1189 # determine entry for DYLD_FRAMEWORK_PATH
1198 dyldLine = "" 1190 dyldLine = ""
1585 1577
1586 def doDependancyChecks(): 1578 def doDependancyChecks():
1587 """ 1579 """
1588 Perform some dependency checks. 1580 Perform some dependency checks.
1589 """ 1581 """
1590 global verbose 1582 global pywin32_installed, verbose
1591 1583
1592 requiredVersions = { 1584 requiredVersions = {
1593 "pyqt6": 0x60200, # v6.2.0 1585 "pyqt6": 0x60200, # v6.2.0
1594 "pyqt6-charts": 0x60200, # v6.2.0 1586 "pyqt6-charts": 0x60200, # v6.2.0
1595 "pyqt6-webengine": 0x60200, # v6.2.0 1587 "pyqt6-webengine": 0x60200, # v6.2.0
1609 if not isSudo and isPipOutdated(): 1601 if not isSudo and isPipOutdated():
1610 updatePip() 1602 updatePip()
1611 print("\n") 1603 print("\n")
1612 1604
1613 # perform dependency checks 1605 # perform dependency checks
1614 if sys.version_info < (3, 8, 0) or sys.version_info >= (3, 13, 0): 1606 if sys.version_info < (3, 8, 0) or sys.version_info >= (3, 14, 0):
1615 print("Sorry, you must have Python 3.8.0 or higher, but less 3.13.0.") 1607 print("Sorry, you must have Python 3.8.0 or higher, but less 3.14.0.")
1616 print("Yours is {0}.".format(".".join(str(v) for v in sys.version_info[:3]))) 1608 print("Yours is {0}.".format(".".join(str(v) for v in sys.version_info[:3])))
1617 exit(5) 1609 exit(5)
1618 1610
1619 if ( 1611 if (
1620 importlib.util.find_spec("xml") is None 1612 importlib.util.find_spec("xml") is None
1724 "coverage": ("coverage", ">=6.5.0"), 1716 "coverage": ("coverage", ">=6.5.0"),
1725 "semver": ("semver", ""), 1717 "semver": ("semver", ""),
1726 "pipdeptree": ("pipdeptree", ""), 1718 "pipdeptree": ("pipdeptree", ""),
1727 "watchdog": ("watchdog", ">=3.0.0"), 1719 "watchdog": ("watchdog", ">=3.0.0"),
1728 "psutil": ("psutil", ""), 1720 "psutil": ("psutil", ""),
1721 "requests": ("requests", ""),
1729 } 1722 }
1730 optionalModulesList = { 1723 optionalModulesList = {
1731 # key is pip project name 1724 # key is pip project name
1732 # value is tuple of package name, pip install constraint 1725 # value is tuple of package name, pip install constraint
1733 "docutils": ("docutils", ""), 1726 "docutils": ("docutils", ""),
1806 optionalMissing = True 1799 optionalMissing = True
1807 else: 1800 else:
1808 msg = "Optional '{0}' could not be detected.{1}".format( 1801 msg = "Optional '{0}' could not be detected.{1}".format(
1809 optPackage, "\nError: {0}".format(err) if verbose else "" 1802 optPackage, "\nError: {0}".format(err) if verbose else ""
1810 ) 1803 )
1811 pipInstall(optPackage + optModulesDict[optPackage][1], msg) 1804 ok = pipInstall(optPackage + optModulesDict[optPackage][1], msg)
1805 if optPackage == "pywin32" and ok:
1806 pywin32_installed = True
1812 if optionalMissing: 1807 if optionalMissing:
1813 print("Some optional packages are missing and could not be installed.") 1808 print("Some optional packages are missing and could not be installed.")
1814 print("Install them manually with:") 1809 print("Install them manually with:")
1815 print(" {0} install-dependencies.py --optional".format(sys.executable)) 1810 print(" {0} install-dependencies.py --optional".format(sys.executable))
1816 1811

eric ide

mercurial