ted
ted

Reputation: 4975

Pyreverse(pylint) for Jython

I am trying to use pylint to generate uml diagramms for jython code. If I run it on plain python code, everything runs fine, however once I try to run it on code containing swing imports it crashes with an error message.

I am running pylint on python(!) in Jython it wont run (2.7.2a). How do I get pylint (in particular pyreverse) to run? currently It writes out all filenames and then fails (I suspect because it can't inspect the java pacakges (swing) how do I fix this?

Errormessage:

Traceback (most recent call last):   File "/usr/bin/pyreverse", line 4, in <module> main.Run(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/pylint/pyreverse/main.py", line 126, in __init__ PyreverseCommand(args)
File "/usr/lib/python2.7/dist-packages/pylint/pyreverse/main.py", line 98, in __init__ self.run(args)
File "/usr/lib/python2.7/dist-packages/pylint/pyreverse/main.py", line 112, in run diadefs = handler.get_diadefs(project, linker)
File "/usr/lib/python2.7/dist-packages/pylint/pyreverse/diadefslib.py", line 228, in get_diadefs diagrams = DefaultDiadefGenerator(linker, self).visit(project)
File "/usr/lib/python2.7/dist-packages/logilab/astng/utils.py", line 103, in visit self.visit(local_node)
File "/usr/lib/python2.7/dist-packages/logilab/astng/utils.py", line 100, in visit methods[0](node)
File "/usr/lib/python2.7/dist-packages/pylint/pyreverse/diadefslib.py", line 161, in visit_module self.linker.visit(node)
File "/usr/lib/python2.7/dist-packages/logilab/astng/utils.py", line 103, in visit self.visit(local_node)
File "/usr/lib/python2.7/dist-packages/logilab/astng/utils.py", line 100, in visit methods[0](node)   File "/usr/lib/python2.7/dist-packages/logilab/astng/inspector.py", line 257, in visit_from fullname = get_module_part(fullname)
File "/usr/lib/python2.7/dist-packages/logilab/common/modutils.py", line 334, in get_module_part
'explicit relative import, but no context_file?' AssertionError: explicit relative import, but no context_file?

Upvotes: 1

Views: 835

Answers (1)

sthenault
sthenault

Reputation: 15125

This is actually a bug not related to jython which has been recently fixed in logilab-astng's repository. This fix hasn't been released yet, in the mean time you can still use a mercurial checkout : http://hg.logilab.org/logilab/astng (default branch)

Upvotes: 1

Related Questions