install.py

changeset 3937
607dd5b0079b
parent 3936
93fb2fd523f1
child 3939
fc1ea4bbb201
equal deleted inserted replaced
3936:93fb2fd523f1 3937:607dd5b0079b
47 macAppBundleName = "eric6.app" 47 macAppBundleName = "eric6.app"
48 macAppBundlePath = "/Applications" 48 macAppBundlePath = "/Applications"
49 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format( 49 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format(
50 sys.exec_prefix) 50 sys.exec_prefix)
51 pyqtVariant = "" 51 pyqtVariant = ""
52 pyqtOverride = False
52 53
53 # Define blacklisted versions of the prerequisites 54 # Define blacklisted versions of the prerequisites
54 BlackLists = { 55 BlackLists = {
55 "sip": ["4.11", "4.12.3"], 56 "sip": ["4.11", "4.12.3"],
56 "PyQt4": [], 57 "PyQt4": [],
178 179
179 def determinePyQtVariant(): 180 def determinePyQtVariant():
180 """ 181 """
181 Module function to determine the PyQt variant to be used. 182 Module function to determine the PyQt variant to be used.
182 """ 183 """
183 global pyqtVariant 184 global pyqtVariant, pyqtOverride
184 185
185 pyqtVariant = "" 186 pyqtVariant = ""
186 # need to handle the --pyqt= option here 187 # need to handle the --pyqt= option here
187 if "--pyqt=4" in sys.argv: 188 if "--pyqt=4" in sys.argv:
188 pyqtVariant = "PyQt4" 189 pyqtVariant = "PyQt4"
190 pyqtOverride = True
189 elif "--pyqt=5" in sys.argv: 191 elif "--pyqt=5" in sys.argv:
190 pyqtVariant = "PyQt5" 192 pyqtVariant = "PyQt5"
193 pyqtOverride = True
191 else: 194 else:
192 try: 195 try:
193 import PyQt5 # __IGNORE_WARNING__ 196 import PyQt5 # __IGNORE_WARNING__
194 pyqtVariant = "PyQt5" 197 pyqtVariant = "PyQt5"
195 del sys.modules["PyQt5"] 198 del sys.modules["PyQt5"]
297 @param wfile the basename of the wrapper (string) 300 @param wfile the basename of the wrapper (string)
298 @param isGuiScript flag indicating a wrapper script for a GUI 301 @param isGuiScript flag indicating a wrapper script for a GUI
299 application (boolean) 302 application (boolean)
300 @return the platform specific name of the wrapper (string) 303 @return the platform specific name of the wrapper (string)
301 """ 304 """
302 global includePythonVariant, pyqtVariant 305 global includePythonVariant, pyqtVariant, pyqtOverride
303 306
304 if includePythonVariant: 307 if includePythonVariant:
305 marker = PythonMarkers[sys.version_info.major] 308 marker = PythonMarkers[sys.version_info.major]
306 else: 309 else:
307 marker = "" 310 marker = ""
308 311
309 if pyqtVariant == "PyQt4": 312 if pyqtOverride and pyqtVariant == "PyQt4":
310 pyqt4opt = " --pyqt4" 313 pyqt4opt = " --pyqt4"
311 else: 314 else:
312 pyqt4opt = "" 315 pyqt4opt = ""
313 316
314 # all kinds of Windows systems 317 # all kinds of Windows systems
1289 1292
1290 # Parse the command line. 1293 # Parse the command line.
1291 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir 1294 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir
1292 global sourceDir, configName, includePythonVariant 1295 global sourceDir, configName, includePythonVariant
1293 global macAppBundlePath, macAppBundleName, macPythonExe 1296 global macAppBundlePath, macAppBundleName, macPythonExe
1294 global pyqtVariant 1297 global pyqtVariant, pyqtOverride
1295 1298
1296 if sys.version_info < (2, 7, 0) or sys.version_info > (3, 9, 9): 1299 if sys.version_info < (2, 7, 0) or sys.version_info > (3, 9, 9):
1297 print('Sorry, eric6 requires at least Python 2.7 or ' 1300 print('Sorry, eric6 requires at least Python 2.7 or '
1298 'Python 3 for running.') 1301 'Python 3 for running.')
1299 exit(5) 1302 exit(5)
1361 elif opt == "--pyqt": 1364 elif opt == "--pyqt":
1362 if arg not in ["4", "5"]: 1365 if arg not in ["4", "5"]:
1363 print("Invalid PyQt version given; should be 4 or 5. Aborting") 1366 print("Invalid PyQt version given; should be 4 or 5. Aborting")
1364 exit(6) 1367 exit(6)
1365 pyqtVariant = "PyQt{0}".format(arg) 1368 pyqtVariant = "PyQt{0}".format(arg)
1369 pyqtOverride = True
1366 1370
1367 installFromSource = not os.path.isdir(sourceDir) 1371 installFromSource = not os.path.isdir(sourceDir)
1368 if installFromSource: 1372 if installFromSource:
1369 sourceDir = os.path.dirname(__file__) or "." 1373 sourceDir = os.path.dirname(__file__) or "."
1370 configName = os.path.join(sourceDir, "eric6config.py") 1374 configName = os.path.join(sourceDir, "eric6config.py")

eric ide

mercurial