43 forceCleanDesktopLinks = False |
43 forceCleanDesktopLinks = False |
44 doCompile = True |
44 doCompile = True |
45 yes2All = False |
45 yes2All = False |
46 withPyqt6Tools = False |
46 withPyqt6Tools = False |
47 verbose = False |
47 verbose = False |
|
48 proxy = None |
48 cfg = {} |
49 cfg = {} |
49 progLanguages = ["MicroPython", "Python3", "QSS"] |
50 progLanguages = ["MicroPython", "Python3", "QSS"] |
50 sourceDir = "eric" |
51 sourceDir = "eric" |
51 eric7SourceDir = "" |
52 eric7SourceDir = "" |
52 configName = "eric7config.py" |
53 configName = "eric7config.py" |
1493 Check, if pip is outdated. |
1495 Check, if pip is outdated. |
1494 |
1496 |
1495 @return flag indicating an outdated pip |
1497 @return flag indicating an outdated pip |
1496 @rtype bool |
1498 @rtype bool |
1497 """ |
1499 """ |
|
1500 global proxy |
|
1501 |
1498 try: |
1502 try: |
|
1503 args = [ |
|
1504 sys.executable, |
|
1505 "-m", |
|
1506 "pip", |
|
1507 "list", |
|
1508 "--outdated", |
|
1509 "--format=json", |
|
1510 ] |
|
1511 if proxy: |
|
1512 args.append(f"--proxy={proxy}") |
1499 pipOut = ( |
1513 pipOut = ( |
1500 subprocess.run( # secok |
1514 subprocess.run( # secok |
1501 [sys.executable, "-m", "pip", "list", "--outdated", "--format=json"], |
1515 args, |
1502 check=True, |
1516 check=True, |
1503 capture_output=True, |
1517 capture_output=True, |
1504 text=True, |
1518 text=True, |
1505 ) |
1519 ) |
1506 .stdout.strip() |
1520 .stdout.strip() |
1527 |
1541 |
1528 def updatePip(): |
1542 def updatePip(): |
1529 """ |
1543 """ |
1530 Update the installed pip package. |
1544 Update the installed pip package. |
1531 """ |
1545 """ |
1532 global yes2All |
1546 global yes2All, proxy |
1533 |
1547 |
1534 if yes2All: |
1548 if yes2All: |
1535 answer = "y" |
1549 answer = "y" |
1536 else: |
1550 else: |
1537 print("Shall 'pip' be updated (recommended)? (Y/n)", end=" ") |
1551 print("Shall 'pip' be updated (recommended)? (Y/n)", end=" ") |
1538 answer = input() # secok |
1552 answer = input() # secok |
1539 if answer in ("", "Y", "y"): |
1553 if answer in ("", "Y", "y"): |
1540 subprocess.run( # secok |
1554 args = [ |
1541 [sys.executable, "-m", "pip", "install", "--upgrade", "pip"] |
1555 sys.executable, |
1542 ) |
1556 "-m", |
|
1557 "pip", |
|
1558 "install", |
|
1559 "--upgrade", |
|
1560 ] |
|
1561 if proxy: |
|
1562 args.append(f"--proxy={proxy}") |
|
1563 args.append("pip") |
|
1564 subprocess.run(args) # secok |
1543 |
1565 |
1544 |
1566 |
1545 def versionToStr(version): |
1567 def versionToStr(version): |
1546 """ |
1568 """ |
1547 Function to convert a version number into a version string. |
1569 Function to convert a version number into a version string. |
2072 @rtype argparse.ArgumentParser |
2094 @rtype argparse.ArgumentParser |
2073 """ |
2095 """ |
2074 parser = argparse.ArgumentParser( |
2096 parser = argparse.ArgumentParser( |
2075 description="Install eric7 from the source code tree.", |
2097 description="Install eric7 from the source code tree.", |
2076 epilog="The file given to the -f option must be valid Python code defining a" |
2098 epilog="The file given to the -f option must be valid Python code defining a" |
2077 "dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir', ericIconDir'," |
2099 " dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir', ericIconDir'," |
2078 " 'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericThemesDir', ericDocDir'," |
2100 " 'ericDTDDir', 'ericCSSDir', 'ericStylesDir', 'ericThemesDir', ericDocDir'," |
2079 " ericExamplesDir', ericTranslationsDir', 'ericTemplatesDir'," |
2101 " ericExamplesDir', ericTranslationsDir', 'ericTemplatesDir'," |
2080 " 'ericCodeTemplatesDir', ericOthersDir','bindir', 'mdir' and 'apidir." |
2102 " 'ericCodeTemplatesDir', ericOthersDir','bindir', 'mdir' and 'apidir." |
2081 "These define the directories for the installation of the various parts of" |
2103 " These define the directories for the installation of the various parts of" |
2082 " eric.", |
2104 " eric.", |
2083 ) |
2105 ) |
2084 |
2106 |
2085 parser.add_argument( |
2107 parser.add_argument( |
2086 "-a", |
2108 "-a", |
2196 @type list of str |
2224 @type list of str |
2197 """ |
2225 """ |
2198 global modDir, doCleanup, doCompile, distDir, cfg, apisDir |
2226 global modDir, doCleanup, doCompile, distDir, cfg, apisDir |
2199 global sourceDir, eric7SourceDir, configName, platBinDir |
2227 global sourceDir, eric7SourceDir, configName, platBinDir |
2200 global macAppBundlePath, macAppBundleName, macPythonExe |
2228 global macAppBundlePath, macAppBundleName, macPythonExe |
2201 global installApis, doCleanDesktopLinks, yes2All |
2229 global installApis, doCleanDesktopLinks, yes2All, proxy |
2202 global createInstallInfoFile, installCwd |
2230 global createInstallInfoFile, installCwd |
2203 global withPyqt6Tools |
2231 global withPyqt6Tools |
2204 global verbose |
2232 global verbose |
2205 |
2233 |
2206 if sys.version_info < (3, 8, 0) or sys.version_info > (3, 99, 99): |
2234 if sys.version_info < (3, 8, 0) or sys.version_info > (3, 99, 99): |
2223 depChecks = args.x |
2251 depChecks = args.x |
2224 doCleanup = args.c |
2252 doCleanup = args.c |
2225 doCompile = args.z |
2253 doCompile = args.z |
2226 installApis = not args.no_apis |
2254 installApis = not args.no_apis |
2227 yes2All = args.yes |
2255 yes2All = args.yes |
|
2256 proxy = args.proxy |
2228 withPyqt6Tools = args.with_tools |
2257 withPyqt6Tools = args.with_tools |
2229 createInstallInfoFile = not args.no_info |
2258 createInstallInfoFile = not args.no_info |
2230 verbose = args.verbose |
2259 verbose = args.verbose |
2231 if sys.platform == "darwin": |
2260 if sys.platform == "darwin": |
2232 macAppBundleName = args.m |
2261 macAppBundleName = args.m |