[Pydev-code] Is there a way to control how PyDev traverses the PYTHONPATH?
Brought to you by:
fabioz
From: R. G. <rg...@ao...> - 2014-10-24 06:41:48
|
Hi, before I ask my question, let me give you some background: I am working on a project whose source tree grew over many years (decades) and fundamental changes to the structure are more or less ruled out (not by me). This project also uses Python code and we are starting to use PyDev for development. The problem that we have is that on our development machines the package structure is different compared to our execution environment. The difference is that (for reasons that are not entirely clear to me) the packages on the development host contain symbolic links to other packages. That means, on the execution environment we only have lib/pkg1 lib/pkg2 lib/pkg3 ... but on the development machine we have lib/pkg1 lib/pkg1/pkg42 (is a sym link to lib/pkg42) lib/pkg1/pkg56 (is a sym link to lib/pkg56) lib/pkg1/pkg77 (is a sym link to lib/pkg77) lib/pkg2 ... It seems that PyDev (when analysing the PYTHONPATH) does a depth first search. So it goes into pkg1, finds pkgs 42, 56 and 77 as sub-packages of pkg1. Later, when it finds lib/pkg42, it seems to recognize that it already knows that package (it seems to identify that package via its physical path) and does ignore it. At least this is what we deduced from looking at the tree that is created in the PyDev package explorer. Due to this PyDev is utterly (and understandably) confused and we get a lot of false errors/warning (missing import etc). When we go and delete all symbolic links to other pkgs inside a pkg, PyDev works like a charm. However, deleting all those symbolic links is a massive change to the source tree and can have unknown side effect on other parts of our build infrastructure (it is a mixed language project). Now the question: Can we somehow tell pydev to NOT search for subpackages on the project specific PYTHONPATH? Would it be possible to make this configurable in a future PyDev version (like defining a max-depth for certain directories). The thing is, that the Python interpreter doesn't complain at all. It is "only" PyDev (but we admit it is not a PyDev bug) getting confused by the weird structure. Or maybe our analysis is wrong? best regards Robert |