Hello Emile,

Thank you very much for you answer to this old thread
(about 3 months ago)
http://lists.logilab.org/pipermail/python-projects/2010-March/002272.html

about pyreverse failing in getting associated class
relations right.

I missed your mail since I don't check often the list.

I'd like to know if there is anything new on this
issue, i.e. if in the new pylint release it has
been fixed (I run an old 0.18 pylint).

Unfortunately I am a bit busy at the moment and cannot
do debugging any soon, in the case your ticket
is still active here
https://www.logilab.net/elo/ticket/9542
(I can't access it, I need some password)

Sorry for this my (very) late answer.

Cheers,
Giovanni

Emile Anclin wrote:
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.

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to