Added a script to install all of eric's dependencies. eric7

Sat, 19 Mar 2022 16:41:16 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Mar 2022 16:41:16 +0100
branch
eric7
changeset 8988
ffa38e0415df
parent 8987
e9826bde657f
child 8989
25cd4c5f1f19

Added a script to install all of eric's dependencies.

eric7.epj file | annotate | diff | comparison | revisions
eric7/Documentation/Source/install-dependencies.html file | annotate | diff | comparison | revisions
scripts/install-dependencies.py file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
--- a/eric7.epj	Wed Mar 16 19:39:22 2022 +0100
+++ b/eric7.epj	Sat Mar 19 16:41:16 2022 +0100
@@ -2317,7 +2317,8 @@
       "eric7/__main__.py",
       "eric7/UI/VersionsDialog.py",
       "eric7/UI/upgrader.py",
-      "eric7/PipInterface/PipVulnerabilityChecker.py"
+      "eric7/PipInterface/PipVulnerabilityChecker.py",
+      "scripts/install-dependencies.py"
     ],
     "SPELLEXCLUDES": "Dictionaries/excludes.dic",
     "SPELLLANGUAGE": "en_US",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/Documentation/Source/install-dependencies.html	Sat Mar 19 16:41:16 2022 +0100
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html><head>
+<title>install-dependencies</title>
+<meta charset="UTF-8">
+<link rel="stylesheet" href="styles.css">
+</head>
+<body>
+<a NAME="top" ID="top"></a>
+<h1>install-dependencies</h1>
+
+<p>
+Installation script for the eric IDE dependencies.
+</p>
+<h3>Global Attributes</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Functions</h3>
+
+<table>
+
+<tr>
+<td><a href="#main">main</a></td>
+<td>Function to install the eric dependencies.</td>
+</tr>
+<tr>
+<td><a href="#pipInstall">pipInstall</a></td>
+<td>Install the given package via pip.</td>
+</tr>
+</table>
+<hr />
+<hr />
+<a NAME="main" ID="main"></a>
+<h2>main</h2>
+<b>main</b>(<i></i>)
+
+<p>
+    Function to install the eric dependencies.
+</p>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
+<a NAME="pipInstall" ID="pipInstall"></a>
+<h2>pipInstall</h2>
+<b>pipInstall</b>(<i>packageName</i>)
+
+<p>
+    Install the given package via pip.
+</p>
+<dl>
+
+<dt><i>packageName</i> (str)</dt>
+<dd>
+name of the package to be installed
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating a successful installation
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- /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
--- a/scripts/install.py	Wed Mar 16 19:39:22 2022 +0100
+++ b/scripts/install.py	Sat Mar 19 16:41:16 2022 +0100
@@ -2129,8 +2129,8 @@
     print()
     
     exit(res)
-    
-    
+
+
 if __name__ == "__main__":
     try:
         main(sys.argv)

eric ide

mercurial