rope
rope copied to clipboard
goto definition misses package with common namespace in a different egg
In the attached example, we have two packages, in two different eggs, sharing a common namespace:
- base.one (in egg //one//)
- base.two (in egg //two//)
We configured the ropeproject to include both their directories in the python_path by adding to src/.ropeproject/config.py:
def set_prefs(prefs):
(...)
prefs.add('python_path', '/home/mazza/work/bug_ropemacs/one')
prefs.add('python_path', '/home/mazza/work/bug_ropemacs/two')
Then, in the module //sample.py//, that imports both //one// and //two//, we try the operation "go to definition" (in emacs //M-x rope-goto-definition//) on each of them. But it only works for the first one added to //python_path//
For the config.py lines above, //rope-goto-definition// will only work over //one//. If you swap the lines in config.py:
def set_prefs(prefs):
(...)
prefs.add('python_path', '/home/mazza/work/bug_ropemacs/two')
prefs.add('python_path', '/home/mazza/work/bug_ropemacs/one')
then //rope-goto-definition// will only work over //two//.
Note:
In the attached source tar, you should change the absolute paths for packages "one" and "two" in the files:
- bug_ropemacs/src/sample.py
- bug_ropemacs/src/.ropeproject/config.py
(I filed the bug here and not in ropemacs, because I feel it to be related to rope itself.)
http://mcepl.fedorapeople.org/tmp/bug_ropemacs.mazza-laptop.2012-03-25.1947.tar
If my experiment is correct, rope does not support using eggs. This was the reason for me classifying this as a bug with major priority.
I took the time to try to reproduce the bug precisely. If the attached source doesn't help, please let me know.