Only useful for people using PyCharm while developing Plone.....
After winning a pycharm license at last years Plone Conference lightning talk lottery in Boston I finally got so fed up with my current editor that I really want to switch to Pycharm. I've figured out quite a few things in the meanwhile, PyCharm is very powerful and cool, but for some of its best features to shine it's a hit or miss thing. I want to pay attention to all warnings and inspections it does, but then all the warnings have to make sense be correct, which they aren't.
By setting the interpreter to a virtualenv I'm creating in every buildout and activating the buildout support by selecting /bin/instance, PyCharm figures out and can complete all missing imports. PyCharm even distinguishes between my project code in /src and 'external' default Plone/Zope eggs.
This setup lets PyCharm find most of the modules, classes and functions and I can add a missing import for getToolByName without remembering Product.CMFPlone.utils, but this doesn't work:
from plone import api
from zope import schema
then I get for "Package containing modules 'plone' is not listed in project requirements.". The instance runs fine though, also in Pycharms run environment and debugger. "from plone.api import portal" is not frowned upon by the inspection.
However, in the PyCharms project structure I've excluded the parts and var directories. If I add parts/omelette to the project structure as sources, the imports above work again, but I get the impression that PyCharms indexer is now running much longer and doing double work: it finds imports from bin/instance (buildout support), and finds most of the same imports again in parts/omelette. Also my own custom modules in /src/ are replicated in parts/omelette. What is the correct setup here?
Another question: PyCharm suggests putting the .idea folder in git to share settings with others using PyCharm. Activating buildout support however puts a lot of local developer install paths in the .idea subdir, like the path to a shared buildout cache. On every commit or pull you're battling anther committers paths. Any suggestions for this, maybe explicitly excluding .idea/libraries/Buildout_Eggs.xml in your VCS ignores?