install.py

changeset 3670
f0cb7579c0b4
parent 3657
ae833e7fcd6c
child 3678
2866383fd342
equal deleted inserted replaced
3669:ac84ac3c0f05 3670:f0cb7579c0b4
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 3
4 # Copyright (c) 2002-2014 Detlev Offenbach <detlev@die-offenbachs.de> 4 # Copyright (c) 2002-2014 Detlev Offenbach <detlev@die-offenbachs.de>
5 # 5 #
6 # This is the install script for eric5. 6 # This is the install script for eric6.
7 7
8 """ 8 """
9 Installation script for the eric5 IDE and all eric5 related tools. 9 Installation script for the eric6 IDE and all eric6 related tools.
10 """ 10 """
11 11
12 from __future__ import unicode_literals 12 from __future__ import unicode_literals
13 from __future__ import print_function 13 from __future__ import print_function
14 try: 14 try:
39 doCompile = True 39 doCompile = True
40 includePythonVariant = False 40 includePythonVariant = False
41 cfg = {} 41 cfg = {}
42 progLanguages = ["Python", "Ruby", "QSS"] 42 progLanguages = ["Python", "Ruby", "QSS"]
43 sourceDir = "eric" 43 sourceDir = "eric"
44 configName = 'eric5config.py' 44 configName = 'eric6config.py'
45 defaultMacAppBundleName = "eric5.app" 45 defaultMacAppBundleName = "eric6.app"
46 macAppBundleName = "eric5.app" 46 macAppBundleName = "eric6.app"
47 macAppBundlePath = "/Applications" 47 macAppBundlePath = "/Applications"
48 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format( 48 macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format(
49 sys.exec_prefix) 49 sys.exec_prefix)
50 50
51 # Define blacklisted versions of the prerequisites 51 # Define blacklisted versions of the prerequisites
128 print(" (default: {0})".format(apisDir)) 128 print(" (default: {0})".format(apisDir))
129 else: 129 else:
130 print(" (no default value)") 130 print(" (no default value)")
131 print(" -b dir where the binaries will be installed") 131 print(" -b dir where the binaries will be installed")
132 print(" (default: {0})".format(platBinDir)) 132 print(" (default: {0})".format(platBinDir))
133 print(" -d dir where eric5 python files will be installed") 133 print(" -d dir where eric6 python files will be installed")
134 print(" (default: {0})".format(modDir)) 134 print(" (default: {0})".format(modDir))
135 print(" -f file configuration file naming the various installation" 135 print(" -f file configuration file naming the various installation"
136 " paths") 136 " paths")
137 if not sys.platform.startswith("win"): 137 if not sys.platform.startswith("win"):
138 print(" -i dir temporary install prefix") 138 print(" -i dir temporary install prefix")
158 print("'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericDocDir'," 158 print("'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericDocDir',"
159 " 'ericExamplesDir',") 159 " 'ericExamplesDir',")
160 print("'ericTranslationsDir', 'ericTemplatesDir', 'ericCodeTemplatesDir',") 160 print("'ericTranslationsDir', 'ericTemplatesDir', 'ericCodeTemplatesDir',")
161 print("'ericOthersDir','bindir', 'mdir' and 'apidir.") 161 print("'ericOthersDir','bindir', 'mdir' and 'apidir.")
162 print("These define the directories for the installation of the various" 162 print("These define the directories for the installation of the various"
163 " parts of eric5.") 163 " parts of eric6.")
164 164
165 exit(rcode) 165 exit(rcode)
166 166
167 167
168 def initGlobals(): 168 def initGlobals():
332 """ 332 """
333 Create the global plugins directory, if it doesn't exist. 333 Create the global plugins directory, if it doesn't exist.
334 """ 334 """
335 global cfg, distDir 335 global cfg, distDir
336 336
337 pdir = os.path.join(cfg['mdir'], "eric5plugins") 337 pdir = os.path.join(cfg['mdir'], "eric6plugins")
338 fname = os.path.join(pdir, "__init__.py") 338 fname = os.path.join(pdir, "__init__.py")
339 if not os.path.exists(fname): 339 if not os.path.exists(fname):
340 if not os.path.exists(pdir): 340 if not os.path.exists(pdir):
341 os.mkdir(pdir, 0o755) 341 os.mkdir(pdir, 0o755)
342 f = open(fname, "w") 342 f = open(fname, "w")
390 Uninstall the old eric files. 390 Uninstall the old eric files.
391 """ 391 """
392 global macAppBundleName, macAppBundlePath, platBinDir, includePythonVariant 392 global macAppBundleName, macAppBundlePath, platBinDir, includePythonVariant
393 393
394 try: 394 try:
395 from eric5config import getConfig 395 from eric6config import getConfig
396 except ImportError: 396 except ImportError:
397 # eric5 wasn't installed previously 397 # eric6 wasn't installed previously
398 return 398 return
399 399
400 global pyModDir, progLanguages 400 global pyModDir, progLanguages
401 401
402 # Remove the menu entry for Linux systems 402 # Remove the menu entry for Linux systems
403 if sys.platform.startswith("linux"): 403 if sys.platform.startswith("linux"):
404 for name in ["/usr/share/pixmaps/eric.png", 404 for name in ["/usr/share/pixmaps/eric.png",
405 "/usr/share/applications/eric5.desktop", 405 "/usr/share/applications/eric6.desktop",
406 "/usr/share/appdata/eric5.appdata.xml", 406 "/usr/share/appdata/eric6.appdata.xml",
407 "/usr/share/pixmaps/ericWeb.png", 407 "/usr/share/pixmaps/ericWeb.png",
408 "/usr/share/applications/eric5_webbrowser.desktop"]: 408 "/usr/share/applications/eric6_webbrowser.desktop"]:
409 if os.path.exists(name): 409 if os.path.exists(name):
410 os.remove(name) 410 os.remove(name)
411 411
412 # Remove the wrapper scripts 412 # Remove the wrapper scripts
413 rem_wnames = [ 413 rem_wnames = [
414 "eric5-api", "eric5-compare", 414 "eric6-api", "eric6-compare",
415 "eric5-configure", "eric5-diff", 415 "eric6-configure", "eric6-diff",
416 "eric5-doc", 416 "eric6-doc",
417 "eric5-qregexp", "eric5-re", 417 "eric6-qregexp", "eric6-re",
418 "eric5-trpreviewer", "eric5-uipreviewer", 418 "eric6-trpreviewer", "eric6-uipreviewer",
419 "eric5-unittest", "eric5", 419 "eric6-unittest", "eric6",
420 "eric5-tray", "eric5-editor", 420 "eric6-tray", "eric6-editor",
421 "eric5-plugininstall", "eric5-pluginuninstall", 421 "eric6-plugininstall", "eric6-pluginuninstall",
422 "eric5-pluginrepository", "eric5-sqlbrowser", 422 "eric6-pluginrepository", "eric6-sqlbrowser",
423 "eric5-webbrowser", "eric5-iconeditor", 423 "eric6-webbrowser", "eric6-iconeditor",
424 ] 424 ]
425 rem_wnames2 = [ 425 rem_wnames2 = [
426 "eric5_api", "eric5_compare", 426 "eric6_api", "eric6_compare",
427 "eric5_configure", "eric5_diff", 427 "eric6_configure", "eric6_diff",
428 "eric5_doc", "eric5_qregularexpression", 428 "eric6_doc", "eric6_qregularexpression",
429 "eric5_qregexp", "eric5_re", 429 "eric6_qregexp", "eric6_re",
430 "eric5_trpreviewer", "eric5_uipreviewer", 430 "eric6_trpreviewer", "eric6_uipreviewer",
431 "eric5_unittest", "eric5", 431 "eric6_unittest", "eric6",
432 "eric5_tray", "eric5_editor", 432 "eric6_tray", "eric6_editor",
433 "eric5_plugininstall", "eric5_pluginuninstall", 433 "eric6_plugininstall", "eric6_pluginuninstall",
434 "eric5_pluginrepository", "eric5_sqlbrowser", 434 "eric6_pluginrepository", "eric6_sqlbrowser",
435 "eric5_webbrowser", "eric5_iconeditor", 435 "eric6_webbrowser", "eric6_iconeditor",
436 "eric5_snap", 436 "eric6_snap",
437 ] 437 ]
438 if includePythonVariant: 438 if includePythonVariant:
439 marker = PythonMarkers[sys.version_info.major] 439 marker = PythonMarkers[sys.version_info.major]
440 rem_wnames.extend([n + marker for n in rem_wnames2]) 440 rem_wnames.extend([n + marker for n in rem_wnames2])
441 else: 441 else:
447 rwname = wrapperName(d, rem_wname) 447 rwname = wrapperName(d, rem_wname)
448 if os.path.exists(rwname): 448 if os.path.exists(rwname):
449 os.remove(rwname) 449 os.remove(rwname)
450 450
451 # Cleanup our config file(s) 451 # Cleanup our config file(s)
452 for name in ['eric5config.py', 'eric5config.pyc', 'eric5.pth']: 452 for name in ['eric6config.py', 'eric6config.pyc', 'eric6.pth']:
453 e5cfile = os.path.join(pyModDir, name) 453 e5cfile = os.path.join(pyModDir, name)
454 if os.path.exists(e5cfile): 454 if os.path.exists(e5cfile):
455 os.remove(e5cfile) 455 os.remove(e5cfile)
456 e5cfile = os.path.join(pyModDir, "__pycache__", name) 456 e5cfile = os.path.join(pyModDir, "__pycache__", name)
457 path, ext = os.path.splitext(e5cfile) 457 path, ext = os.path.splitext(e5cfile)
466 if os.path.exists(getConfig(name)): 466 if os.path.exists(getConfig(name)):
467 shutil.rmtree(getConfig(name), True) 467 shutil.rmtree(getConfig(name), True)
468 468
469 # Cleanup translations 469 # Cleanup translations
470 for name in glob.glob( 470 for name in glob.glob(
471 os.path.join(getConfig('ericTranslationsDir'), 'eric5_*.qm')): 471 os.path.join(getConfig('ericTranslationsDir'), 'eric6_*.qm')):
472 if os.path.exists(name): 472 if os.path.exists(name):
473 os.remove(name) 473 os.remove(name)
474 474
475 # Cleanup API files 475 # Cleanup API files
476 try: 476 try:
486 except AttributeError: 486 except AttributeError:
487 pass 487 pass
488 488
489 if sys.platform == "darwin": 489 if sys.platform == "darwin":
490 # delete the Mac app bundle 490 # delete the Mac app bundle
491 if os.path.exists("/Developer/Applications/Eric5"): 491 if os.path.exists("/Developer/Applications/Eric6"):
492 shutil.rmtree("/Developer/Applications/Eric5") 492 shutil.rmtree("/Developer/Applications/Eric6")
493 try: 493 try:
494 macAppBundlePath = getConfig("macAppBundlePath") 494 macAppBundlePath = getConfig("macAppBundlePath")
495 macAppBundleName = getConfig("macAppBundleName") 495 macAppBundleName = getConfig("macAppBundleName")
496 except AttributeError: 496 except AttributeError:
497 macAppBundlePath = "/Applications" 497 macAppBundlePath = "/Applications"
498 macAppBundleName = "eric5.app" 498 macAppBundleName = "eric6.app"
499 if os.path.exists("/Applications/" + macAppBundleName): 499 if os.path.exists("/Applications/" + macAppBundleName):
500 shutil.rmtree("/Applications/" + macAppBundleName) 500 shutil.rmtree("/Applications/" + macAppBundleName)
501 bundlePath = os.path.join(macAppBundlePath, macAppBundleName) 501 bundlePath = os.path.join(macAppBundlePath, macAppBundleName)
502 if os.path.exists(bundlePath): 502 if os.path.exists(bundlePath):
503 shutil.rmtree(bundlePath) 503 shutil.rmtree(bundlePath)
529 """ 529 """
530 global distDir, doCleanup, cfg, progLanguages, sourceDir, configName 530 global distDir, doCleanup, cfg, progLanguages, sourceDir, configName
531 531
532 # Create the platform specific wrappers. 532 # Create the platform specific wrappers.
533 wnames = [] 533 wnames = []
534 for name in ["eric5_api", "eric5_doc"]: 534 for name in ["eric6_api", "eric6_doc"]:
535 wnames.append(createPyWrapper(cfg['ericDir'], name, False)) 535 wnames.append(createPyWrapper(cfg['ericDir'], name, False))
536 for name in ["eric5_compare", "eric5_configure", "eric5_diff", 536 for name in ["eric6_compare", "eric6_configure", "eric6_diff",
537 "eric5_editor", "eric5_iconeditor", "eric5_plugininstall", 537 "eric6_editor", "eric6_iconeditor", "eric6_plugininstall",
538 "eric5_pluginrepository", "eric5_pluginuninstall", 538 "eric6_pluginrepository", "eric6_pluginuninstall",
539 "eric5_qregexp", "eric5_qregularexpression", "eric5_re", 539 "eric6_qregexp", "eric6_qregularexpression", "eric6_re",
540 "eric5_snap", "eric5_sqlbrowser", "eric5_tray", 540 "eric6_snap", "eric6_sqlbrowser", "eric6_tray",
541 "eric5_trpreviewer", "eric5_uipreviewer", "eric5_unittest", 541 "eric6_trpreviewer", "eric6_uipreviewer", "eric6_unittest",
542 "eric5_webbrowser", "eric5"]: 542 "eric6_webbrowser", "eric6"]:
543 wnames.append(createPyWrapper(cfg['ericDir'], name)) 543 wnames.append(createPyWrapper(cfg['ericDir'], name))
544 544
545 # set install prefix, if not None 545 # set install prefix, if not None
546 if distDir: 546 if distDir:
547 for key in list(cfg.keys()): 547 for key in list(cfg.keys()):
552 # make the install directories 552 # make the install directories
553 for key in list(cfg.keys()): 553 for key in list(cfg.keys()):
554 if not os.path.isdir(cfg[key]): 554 if not os.path.isdir(cfg[key]):
555 os.makedirs(cfg[key]) 555 os.makedirs(cfg[key])
556 556
557 # copy the eric5 config file 557 # copy the eric6 config file
558 if distDir: 558 if distDir:
559 shutilCopy(configName, cfg['mdir']) 559 shutilCopy(configName, cfg['mdir'])
560 if os.path.exists(configName + 'c'): 560 if os.path.exists(configName + 'c'):
561 shutilCopy(configName + 'c', cfg['mdir']) 561 shutilCopy(configName + 'c', cfg['mdir'])
562 else: 562 else:
563 shutilCopy(configName, modDir) 563 shutilCopy(configName, modDir)
564 if os.path.exists(configName + 'c'): 564 if os.path.exists(configName + 'c'):
565 shutilCopy(configName + 'c', modDir) 565 shutilCopy(configName + 'c', modDir)
566 566
567 # copy the various parts of eric5 567 # copy the various parts of eric6
568 copyTree( 568 copyTree(
569 sourceDir, cfg['ericDir'], 569 sourceDir, cfg['ericDir'],
570 ['*.py', '*.pyc', '*.pyo', '*.pyw'], 570 ['*.py', '*.pyc', '*.pyo', '*.pyw'],
571 ['{1}{0}Examples'.format(os.sep, sourceDir)], 571 ['{1}{0}Examples'.format(os.sep, sourceDir)],
572 excludePatterns=["eric5config.py*"]) 572 excludePatterns=["eric6config.py*"])
573 copyTree( 573 copyTree(
574 sourceDir, cfg['ericDir'], ['*.rb'], 574 sourceDir, cfg['ericDir'], ['*.rb'],
575 ['{1}{0}Examples'.format(os.sep, sourceDir)]) 575 ['{1}{0}Examples'.format(os.sep, sourceDir)])
576 copyTree( 576 copyTree(
577 '{1}{0}Plugins'.format(os.sep, sourceDir), 577 '{1}{0}Plugins'.format(os.sep, sourceDir),
697 os.path.join(dst, "ericWeb.png")) 697 os.path.join(dst, "ericWeb.png"))
698 dst = os.path.normpath( 698 dst = os.path.normpath(
699 os.path.join(distDir, "usr/share/applications")) 699 os.path.join(distDir, "usr/share/applications"))
700 if not os.path.exists(dst): 700 if not os.path.exists(dst):
701 os.makedirs(dst) 701 os.makedirs(dst)
702 shutilCopy(os.path.join(sourceDir, "eric5.desktop"), dst) 702 shutilCopy(os.path.join(sourceDir, "eric6.desktop"), dst)
703 shutilCopy(os.path.join(sourceDir, "eric5_webbrowser.desktop"), 703 shutilCopy(os.path.join(sourceDir, "eric6_webbrowser.desktop"),
704 dst) 704 dst)
705 dst = os.path.normpath( 705 dst = os.path.normpath(
706 os.path.join(distDir, "usr/share/appdata")) 706 os.path.join(distDir, "usr/share/appdata"))
707 if not os.path.exists(dst): 707 if not os.path.exists(dst):
708 os.makedirs(dst) 708 os.makedirs(dst)
709 shutilCopy(os.path.join(sourceDir, "eric5.appdata.xml"), dst) 709 shutilCopy(os.path.join(sourceDir, "eric6.appdata.xml"), dst)
710 else: 710 else:
711 shutilCopy(os.path.join( 711 shutilCopy(os.path.join(
712 sourceDir, "icons", "default", "eric.png"), 712 sourceDir, "icons", "default", "eric.png"),
713 "/usr/share/pixmaps/eric.png") 713 "/usr/share/pixmaps/eric.png")
714 shutilCopy(os.path.join( 714 shutilCopy(os.path.join(
715 sourceDir, "eric5.desktop"), 715 sourceDir, "eric6.desktop"),
716 "/usr/share/applications") 716 "/usr/share/applications")
717 if os.path.exists("/usr/share/appdata"): 717 if os.path.exists("/usr/share/appdata"):
718 shutilCopy(os.path.join( 718 shutilCopy(os.path.join(
719 sourceDir, "eric5.appdata.xml"), 719 sourceDir, "eric6.appdata.xml"),
720 "/usr/share/appdata") 720 "/usr/share/appdata")
721 shutilCopy(os.path.join( 721 shutilCopy(os.path.join(
722 sourceDir, "icons", "default", "ericWeb48.png"), 722 sourceDir, "icons", "default", "ericWeb48.png"),
723 "/usr/share/pixmaps/ericWeb.png") 723 "/usr/share/pixmaps/ericWeb.png")
724 shutilCopy(os.path.join( 724 shutilCopy(os.path.join(
725 sourceDir, "eric5_webbrowser.desktop"), 725 sourceDir, "eric6_webbrowser.desktop"),
726 "/usr/share/applications") 726 "/usr/share/applications")
727 727
728 # Create a Mac application bundle 728 # Create a Mac application bundle
729 if sys.platform == "darwin": 729 if sys.platform == "darwin":
730 createMacAppBundle(cfg['ericDir']) 730 createMacAppBundle(cfg['ericDir'])
757 starter = os.path.join(dirs["exe"], "eric") 757 starter = os.path.join(dirs["exe"], "eric")
758 os.symlink(macPythonExe, starter) 758 os.symlink(macPythonExe, starter)
759 else: 759 else:
760 starter = "python{0}".format(sys.version_info.major) 760 starter = "python{0}".format(sys.version_info.major)
761 761
762 wname = os.path.join(dirs["exe"], "eric5") 762 wname = os.path.join(dirs["exe"], "eric6")
763 path = os.getenv("PATH", "") 763 path = os.getenv("PATH", "")
764 if path: 764 if path:
765 pybin = os.path.join(sys.exec_prefix, "bin") 765 pybin = os.path.join(sys.exec_prefix, "bin")
766 pathlist = path.split(os.pathsep) 766 pathlist = path.split(os.pathsep)
767 if pybin not in pathlist: 767 if pybin not in pathlist:
769 path = os.pathsep.join(pathlist) 769 path = os.pathsep.join(pathlist)
770 wrapper = ('''#!/bin/sh\n''' 770 wrapper = ('''#!/bin/sh\n'''
771 '''\n''' 771 '''\n'''
772 '''PATH={0}\n''' 772 '''PATH={0}\n'''
773 '''exec "{1}" "{2}/{3}.py" "$@"\n''' 773 '''exec "{1}" "{2}/{3}.py" "$@"\n'''
774 .format(path, starter, pydir, "eric5")) 774 .format(path, starter, pydir, "eric6"))
775 else: 775 else:
776 wrapper = ('''#!/bin/sh\n''' 776 wrapper = ('''#!/bin/sh\n'''
777 '''\n''' 777 '''\n'''
778 '''exec "{0}" "{1}/{2}.py" "$@"\n''' 778 '''exec "{0}" "{1}/{2}.py" "$@"\n'''
779 .format(starter, pydir, "eric5")) 779 .format(starter, pydir, "eric6"))
780 copyToFile(wname, wrapper) 780 copyToFile(wname, wrapper)
781 os.chmod(wname, 0o755) 781 os.chmod(wname, 0o755)
782 782
783 shutilCopy(os.path.join(sourceDir, "pixmaps", "eric_2.icns"), 783 shutilCopy(os.path.join(sourceDir, "pixmaps", "eric_2.icns"),
784 os.path.join(dirs["icns"], "eric.icns")) 784 os.path.join(dirs["icns"], "eric.icns"))
789 '''<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"\n''' 789 '''<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"\n'''
790 ''' "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n''' 790 ''' "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n'''
791 '''<plist version="1.0">\n''' 791 '''<plist version="1.0">\n'''
792 '''<dict>\n''' 792 '''<dict>\n'''
793 ''' <key>CFBundleExecutable</key>\n''' 793 ''' <key>CFBundleExecutable</key>\n'''
794 ''' <string>eric5</string>\n''' 794 ''' <string>eric6</string>\n'''
795 ''' <key>CFBundleIconFile</key>\n''' 795 ''' <key>CFBundleIconFile</key>\n'''
796 ''' <string>eric.icns</string>\n''' 796 ''' <string>eric.icns</string>\n'''
797 ''' <key>CFBundleInfoDictionaryVersion</key>\n''' 797 ''' <key>CFBundleInfoDictionaryVersion</key>\n'''
798 ''' <string>1.0</string>\n''' 798 ''' <string>1.0</string>\n'''
799 ''' <key>CFBundleName</key>\n''' 799 ''' <key>CFBundleName</key>\n'''
814 """ 814 """
815 Create the installation config dictionary. 815 Create the installation config dictionary.
816 """ 816 """
817 global modDir, platBinDir, cfg, apisDir 817 global modDir, platBinDir, cfg, apisDir
818 818
819 ericdir = os.path.join(modDir, "eric5") 819 ericdir = os.path.join(modDir, "eric6")
820 cfg = { 820 cfg = {
821 'ericDir': ericdir, 821 'ericDir': ericdir,
822 'ericPixDir': os.path.join(ericdir, "pixmaps"), 822 'ericPixDir': os.path.join(ericdir, "pixmaps"),
823 'ericIconDir': os.path.join(ericdir, "icons"), 823 'ericIconDir': os.path.join(ericdir, "icons"),
824 'ericDTDDir': os.path.join(ericdir, "DTDs"), 824 'ericDTDDir': os.path.join(ericdir, "DTDs"),
855 # treat Python3 API files the same as Python API files 855 # treat Python3 API files the same as Python API files
856 for apiName in glob.glob( 856 for apiName in glob.glob(
857 os.path.join(sourceDir, "APIs", "Python3", "*.api")): 857 os.path.join(sourceDir, "APIs", "Python3", "*.api")):
858 apis.append(os.path.basename(apiName)) 858 apis.append(os.path.basename(apiName))
859 859
860 fn = 'eric5config.py' 860 fn = 'eric6config.py'
861 config = ( 861 config = (
862 """# -*- coding: utf-8 -*-\n""" 862 """# -*- coding: utf-8 -*-\n"""
863 """#\n""" 863 """#\n"""
864 """# This module contains the configuration of the individual eric5""" 864 """# This module contains the configuration of the individual eric6"""
865 """ installation\n""" 865 """ installation\n"""
866 """#\n""" 866 """#\n"""
867 """\n""" 867 """\n"""
868 """_pkg_config = {{\n""" 868 """_pkg_config = {{\n"""
869 """ 'ericDir': r'{0}',\n""" 869 """ 'ericDir': r'{0}',\n"""
926 exit(5) 926 exit(5)
927 elif sys.version_info < (3, 1, 0) and sys.version_info[0] == 3: 927 elif sys.version_info < (3, 1, 0) and sys.version_info[0] == 3:
928 print('Sorry, you must have Python 3.1.0 or higher.') 928 print('Sorry, you must have Python 3.1.0 or higher.')
929 exit(5) 929 exit(5)
930 if sys.version_info > (3, 9, 9): 930 if sys.version_info > (3, 9, 9):
931 print('Sorry, eric5 requires Python 3 or Python 2 for running.') 931 print('Sorry, eric6 requires Python 3 or Python 2 for running.')
932 exit(5) 932 exit(5)
933 print("Python Version: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3])) 933 print("Python Version: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3]))
934 934
935 try: 935 try:
936 import xml.etree # __IGNORE_WARNING__ 936 import xml.etree # __IGNORE_WARNING__
1010 exit(3) 1010 exit(3)
1011 # check for blacklisted versions 1011 # check for blacklisted versions
1012 for vers in BlackLists["sip"] + PlatformBlackLists["sip"]: 1012 for vers in BlackLists["sip"] + PlatformBlackLists["sip"]:
1013 if vers == sipVersion: 1013 if vers == sipVersion:
1014 print( 1014 print(
1015 'Sorry, sip version {0} is not compatible with eric5.' 1015 'Sorry, sip version {0} is not compatible with eric6.'
1016 .format(vers)) 1016 .format(vers))
1017 print('Please install another version.') 1017 print('Please install another version.')
1018 exit(3) 1018 exit(3)
1019 except (ImportError, AttributeError): 1019 except (ImportError, AttributeError):
1020 pass 1020 pass
1035 ' a recent snapshot release.') 1035 ' a recent snapshot release.')
1036 exit(4) 1036 exit(4)
1037 # check for blacklisted versions 1037 # check for blacklisted versions
1038 for vers in BlackLists["PyQt5"] + PlatformBlackLists["PyQt5"]: 1038 for vers in BlackLists["PyQt5"] + PlatformBlackLists["PyQt5"]:
1039 if vers == pyqtVersion: 1039 if vers == pyqtVersion:
1040 print('Sorry, PyQt5 version {0} is not compatible with eric5.' 1040 print('Sorry, PyQt5 version {0} is not compatible with eric6.'
1041 .format(vers)) 1041 .format(vers))
1042 print('Please install another version.') 1042 print('Please install another version.')
1043 exit(4) 1043 exit(4)
1044 print("PyQt Version: ", pyqtVersion) 1044 print("PyQt Version: ", pyqtVersion)
1045 1045
1062 for vers in BlackLists["QScintilla2"] + \ 1062 for vers in BlackLists["QScintilla2"] + \
1063 PlatformBlackLists["QScintilla2"]: 1063 PlatformBlackLists["QScintilla2"]:
1064 if vers == scintillaVersion: 1064 if vers == scintillaVersion:
1065 print( 1065 print(
1066 'Sorry, QScintilla2 version {0} is not compatible with' 1066 'Sorry, QScintilla2 version {0} is not compatible with'
1067 ' eric5.'.format(vers)) 1067 ' eric6.'.format(vers))
1068 print('Please install another version.') 1068 print('Please install another version.')
1069 exit(5) 1069 exit(5)
1070 print("QScintilla Version: ", QSCINTILLA_VERSION_STR) 1070 print("QScintilla Version: ", QSCINTILLA_VERSION_STR)
1071 print("All dependencies ok.") 1071 print("All dependencies ok.")
1072 print() 1072 print()
1175 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir 1175 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir
1176 global sourceDir, configName, includePythonVariant 1176 global sourceDir, configName, includePythonVariant
1177 global macAppBundlePath, macAppBundleName, macPythonExe 1177 global macAppBundlePath, macAppBundleName, macPythonExe
1178 1178
1179 if sys.version_info < (2, 6, 0) or sys.version_info > (3, 9, 9): 1179 if sys.version_info < (2, 6, 0) or sys.version_info > (3, 9, 9):
1180 print('Sorry, eric5 requires at least Python 2.6 or ' 1180 print('Sorry, eric6 requires at least Python 2.6 or '
1181 'Python 3 for running.') 1181 'Python 3 for running.')
1182 exit(5) 1182 exit(5)
1183 1183
1184 progName = os.path.basename(argv[0]) 1184 progName = os.path.basename(argv[0])
1185 1185
1238 macPythonExe = arg 1238 macPythonExe = arg
1239 1239
1240 installFromSource = not os.path.isdir(sourceDir) 1240 installFromSource = not os.path.isdir(sourceDir)
1241 if installFromSource: 1241 if installFromSource:
1242 sourceDir = os.path.dirname(__file__) or "." 1242 sourceDir = os.path.dirname(__file__) or "."
1243 configName = os.path.join(sourceDir, "eric5config.py") 1243 configName = os.path.join(sourceDir, "eric6config.py")
1244 1244
1245 if len(cfg) == 0: 1245 if len(cfg) == 0:
1246 createInstallConfig() 1246 createInstallConfig()
1247 1247
1248 if depChecks: 1248 if depChecks:
1300 ddir=os.path.join(distDir, modDir, cfg['ericDir']), 1300 ddir=os.path.join(distDir, modDir, cfg['ericDir']),
1301 rx=re.compile(r"DebugClients[\\/]Python[\\/]"), 1301 rx=re.compile(r"DebugClients[\\/]Python[\\/]"),
1302 quiet=True) 1302 quiet=True)
1303 py_compile.compile( 1303 py_compile.compile(
1304 configName, 1304 configName,
1305 dfile=os.path.join(distDir, modDir, "eric5config.py")) 1305 dfile=os.path.join(distDir, modDir, "eric6config.py"))
1306 else: 1306 else:
1307 compileall.compile_dir( 1307 compileall.compile_dir(
1308 sourceDir, 1308 sourceDir,
1309 ddir=os.path.join(modDir, cfg['ericDir']), 1309 ddir=os.path.join(modDir, cfg['ericDir']),
1310 rx=re.compile(r"DebugClients[\\/]Python[\\/]"), 1310 rx=re.compile(r"DebugClients[\\/]Python[\\/]"),
1311 quiet=True) 1311 quiet=True)
1312 py_compile.compile(configName, 1312 py_compile.compile(configName,
1313 dfile=os.path.join(modDir, "eric5config.py")) 1313 dfile=os.path.join(modDir, "eric6config.py"))
1314 sys.stdout = sys.__stdout__ 1314 sys.stdout = sys.__stdout__
1315 print("\nInstalling eric5 ...") 1315 print("\nInstalling eric6 ...")
1316 res = installEric() 1316 res = installEric()
1317 1317
1318 # do some cleanup 1318 # do some cleanup
1319 try: 1319 try:
1320 if installFromSource: 1320 if installFromSource:
1338 except SystemExit: 1338 except SystemExit:
1339 raise 1339 raise
1340 except: 1340 except:
1341 print("""An internal error occured. Please report all the output""" 1341 print("""An internal error occured. Please report all the output"""
1342 """ of the program,\nincluding the following traceback, to""" 1342 """ of the program,\nincluding the following traceback, to"""
1343 """ eric5-bugs@eric-ide.python-projects.org.\n""") 1343 """ eric-bugs@eric-ide.python-projects.org.\n""")
1344 raise 1344 raise

eric ide

mercurial