Last Site Update: 01 August 2008 | Latest Version: 1.3.19

 
 
 
Home
Features
Roadmap
Screenshots
Download
Getting started
Credits
More info
FAQ / BUGS
Developers Guide
pydev-code List
Users Forum
Blog: Pydev Adventures
Hosted at
PyDev at Sourceforge
Donate
Sponsored by
 
Want a better PyDev? Why not give a small donation? (paypal)

Developers Guide

This page shows how to effectively get up and running with the pydev code.

Getting the code

The first thing you probably want to do in order to code in pydev is getting its code. As pydev is an Eclipse plugin, the whole process will be explained based on the Eclipse infrastructure (this was written for the sdk version 3.1).

Pre-requisites: Eclipse SDK 3.1 and Java 5.0

Before getting the code, there's an important step you need to make: Change your java 'compiler compliance-level' to 5.0. To do this, go to window > preferences > Java > compiler and change that setting from 1.4 to 5.0.

The steps to get the code are:

1. Open the cvs repositories view (window > show view > cvs > cvs repositories)

2. Right-click the view and choose new > repository location and fill:
  • host: pydev.cvs.sourceforge.net
  • repository path: /cvsroot/pydev
  • user: anonymous
  • password: this field should be left empty
  • connection type: pserver

As pointed in the image below (note that the host changed):



And click Finish

3. You should now have that repository added to your cvs repositories, so, expand it 2 levels: the root and the head (assuming you want to get the latest version), select the 11 folders marked in the image below, right-click it and choose check out (the other folders are 'deprecated').



By doing so, Eclipse should automatically grab all the sources from the cvs into your workspace and let the whole structure ready for you to begin coding pydev.

After you do that, you'll probably note that the tests did not compile successfully. This is because there are some settings that will depend on your installation, and this settings are stored in a class that holds that info (which you'll have to create). There is a 'template' for that file in the cvs at: org.python.pydev.core/TestDependent.template. You should create a copy of that file in that same dir named TestDependent.java and set the needed things according to your installation. If there is still something that does not compile, it may mean that:
  • The cvs is not properly synched across the developers and non-developers (yes, it takes some time for that to happen)
  • There is something missing in that TestDependent.java file because it is not synched with all the dependencies (if so, just add the needed variable to it)
  • The head does not compile in the cvs -- if you believe that is the case, send an e-mail to the pydev-code list at sourceforge to know what's happening.

Where to start?

Ok, this may be the most difficult thing... especially because answers may change a lot depending on what you want to do, so, below are outlined 2 different approaches:

  • Extending Pydev with Jython: recommended if you want to add some editor-related action or something that does not need implementing some Eclipse extension-point.
  • Extending Pydev in Java: if you want something that won't map to an action, this might be the better way to go.
To start in any of those approaches it might be worth taking a look at some Eclipse documentation, to try to grasp some of its concepts. One of the finest documentations for that is the Eclipse FAQ.

If you want to take the Jython approach, check out this article on how to do jython scripting in pydev

And that's it. If you have further doubts about how to code in pydev, direct your questions to the pydev-code list at sourceforge.

Contributing back

If you do some change at pydev that you want to contribute back to the main trunk, you should create a patch and attach it to a bug in the sourceforge tracker with the title: [PATCH] description of the patch

Creating a patch: To create a patch, you should go to the package explorer, right-click the project you made changes to (if you changed more than one project, send a file with the changes to each project) and choose team > create patch. You should then follow the steps provided by the wizard. The most important thing is that you choose the Unified diff output.





NOTE 1: Diffs do not work well for binary files, so, if you made some change to some image, please attach the changed image itself, pointing the complete location to the image when attaching it to the bug.

NOTE 2: If you did some whole new script that use the 'jython scripting in pydev' infrastructure, you do not need to create a patch. Just attach the script itself to the bug.