Hi Larry,

Thanks for the tips! At the moment I'm using a symlink for my project but will test your Make shortcut suggestion.

Yes, I'm using the Kyngchaos.com QGIS install, and PyCharm 3.0.

Unfortunately code completion still doesn't work, and I've tried different things:
- restart Pycharm remove/add QGIS python path and reload the path list
- remove/add the Python interpreter then add the QGIS path
- in the File menu clicked on 'Invalidate caches' then restarted PyCharm

I'll live with that for the moment, but will keep looking for a solution, and if I find it will post it here.

Regards,
Jorge


On 09/10/2013 16:44, Larry Shaffer wrote:
Hi Jorge,

On Wed, Oct 9, 2013 at 5:44 AM, Jorge Gil <[email protected]> wrote:
Hi everyone,

I'm new to QGIS plug-in developemtn and I'm setting up a development environment on Mac OS X.

At the moment I'm going with PyCharm and got the remote debugging to work. Thanks to this list!

Welcome to developing with QGIS. PyCharm is an excellent choice for IDE, especially now that 3.0 has a free community version and more support for PyQt.
 
One thing I can't get to work is code completion for the PyQGIS API.

I've added '/Applications/QGIS.app/Contents/Resources/python/qgis/' and '/Applications/QGIS.app/Contents/Resources/python/' to the interpreter's path. PyCharm can find PyQGIS and ads it to the external libraries. This way I can import the qgis modules without errors, in the Python console for example.
However, code completion doesn't work in the editor nor in the console.

You only need the '/Applications/QGIS.app/Contents/Resources/python' path added (assuming you are using a Kyngchaos.com QGIS install), so I recommend removing the other path . However, I have noticed that sometimes PyCharm on Mac does not properly rebuild the 'skeletons' for code completion (I'm using PyCharm 2.7.3). Try relaunching the app and removing/re-adding the path, then clicking the reload button. You should see a progress bar and eventually notice the qgis.* modules being parsed. If not there may be an issue.

For plugin development, I add external commands, several of which are for running my plugin's Makefile [0]. While the new PyCharm 3.0 has an embedded terminal, I find assigning a key shortcut (say Ctrl-M) to the make <prompt> command to be very quick for deploying the plugin to ~/.qgis2/python/plugins/. Deploying is the best-practice means of testing your plugin, instead of symlinking it, but that also works.

Also, I recommend using the Plugin Reloader PyQGIS plugin to reload your plugin within QGIS, so you do not have to relaunch QGIS every time you propagate a change in your plugin.

[0] http://drive.dakotacarto.com/qgis/pycharm-ext-cmd_make.png

Regards,

Larry

Thanks in advance for your help,
Jorge


_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Jorge Gil
Research Associate
The Bartlett School of Graduate Studies
University College London (UCL)

Central House,
14 Upper Woburn Place
London WC1H 0NN
UK

E: [email protected]
T: +44 (0)20 3108 9031
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to