Added code to check and install all of the plugin dependencies (e.g. after upgrading a virtual environment to a new Python version). eric7

Sat, 19 Mar 2022 16:42:29 +0100

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

Added code to check and install all of the plugin dependencies (e.g. after upgrading a virtual environment to a new Python version).

eric7/APIs/Python3/eric7.api file | annotate | diff | comparison | revisions
eric7/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric7/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric7/Documentation/Source/index.html file | annotate | diff | comparison | revisions
eric7/PluginManager/PluginManager.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/PluginManagerPage.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/PluginManagerPage.ui file | annotate | diff | comparison | revisions
eric7/Preferences/__init__.py file | annotate | diff | comparison | revisions
--- a/eric7/APIs/Python3/eric7.api	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/APIs/Python3/eric7.api	Sat Mar 19 16:42:29 2022 +0100
@@ -12510,6 +12510,8 @@
 install-debugclients.shutilCopy?4(src, dst, perm=0o644)
 install-debugclients.sourceDir?7
 install-debugclients.usage?4(rcode=2)
+install-dependencies.main?4()
+install-dependencies.pipInstall?4(packageName)
 install-i18n.configDir?7
 install-i18n.getConfigDir?4()
 install-i18n.installTranslations?4()
Binary file eric7/Documentation/Help/source.qch has changed
--- a/eric7/Documentation/Help/source.qhp	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/Documentation/Help/source.qhp	Sat Mar 19 16:42:29 2022 +0100
@@ -1438,6 +1438,7 @@
         <section title="create_windows_links" ref="create_windows_links.html" />
         <section title="install" ref="install.html" />
         <section title="install-debugclients" ref="install-debugclients.html" />
+        <section title="install-dependencies" ref="install-dependencies.html" />
         <section title="install-i18n" ref="install-i18n.html" />
         <section title="setup" ref="setup.html" />
         <section title="uninstall" ref="uninstall.html" />
@@ -18707,6 +18708,7 @@
       <keyword name="insecureSslTls (Module)" id="insecureSslTls (Module)" ref="eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.Checks.insecureSslTls.html" />
       <keyword name="install (Module)" id="install (Module)" ref="install.html" />
       <keyword name="install-debugclients (Module)" id="install-debugclients (Module)" ref="install-debugclients.html" />
+      <keyword name="install-dependencies (Module)" id="install-dependencies (Module)" ref="install-dependencies.html" />
       <keyword name="install-i18n (Module)" id="install-i18n (Module)" ref="install-i18n.html" />
       <keyword name="installEric" id="installEric" ref="install.html#installEric" />
       <keyword name="installEricDebugClients" id="installEricDebugClients" ref="install-debugclients.html#installEricDebugClients" />
@@ -18800,6 +18802,7 @@
       <keyword name="main" id="main" ref="eric7.eric7_unittest.html#main" />
       <keyword name="main" id="main" ref="eric7.eric7_virtualenv.html#main" />
       <keyword name="main" id="main" ref="install-debugclients.html#main" />
+      <keyword name="main" id="main" ref="install-dependencies.html#main" />
       <keyword name="main" id="main" ref="install-i18n.html#main" />
       <keyword name="main" id="main" ref="install.html#main" />
       <keyword name="main" id="main" ref="uninstall-debugclients.html#main" />
@@ -18858,6 +18861,7 @@
       <keyword name="patchQProcess" id="patchQProcess" ref="eric7.DebugClients.Python.QProcessExtension.html#patchQProcess" />
       <keyword name="patchSubprocess" id="patchSubprocess" ref="eric7.DebugClients.Python.SubprocessExtension.html#patchSubprocess" />
       <keyword name="pbkdf2" id="pbkdf2" ref="eric7.Utilities.crypto.py3PBKDF2.html#pbkdf2" />
+      <keyword name="pipInstall" id="pipInstall" ref="install-dependencies.html#pipInstall" />
       <keyword name="pipInstall" id="pipInstall" ref="install.html#pipInstall" />
       <keyword name="pixmapFileToDataUrl" id="pixmapFileToDataUrl" ref="eric7.WebBrowser.Tools.WebBrowserTools.html#pixmapFileToDataUrl" />
       <keyword name="pixmapFromByteArray" id="pixmapFromByteArray" ref="eric7.WebBrowser.Tools.WebBrowserTools.html#pixmapFromByteArray" />
@@ -20447,6 +20451,7 @@
       <file>index-eric7.html</file>
       <file>index.html</file>
       <file>install-debugclients.html</file>
+      <file>install-dependencies.html</file>
       <file>install-i18n.html</file>
       <file>install.html</file>
       <file>setup.html</file>
--- a/eric7/Documentation/Source/index.html	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/Documentation/Source/index.html	Sat Mar 19 16:42:29 2022 +0100
@@ -41,6 +41,10 @@
 <td>Installation script for the eric debug clients.</td>
 </tr>
 <tr>
+<td><a href="install-dependencies.html">install-dependencies</a></td>
+<td>Installation script for the eric IDE dependencies.</td>
+</tr>
+<tr>
 <td><a href="install-i18n.html">install-i18n</a></td>
 <td>Installation script for the eric IDE translation files.</td>
 </tr>
--- a/eric7/PluginManager/PluginManager.py	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/PluginManager/PluginManager.py	Sat Mar 19 16:42:29 2022 +0100
@@ -427,7 +427,11 @@
                     self.__onDemandInactiveModules[name] = module
             module.eric7PluginModuleName = name
             module.eric7PluginModuleFilename = fname
-            if install and hasattr(module, "installDependencies"):
+            if (
+                (install or
+                 Preferences.getPluginManager("AutoInstallDependencies")) and
+                hasattr(module, "installDependencies")
+            ):
                 # ask the module to install its dependencies
                 module.installDependencies(self.pipInstall)
             self.__modulesCount += 1
--- a/eric7/Preferences/ConfigurationPages/PluginManagerPage.py	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/Preferences/ConfigurationPages/PluginManagerPage.py	Sat Mar 19 16:42:29 2022 +0100
@@ -63,6 +63,9 @@
         
         self.__repositoryUrl = Preferences.getUI("PluginRepositoryUrl7")
         self.repositoryUrlEdit.setText(self.__repositoryUrl)
+        
+        self.autoInstallCheckBox.setChecked(
+            Preferences.getPluginManager("AutoInstallDependencies"))
     
     def save(self):
         """
@@ -103,6 +106,10 @@
         if self.repositoryUrlEdit.text() != self.__repositoryUrl:
             Preferences.setUI(
                 "PluginRepositoryUrl7", self.repositoryUrlEdit.text())
+        
+        Preferences.getPluginManager(
+            "AutoInstallDependencies",
+            self.autoInstallCheckBox.isChecked())
     
     @pyqtSlot(bool)
     def on_repositoryUrlEditButton_toggled(self, checked):
--- a/eric7/Preferences/ConfigurationPages/PluginManagerPage.ui	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/Preferences/ConfigurationPages/PluginManagerPage.ui	Sat Mar 19 16:42:29 2022 +0100
@@ -7,10 +7,10 @@
     <x>0</x>
     <y>0</y>
     <width>528</width>
-    <height>427</height>
+    <height>520</height>
    </rect>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
+  <layout class="QVBoxLayout" name="verticalLayout_3">
    <item>
     <widget class="QLabel" name="headerLabel">
      <property name="text">
@@ -245,6 +245,25 @@
     </layout>
    </item>
    <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>Startup Behavior</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QCheckBox" name="autoInstallCheckBox">
+        <property name="toolTip">
+         <string>Select, to check for missing plugin dependencies at startup and install them</string>
+        </property>
+        <property name="text">
+         <string>Automatic dependencies installation</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
     <spacer>
      <property name="orientation">
       <enum>Qt::Vertical</enum>
--- a/eric7/Preferences/__init__.py	Sat Mar 19 16:41:16 2022 +0100
+++ b/eric7/Preferences/__init__.py	Sat Mar 19 16:42:29 2022 +0100
@@ -1288,12 +1288,13 @@
         # 3 = monthly
         # 4 = always
         "CheckInstalledOnly": True,
-        # list of plug-ins not to shown in the repo dialog
+        # list of plug-ins not to be shown in the repo dialog
         "HiddenPlugins": [],
         # parameters for housekeeping
         "KeepGenerations": 2,
         "KeepHidden": False,
         "StartupCleanup": True,
+        "AutoInstallDependencies": True,
     }
     
     # defaults for the printer settings

eric ide

mercurial