Hi. Pydev is great, but I can't use it because of a very simple limitation. :(
When I check out a working copy of a project here, *some* libraries are sym-linked from a central library location (Products below) to different locations within the same svn checkout;
| |-- ATContentTypes
| `-- ...
| |-- ATContentTypes -> ../Plone/ATContentTypes
| |-- BSWBSkins
| `-- ...
Normally I'd just add the Products directory to the PYTHONPATH and python can do this as though both were equal,
from Products.ATContentTypes.public import *
from Products.BSWBSkins.skins import *
This method of linking within subversion is essential (and reccommended by the subversion docs) for version control of third party packages.
However in the situation above, there is no way to get all the libraries into the code intelligence database because some of the libraries have symlinks and the code intelligence database, configured by the pydev project PYTHONPATH setting, doesn't like symlinks.
For me this kills pydev - code checking and code navigation all fail and pydev becomes and editor not an ide.
A solution (as in the faq) to manually copy the files to the library path (Products) is just not realistic. I'm constantly checking out and in multiple projects everyday and starting an application server (zope) on them.
So my quesiton; as python or other ide's such as Komodo do not have problemts with sym-links on unix systems, why does PyDev have such a fundamental limitation? Is there any liklihood this will be fixed? I'd really like to use pydev. Presumably some unix and windows specifc code could be inserted to recognise the obvious importance of syn-links and junctions? <:)
You can use links in the Eclipse style (and create a link for a location).
Now, the actual pydev limitation is that the folders that you use to do the link must be the EXACT same folders that you put as source folders (that's the default way for Eclipse to handle this -- at least from what I see).
There is a bug to address this issue at http://sourceforge.net/tracker/index.php?func=detail&aid=1461125&group_id=85796&atid=577329
This limitation is because Java has no support for handling symlinks (altough you could probably do some compiled module to handle it, I find that the way Eclipse handles it should be good enough).
Just to make the example perfectly clear;
In PyDev/Eclipse, bswb is the "source folder" linked to the filesystem, and Products will be a python module that we use (from Products.ATContentTypes import ...):
`-bswb (folder linked to filesystem)
On Disk we have;
bswb (linked to eclipse)
| `---ATContentTypes -> ../Plone/ATContentTypes
As you can see, it is the *subdirectory* "ATContentTypes" of a python module (Products) which does not resolve for "from Products.ATContentTypes...".
However "from Products.BSWBSkins..." works fine.
I suspect that this is slightly different to the current understanding no?
Yeap, as I said, symlinks do NOT work, so, as you're using one symlink at
`---ATContentTypes -> ../Plone/ATContentTypes
it will not be resolved (that's why from Products.BSWBSkins works and the other one doesn't)
Now, it should work if you did an 'eclipse folder link' at that place, but because of the bug that I mentioned before, pydev (currently) does not work, because it only accepts links at the source folder.
Now, one thing occured to me... instead of making a symlink, wouldn't it be possible to 'mount' that location? I believe java should work if you did it instead of making a symlink...
Strange - the link name in the example above (ATContentTypes) *is* the same as the destination folder base name (../Plone/ATContentTypes).
But still the modules are not resolved properly for Products.ATContentTypes...
Maybe there are two separate issues? Maybe I have not understood your response correctly.
Thanks for the clarification. Both these solutions are overly restrictive for my scenario (running code from an svn check-out without ide-dependent changes).
What functionality do you need in java for handling sym links? Just move and delete? Are these not provided when the sym links are presented as standard files to java?
Well, symlinks are simply not presented in the java filesystem abstraction. Maybe you could try talking to the Eclipse guys and see if they would add symlinks to their filesystem abstraction (but I find that quite hard to happen too).
And for me... well, I wouldn't go and do my own filesystem abstraction anyway (but if eclipse or java presents it to me, I'd surely use it).