26 comments:

Anonymous
said...

I'm currently using Aptana Studio 3 Nightly which comes with PyDev 2.7.0. I'd love to update to PyDev 2.7.5, but do not want to uninstall Aptana Studio because it provides a bunch of other features I like. Tried to uninstall both and install Aptana without PyDev, but I always get some dependency conflicts.

I think Aptana (Accelerator) should either remove PyDev completely from its own downloads, or they should include your latest version. The current state is quite unfortunate.

Firstly, thanks for such a nice Python plugin. I've used PyDev for quite a few things, and this plugin with the integration with PyUnit is very useful.

I'm trying to write a plugin that will involve listening for PyUnit tests. Would you know how to be able to trigger an action after PyUnit tests have finished running? I've tried importing PydevPlugin and calling PydevPlugin.getDefault().addTestListener(), but addTestListener is not defined for PydevPlugin (although I've seen some pages on the web that say PydevPlugin.java has that function like here: http://eclipse-pydev.sourcearchive.com/documentation/1.0.3-1ubuntu1/PydevPlugin_8java-source.html). Is there another way to do it?

You're looking at an ancient version of PyDev. For up-to-date versions, you can check the code at: https://github.com/fabioz/Pydev

Now, I've taken a look at the current implementation and it does not provide a hook for you.

Right now, on org.python.pydev.debug.ui.launching.PythonRunner.run(PythonRunnerConfig, ILaunch, IProgressMonitor), it creates a PyUnitServer (which is the object you'd like to add a listener to -- its interface is: org.python.pydev.debug.pyunit.IPyUnitServer) but registers it directly to the PyUnit view.

After taking a look at it, I added a way for you to listen to it (see org.python.pydev.debug.ui.launching.PythonRunner.onPyUnitServerCreated). Note that this is still not on a build... if you try tomorrow, it'll be in the nightly build -- if you want, you can get the code and build locally (this is on the development branch -- see: http://pydev.org/developers.html for getting the code and running it there).

I will wait for a nightly build. I did pull down the latest code from Git and saw the comment on how to create an ICallbackListener in PythonRunner - that was very helpful. I'll let you know how it goes once I get the nightly build with this change.

Two more questions:I also needed to know the final result of all the unit tests (whether 1 or more failed or all passed). I did this by doing a string comparison on arg0 of the overridden "notifyTest" function in the ICallbackListener call function. If any of them said "fail", that means at least one unit test failed. Otherwise, all unit tests passed.

I think that achieves my purpose, but is there any way for me to get the PyUnitTestResult within the ICallbackListener? If not, that's fine - this definitely works; it just may not be as efficient as it could be. It also has the potential to break if a unit test failure prints out text that doesn't include the word "fail" in it in a future version of PyDev.

Also, will these code changes be in the next major release of PyDev, and do you know when that next revision will be released (or generally when non-nightly revisions get released)?

Thanks again for your support. It was really quick and definitely helped a lot.

In looking at the code coverage files, there doesn't seem to be any public way through code that can set the files to get coverage for and to view the coverage results - is this correct? If so, would you be open to allowing some of those methods to be public in order for other plug-ins to be able to use that coverage information?

Regarding the Django templates editor, for now you have to choose between aptana studio which has a django templates editor (but with an old version of PyDev) or within getting a newer version of PyDev.

I'm on the process of creating an improved Django Templates Editor, that does not rely on Aptana Studio 3, but it's still not available.

I'm creating a TDD compliance plug-in for Python in Eclipse. That's why I needed a unit test listener - I needed to know when unit tests were run and the result - whether they all passed or at least one unit test failed. Now knowing whether or not I have 100% test coverage would be extremely helpful in knowing whether the developer is keeping in line with TDD principles or not. For example, if a developer runs unit tests with 100% coverage, modified production code, then ran unit tests with < 100% coverage, they didn't add unit tests first, and they aren't being compliant with TDD principles.

Hello!I have been using this plugin for a few months and recently, Google changed the App Engine code and I can no longer use PyDev as a Debugger. Have you guys heard of this? If so, do you know when a fix will be planned?

Hello Fabio,Are you updating the current releases?I have found a small fix for release 2.7.5 and would like to contribute with it.

Is there any possibility that after this change will be checked and reviewed, you will update the download link with improved releaseAlso I am looking for the repository/branch for 2.7.5.Thank youThank you

As for updating an existing release, at this point, I'd be supporting PyDev 2.8.x with critical releases (as that's the latest version that supports java versions < 7) and everything else should be on the latest version.

So, ideally it'd be better if your fix would go into the mainline (in the latest release). Otherwise you'd have to support that fork there -- or have some kind of corporate sponsorship for PyDev to add work based on an older version.