[Pydev-code] PyDev PYTHONPATH settings don't expand Eclipse variables
Brought to you by:
fabioz
From: Davidson, J. <jos...@lm...> - 2011-12-16 23:20:25
|
Whoops, guess I'm not a member of the users' list. -----Original Message----- From: Davidson, Josh Sent: Friday, December 16, 2011 4:09 PM To: pyd...@li... Subject: PyDev PYTHONPATH settings don't expand Eclipse variables I am aware that the recommended way to add another project's source folder within a workspace to a project's PYTHONPATH is to use the Project References section of the project properties. This is pretty slick (uses the referenced project's source folders) when dealing with pure Python projects and I think this should continue to work as-is. However, if you are working with mixed CDT/Python projects where the CDT projects have more than one build configuration, you can't do this. The reasons are somewhat convoluted, but suffice it to say, you don't want to use Project References with CDT (CDT provides its own project references configuration for this very reason). Anyways, what needs to happen in this scenario is to not use the built-in Project References and instead set the PYTHONPATH via the" PyDev - PYTHONPATH" configuration. However, if I open the ExternalLibraries tab and attempt to add a project's source directory using Eclipse variables like {workspace_loc} or ${WorkspaceDirPath} (this is really a CDT variable) the variables aren't expanded and I get an "Invalid external source folder specified" error. If I add the project's source directory using the "Add source folder" option, it will work, but it leaves the absolute path in the project configuration, breaking the portability of the project. I have seen other plugins automatically substitute ${workspace_loc} for portions of an absolute path that match the project's workspace. So in summary, PyDev isn't doing anything wrong. However, it really should resolve Eclipse variables in the External Libraries tab of PyDev - PYTHONPATH. Thanks, Josh |