scripts/install.py

branch
eric7-maintenance
changeset 10873
4e8e63df7893
parent 10814
ba20efe10336
parent 10868
ca5cd7faaf5e
child 10892
409d010d7cae
equal deleted inserted replaced
10826:0f9c86561033 10873:4e8e63df7893
10 """ 10 """
11 11
12 import argparse 12 import argparse
13 import compileall 13 import compileall
14 import contextlib 14 import contextlib
15 import copy
15 import datetime 16 import datetime
16 import fnmatch 17 import fnmatch
17 import getpass 18 import getpass
18 import glob 19 import glob
19 import importlib 20 import importlib
469 "eric7_compare", 470 "eric7_compare",
470 "eric7_configure", 471 "eric7_configure",
471 "eric7_diff", 472 "eric7_diff",
472 "eric7_doc", 473 "eric7_doc",
473 "eric7_editor", 474 "eric7_editor",
475 "eric7_fido2",
474 "eric7_hexeditor", 476 "eric7_hexeditor",
475 "eric7_iconeditor", 477 "eric7_iconeditor",
476 "eric7_ide", 478 "eric7_ide",
477 "eric7_mpy", 479 "eric7_mpy",
478 "eric7_pdf", 480 "eric7_pdf",
720 "eric7_browser", 722 "eric7_browser",
721 "eric7_compare", 723 "eric7_compare",
722 "eric7_configure", 724 "eric7_configure",
723 "eric7_diff", 725 "eric7_diff",
724 "eric7_editor", 726 "eric7_editor",
727 "eric7_fido2",
725 "eric7_hexeditor", 728 "eric7_hexeditor",
726 "eric7_iconeditor", 729 "eric7_iconeditor",
727 "eric7_ide", 730 "eric7_ide",
728 "eric7_mpy", 731 "eric7_mpy",
729 "eric7_pdf", 732 "eric7_pdf",
1720 "isort": ("isort", ">=5.10.0"), 1723 "isort": ("isort", ">=5.10.0"),
1721 "coverage": ("coverage", ">=6.5.0"), 1724 "coverage": ("coverage", ">=6.5.0"),
1722 "semver": ("semver", ""), 1725 "semver": ("semver", ""),
1723 "pipdeptree": ("pipdeptree", ""), 1726 "pipdeptree": ("pipdeptree", ""),
1724 "watchdog": ("watchdog", ">=3.0.0"), 1727 "watchdog": ("watchdog", ">=3.0.0"),
1728 "psutil": ("psutil", ""),
1725 } 1729 }
1726 optionalModulesList = { 1730 optionalModulesList = {
1727 # key is pip project name 1731 # key is pip project name
1728 # value is tuple of package name, pip install constraint 1732 # value is tuple of package name, pip install constraint
1729 "docutils": ("docutils", ""), 1733 "docutils": ("docutils", ""),
1731 "pyyaml": ("yaml", ""), 1735 "pyyaml": ("yaml", ""),
1732 "chardet": ("chardet", ""), 1736 "chardet": ("chardet", ""),
1733 "pyenchant": ("enchant", ""), 1737 "pyenchant": ("enchant", ""),
1734 "wheel": ("wheel", ""), 1738 "wheel": ("wheel", ""),
1735 "esprima": ("esprima", ""), 1739 "esprima": ("esprima", ""),
1740 "fido2": ("fido2", ""),
1736 } 1741 }
1737 if withPyqt6Tools: 1742 if withPyqt6Tools:
1738 optionalModulesList["qt6-applications"] = ("qt6_applications", "") 1743 optionalModulesList["qt6-applications"] = ("qt6_applications", "")
1744 optionalWinModulesList = {
1745 # key is pip project name
1746 # value is tuple of package name, pip install constraint
1747 "pywin32": ("win32com", ">=1.0"),
1748 "command-runner": ("command_runner", ""),
1749 }
1739 1750
1740 # check mandatory PyQt6 modules 1751 # check mandatory PyQt6 modules
1741 modulesOK = True 1752 modulesOK = True
1742 for pyqt6BaseModule in sorted(pyqt6BaseModulesList): 1753 for pyqt6BaseModule in sorted(pyqt6BaseModulesList):
1743 name = pyqt6BaseModule.split(".")[1] 1754 name = pyqt6BaseModule.split(".")[1]
1780 1791
1781 # check optional modules 1792 # check optional modules
1782 print("\nOptional Packages") 1793 print("\nOptional Packages")
1783 print("-----------------") 1794 print("-----------------")
1784 optionalMissing = False 1795 optionalMissing = False
1785 for optPackage in sorted(optionalModulesList): 1796 optModulesDict = copy.deepcopy(optionalModulesList)
1797 if sys.platform.startswith(("win", "cygwin")):
1798 optModulesDict.update(optionalWinModulesList)
1799 for optPackage in sorted(optModulesDict):
1786 try: 1800 try:
1787 importlib.import_module(optionalModulesList[optPackage][0]) 1801 importlib.import_module(optModulesDict[optPackage][0])
1788 print("Found", optPackage) 1802 print("Found", optPackage)
1789 except ImportError as err: 1803 except ImportError as err:
1790 if isSudo: 1804 if isSudo:
1791 print("Optional '{0}' could not be detected.".format(optPackage)) 1805 print("Optional '{0}' could not be detected.".format(optPackage))
1792 optionalMissing = True 1806 optionalMissing = True
1793 else: 1807 else:
1794 msg = "Optional '{0}' could not be detected.{1}".format( 1808 msg = "Optional '{0}' could not be detected.{1}".format(
1795 optPackage, "\nError: {0}".format(err) if verbose else "" 1809 optPackage, "\nError: {0}".format(err) if verbose else ""
1796 ) 1810 )
1797 pipInstall(optPackage + optionalModulesList[optPackage][1], msg) 1811 pipInstall(optPackage + optModulesDict[optPackage][1], msg)
1798 if optionalMissing: 1812 if optionalMissing:
1799 print("Some optional packages are missing and could not be installed.") 1813 print("Some optional packages are missing and could not be installed.")
1800 print("Install them manually with:") 1814 print("Install them manually with:")
1801 print(" {0} install-dependencies.py --optional".format(sys.executable)) 1815 print(" {0} install-dependencies.py --optional".format(sys.executable))
1802 1816

eric ide

mercurial