Hello Sylvain,

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.

> 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 ;)

I put my working directory in my $PYTHONPATH, and
now pyreverse behave as expected (the imports are now absolute :-),
i.e. the class diagram produced wrt the sample code
in my previous mail is

http://www-sop.inria.fr/members/Giovanni.Gherdovich/tmp/right_diagram.png

instead of

http://www-sop.inria.fr/members/Giovanni.Gherdovich/tmp/wrong_from_pyreverse_src.png

Well, I agree that relative imports might be a bad practice,
but I use pyreverse to analyse code which isn't necessarily
well written.

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

Reply via email to