Sunday, June 28, 2009

Testing on Pydev 1.4.7 & IronPython

Pydev 1.4.7 is now ready to be tested for a new release (watch for the nightly build with svn version 2834 -- http://pydev.blogspot.com/2009/02/pydev-nightly-builds.html )

One of the major features in this release is the IronPython integration. Note that it requires IronPython 2.6 (earlier versions are not supported because of the lack of sys._getframe()).

In that integration, code-completion should be working for the .NET libraries and other dlls. For the .NET libraries, just make sure that the library you're using is listed in the forced builtins ( http://fabioz.com/pydev/manual_101_interpreter.html ) -- I believe all libraries should be there already, but it could be that some default library is missing.

To use code-completion for other libraries, the code must be compiled as a dll (because Pydev does not recognize C# nor VB) and that dll must have the exact same name of the namespace it contains (e.g.: if you want to do "import iTextSharp", the dll must be named iTextSharp.dll -- the case of the file important there) and the folder containing that dll must be added as a source folder (or external source folder) -- which is the same thing for python compiled extensions.

Most features should be working fine with IronPython, with the most notable exception being that the debugger is not supported (that's because in this version, IronPython still doesn't provide sys.settrace(), so, there's no API to work on for python debugging).

Other niceties were also added in this release:

  • Ctrl+F9 (which was previously a run as jython) now executes a run as unit-test based on the project type, providing an interface where the user can filter which tests should be run, and F9 which was a run-as python is now a run as current project type -- so, it works for python, jython and ironpython projects).

  • Pydev Extensions context-insensitive completions are shown for any token which cannot be determined by the type inference engine (previously it did that only for method parameters) -- and the number of chars for showing those completions can be customized (by default, 2 chars are required).