https://issues.qgis.org/https://issues.qgis.org/favicon.ico2012-10-08T04:53:23ZQGIS Issue TrackingQGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=363652012-10-08T04:53:23ZSandro Santillistrk@kbt.io
<ul></ul><p>+1, this is very important for core plugin development</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=364292012-10-10T11:31:36ZSandro Santillistrk@kbt.io
<ul><li><strong>Pull Request or Patch supplied</strong> changed from <i>No</i> to <i>Yes</i></li></ul><p>So I've done some work to install the db_manager plugin to output/python/plugin/* and to have qgis load it.<br />The result is two pull requests:<br /><a class="external" href="https://github.com/qgis/Quantum-GIS/pull/285">https://github.com/qgis/Quantum-GIS/pull/285</a><br /><a class="external" href="https://github.com/qgis/Quantum-GIS/pull/286">https://github.com/qgis/Quantum-GIS/pull/286</a></p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=364302012-10-10T12:28:38ZSandro Santillistrk@kbt.io
<ul></ul><p>Alright, I confirm things work with those two pulls above. I can get db_manager loaded from output dir.<br />Next stop will be installing all plugins under output/</p>
<p>Ideally we'd have a macro for this on the CMake side, as the db_manager install has been very tedious....</p>
<p>Anyway please pull those two branches so I can get back to db_manager hacking when I find the time :)</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=364392012-10-10T21:12:41ZSandro Santillistrk@kbt.io
<ul></ul><p>I was thinking about two other possible ways to fix this:<br /> 1. Have the build dir listed in sys.path and plugin_paths, and make sure all sources are also copied to build dir<br /> 2. Have both the build dir and the source dir listed in sys.path and plugins_path</p>
<p>The second option would make the support automatically available to <em>all</em> plugins with no need to maintain anything at the plugin-level.</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366142012-10-19T12:25:54ZSandro Santillistrk@kbt.io
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>30</i></li></ul><p>As of 6461a0125b2f83649d1604cbc11fcb6678490ed5 qgis running from build tree would find any python plugin under output/python/plugins. So next thing to do is find an easy way to get plugins under there...</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366162012-10-19T14:18:41ZSandro Santillistrk@kbt.io
<ul><li><strong>% Done</strong> changed from <i>30</i> to <i>70</i></li></ul><p>8ca2236134a8d441803c9bdfdfb5dfcbc5536524 provides a PLUGIN_INSTALL macro and makes db_manager use that.<br />All plugins that are to be loaded from build dir should switch to use that macro now, in order for this to be closed</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366262012-10-20T11:01:29ZSandro Santillistrk@kbt.io
<ul></ul><p>plugin_installer plugin ready to run from build dir as of f93f844867e0bbecb461ef571f9dc7a6dfdaf3e6</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366672012-10-23T11:36:32ZSandro Santillistrk@kbt.io
<ul><li><strong>% Done</strong> changed from <i>70</i> to <i>80</i></li></ul><p>fTools ready with b892a021af26b39285bebe9199c9534deade135d<br />mapserver_export ready with 9a0c4ffdb56765893764ca294088cb0967ca03d4</p>
<p>Still left: osm, sextante and sextanteexampleprovider</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366682012-10-23T11:44:27ZSandro Santillistrk@kbt.io
<ul></ul><p>9f1351b08b957f76a570d80c2338ec691550d1a2 does osm, so only left is sextante</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366902012-10-24T23:24:30ZLarry Shaffer
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>A current issue regarding the loading of plugins (while running from the build directory) is when plugins are restored on launch of the app. There is currently a goofy fix for this with commits <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/e31fb3c9f29a168f7f7777b2d299cb620d7efb8a" title="Additional fix for # 5879 - Adjust QgsApplication::pkgDataPath temporarily for restoring core pl...">e31fb3c9</a> and commit: where QgsApplication::pkgDataPath() is temporarily set to something other than QgsApplication::buildSourcePath() when restoring core plugins.</p>
<p>The reason for that patch: when QgsPluginRegistry::restoreSessionPlugins() is called the Python packages are imported from <strong>QgsApplication::buildSourcePath()/python/plugins</strong> even though that path is <strong>NOT</strong> in sys.path for the interpreter. If QgsApplication::pkgDataPath() is pointed to something other than QgsApplication::buildSourcePath(), or an empty QString, it works. However, <strong>I could find no means by which the interpreter was assigned that module search path</strong>.</p>
<p>I have tried:</p>
<ul>
<li>changing the current working directory in C++ and via Python</li>
<li>setting PYTHONPATH</li>
<li>setting all kinds of debug output from the interpreter (never shows buildSourcePath()/python/plugins in sys.path)</li>
<li>giving up <em><-- that kinda worked</em></li>
</ul>
<p>To reproduce the issue, run QGIS from the build directory and then launch DB Manager core plugin. You will get an error about a missing ui_*.py file, because that 'compiled' version of a *.ui file does not exist in source directory, only in the <code>build/output/python/plugins</code> staged version of the plugin.</p>
<p>Now, run QGIS again, but with the <code>--noplugins</code> option. This will keep <code>restoreSessionPlugins()</code> from being called. After using Plugin Manager to turn back on DB Manager, launch the plugin and you should not get the error: sys.path is being honored, and the plugin is imported from <code>build/output/python/plugins</code> staged area, as expected.</p>
<p>While the current patch works, it requires core plugins to not request QgsApplication::pkgDataPath() when the plugin loads. A better solution is needed.</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=366942012-10-25T00:57:16ZSandro Santillistrk@kbt.io
<ul><li><strong>Assignee</strong> set to <i>Sandro Santilli</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>100</i></li></ul><p>Sextante loads as of <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/6ca7ea987d86251ee051b7d7ee974a1e9d78bd8f" title="Allow running sextante plugin from build dir See http://hub.qgis.org/issues/5879">6ca7ea987d86251ee051b7d7ee974a1e9d78bd8f</a><br />I think this ticket could be closed, and Larry's findings about plugins restore should be in a separate ticket.</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=370172012-11-12T12:17:01ZSandro Santillistrk@kbt.io
<ul></ul><p>Larry, did you file a ticket for the plugin restore issue ?</p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=378622012-12-22T14:34:15ZLarry Shaffer
<ul></ul><p>Sandro Santilli wrote:</p>
<blockquote>
<p>Larry, did you file a ticket for the plugin restore issue ?</p>
</blockquote>
<p>Finally. :^)</p>
<p>See issue <a class="issue tracker-1 status-5 priority-4 priority- closed" href="https://issues.qgis.org/issues/6913" title="Python interpreter starts hardwired to search buildSourcePath when run from build directory (Closed)">#6913</a></p> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=537082014-06-28T05:42:10ZJürgen Fischerjef@norbit.de
<ul><li><strong>Target version</strong> changed from <i>Version 2.0.0</i> to <i>Future Release - Lower Priority</i></li></ul> QGIS Application - Bug report #5879: running from build directory - no python pluginshttps://issues.qgis.org/issues/5879?journal_id=539112014-06-28T13:12:32ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Given confirmation of Larry this ticket can be closed. Python plugins are loaded fine from build dir.</p>