On Tuesday 09 March 2010 17:59:02 Giovanni Gherdovich wrote: hello,
sorry for the late answer, I was not here last week. I came across your problem a long time ago; actually, I believe that it worked the right way when I started working on Pyreverse last year, but it got somewhere broken while merging it to Pylint... However we don't see it in our tests, for some reason I had no time to understand: take a look at pylint/test/data : classes_No_Name.dot __init__.py suppliermodule_test.py clientmodule_test.py packages_No_Name.dot where the expected output classes_No_Name.dot is correctly produced during the test, but not when we work directly with pyreverse. > Sylvain Thénault wrote: > > I think you've spotted it: relative import. IIRC by default > > pyreverse only display on the diagram classes which are coming > > from the same package. The pb is probably that due to the relative > > import (and potentially a bad python path), pyreverse think both > > classes don't belong to the same package. > > I don't know how to check this. I think, you should look in astng/manager.py to the 'project_from_files' method, where I can read (l.261) : # insert current working directory to the python path to have a correct # behaviour sys.path.insert(0, os.getcwd()) This doesn't seem to work anymore ... or is it line 297 in the same method : finally: sys.path.pop(0) ? I hope this helps :) don't go into _ast ! The problem should be somewhere around astng vs pyreverse . > > Are you launching pyreverse from withing the package directory > > you're asking pyreverse to analyze? > > Yes. > > > Also you should probably use absolute import > > anyway, pylint should have told you relative import are bad ;) > Relative import does not seem to be the problem: when I go to pylint/test and do $ pylint data I get no 'relative import' complain. However, Pyreverse still does not get the 'associated' and 'ancestors' relations. So, don't hesitate if you have further questions. -- Emile Anclin <emile.anc...@logilab.fr> http://www.logilab.fr/ http://www.logilab.org/ Informatique scientifique & et gestion de connaissances _______________________________________________ Python-Projects mailing list Python-Projects@lists.logilab.org http://lists.logilab.org/mailman/listinfo/python-projects