scripts/install-dependencies.py

branch
eric7
changeset 8988
ffa38e0415df
child 9016
6f079c524e99
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/install-dependencies.py	Sat Mar 19 16:41:16 2022 +0100
@@ -0,0 +1,81 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2022 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+# This script installs all packages eric depends on.
+
+"""
+Installation script for the eric IDE dependencies.
+"""
+
+import subprocess
+import sys
+
+
+def pipInstall(packageName):
+    """
+    Install the given package via pip.
+    
+    @param packageName name of the package to be installed
+    @type str
+    @return flag indicating a successful installation
+    @rtype bool
+    """
+    ok = False
+    exitCode = subprocess.run(                  # secok
+        [sys.executable, "-m", "pip", "install", "--prefer-binary",
+         "--upgrade", packageName]
+    ).returncode
+    ok = (exitCode == 0)
+    
+    return ok
+
+
+def main():
+    """
+    Function to install the eric dependencies.
+    """
+    packages = (
+        "pyqt6",
+        "pyqt6-charts",
+        "pyqt6-webengine",
+        "pyqt6-qscintilla",
+        
+        "docutils",
+        "Markdown",
+        "pyyaml",
+        "toml",
+        "chardet",
+        "asttokens",
+        "EditorConfig",
+        "Send2Trash",
+        "Pygments",
+        "pyenchant",
+        "wheel",
+        "parso",
+        "jedi",
+        "packaging",
+    )
+    
+    failedPackages = []
+    for package in packages:
+        ok = pipInstall(package)
+        if not ok:
+            failedPackages.append(package)
+    
+    print()
+    print("Installation Summary")
+    print("--------------------")
+    if failedPackages:
+        print("These packages could not be installed:")
+        for package in failedPackages:
+            print("    " + package)
+    else:
+        print("All packages installed successfully.")
+
+if __name__ == "__main__":
+    main()
+
+#
+# eflag: noqa = M801

eric ide

mercurial