scripts/install-dependencies.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9314
7ba79b00ea96
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
14 14
15 15
16 def pipInstall(packageName): 16 def pipInstall(packageName):
17 """ 17 """
18 Install the given package via pip. 18 Install the given package via pip.
19 19
20 @param packageName name of the package to be installed 20 @param packageName name of the package to be installed
21 @type str 21 @type str
22 @return flag indicating a successful installation 22 @return flag indicating a successful installation
23 @rtype bool 23 @rtype bool
24 """ 24 """
25 ok = False 25 ok = False
26 exitCode = subprocess.run( # secok 26 exitCode = subprocess.run( # secok
27 [sys.executable, "-m", "pip", "install", "--prefer-binary", 27 [
28 "--upgrade", packageName] 28 sys.executable,
29 "-m",
30 "pip",
31 "install",
32 "--prefer-binary",
33 "--upgrade",
34 packageName,
35 ]
29 ).returncode 36 ).returncode
30 ok = (exitCode == 0) 37 ok = exitCode == 0
31 38
32 return ok 39 return ok
33 40
34 41
35 def main(): 42 def main():
36 """ 43 """
37 Function to install the eric dependencies. 44 Function to install the eric dependencies.
38 """ 45 """
39 packages = ( 46 packages = (
40 "wheel", 47 "wheel",
41
42 "PyQt6>=6.2.0", 48 "PyQt6>=6.2.0",
43 "PyQt6-Charts>=6.2.0", 49 "PyQt6-Charts>=6.2.0",
44 "PyQt6-WebEngine>=6.2.0", 50 "PyQt6-WebEngine>=6.2.0",
45 "PyQt6-QScintilla>=2.13.0", 51 "PyQt6-QScintilla>=2.13.0",
46
47 "docutils", 52 "docutils",
48 "Markdown", 53 "Markdown",
49 "pyyaml", 54 "pyyaml",
50 "tomlkit", 55 "tomlkit",
51 "chardet", 56 "chardet",
59 "pipdeptree", 64 "pipdeptree",
60 "cyclonedx-python-lib", 65 "cyclonedx-python-lib",
61 "cyclonedx-bom", 66 "cyclonedx-bom",
62 "trove-classifiers", 67 "trove-classifiers",
63 ) 68 )
64 69
65 failedPackages = [] 70 failedPackages = []
66 for package in packages: 71 for package in packages:
67 ok = pipInstall(package) 72 ok = pipInstall(package)
68 if not ok: 73 if not ok:
69 failedPackages.append(package) 74 failedPackages.append(package)
70 75
71 print() 76 print()
72 print("Installation Summary") 77 print("Installation Summary")
73 print("--------------------") 78 print("--------------------")
74 if failedPackages: 79 if failedPackages:
75 print("These packages could not be installed:") 80 print("These packages could not be installed:")
76 for package in failedPackages: 81 for package in failedPackages:
77 print(" " + package) 82 print(" " + package)
78 else: 83 else:
79 print("All packages installed successfully.") 84 print("All packages installed successfully.")
80 85
86
81 if __name__ == "__main__": 87 if __name__ == "__main__":
82 main() 88 main()
83 89
84 # 90 #
85 # eflag: noqa = M801 91 # eflag: noqa = M801

eric ide

mercurial