|
1 #!/usr/bin/env python3 |
|
2 # -*- coding: utf-8 -*- |
|
3 |
|
4 # Copyright (c) 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
|
5 # |
|
6 # This script installs all packages eric depends on. |
|
7 |
|
8 """ |
|
9 Installation script for the eric IDE dependencies. |
|
10 """ |
|
11 |
|
12 import subprocess |
|
13 import sys |
|
14 |
|
15 |
|
16 def pipInstall(packageName): |
|
17 """ |
|
18 Install the given package via pip. |
|
19 |
|
20 @param packageName name of the package to be installed |
|
21 @type str |
|
22 @return flag indicating a successful installation |
|
23 @rtype bool |
|
24 """ |
|
25 ok = False |
|
26 exitCode = subprocess.run( # secok |
|
27 [sys.executable, "-m", "pip", "install", "--prefer-binary", |
|
28 "--upgrade", packageName] |
|
29 ).returncode |
|
30 ok = (exitCode == 0) |
|
31 |
|
32 return ok |
|
33 |
|
34 |
|
35 def main(): |
|
36 """ |
|
37 Function to install the eric dependencies. |
|
38 """ |
|
39 packages = ( |
|
40 "pyqt6", |
|
41 "pyqt6-charts", |
|
42 "pyqt6-webengine", |
|
43 "pyqt6-qscintilla", |
|
44 |
|
45 "docutils", |
|
46 "Markdown", |
|
47 "pyyaml", |
|
48 "toml", |
|
49 "chardet", |
|
50 "asttokens", |
|
51 "EditorConfig", |
|
52 "Send2Trash", |
|
53 "Pygments", |
|
54 "pyenchant", |
|
55 "wheel", |
|
56 "parso", |
|
57 "jedi", |
|
58 "packaging", |
|
59 ) |
|
60 |
|
61 failedPackages = [] |
|
62 for package in packages: |
|
63 ok = pipInstall(package) |
|
64 if not ok: |
|
65 failedPackages.append(package) |
|
66 |
|
67 print() |
|
68 print("Installation Summary") |
|
69 print("--------------------") |
|
70 if failedPackages: |
|
71 print("These packages could not be installed:") |
|
72 for package in failedPackages: |
|
73 print(" " + package) |
|
74 else: |
|
75 print("All packages installed successfully.") |
|
76 |
|
77 if __name__ == "__main__": |
|
78 main() |
|
79 |
|
80 # |
|
81 # eflag: noqa = M801 |