csc302h — engineering large software systems — winter 2014

motivation

technically, you don't need anything other than a text editor and a python interpreter to do your assignments in this course, but i for one want something better! i took wingware's wing101 python ide for a test drive, but personally, i prefer eclipse for doing development. in this howto, i will guide you through the steps necessary to install eclipse, and the pydev plugin for eclipse, and create a pydev project from your matplotlib repo on cdf.


install eclipse

go to eclipse.org and download the latest version of eclipse built for your operating system version. installation instructions are operating system specific so i'll leave those up to you.

at the time of writing, the current version of eclipse is 4.3 (a.k.a. kepler). i installed the mac os x 64-bit version on my 15" macbook pro.

eclipse kepler


install the pydev plugin for eclipse

first, launch eclipse however you launch applications on your chosen os. we will be installing the pydev plugin using the pydev update site url. detailed instructions can be found here, but i will also outline the steps below. i always use eclipse's iinternal mechanism for installing plugins available via the help menu. if you are also an experienced eclipse plugin installer all you'll need is the url:

http://pydev.org/updates
and away you go. for the less experienced, follow these steps:
  1. in eclipse, open help > install new software...

  2. in the work with: box, paste the url from above, then select pydev
  3. paste url & select pydev plugin

  4. click next >, follow the prompts, accept the license agreement, click finish, check the box beside the certificate, etc.

  5. restart eclipse when it prompts you
at the time of writing this howto, the current version of the pydev plugin for eclipse was 3.3.3.201401272249. at this point, you should have the pydev plugin for eclipse installed, but not quite ready to use. we still need to configure it to use a python interpreter.


configuring a python interpreter for pydev

to configure a python interpreter for pydev, perform the following steps:

  1. open the eclipse preferences dialog by selecting the preferences... menu item

  2. expand pydev > interpreters > python interpreter

  3. click the button labeled quick auto-config
configure a python interpreter
clicking the quick auto-config causes the default python interpreter on your system to be selected for use with pydev. if you have more than one python interpreter on your system, you can click on advanced auto-config to select between them. the default interpreter version on my system is 2.7 which is the same as on cdf, so you should try to use that version as well. for further assistance, click here for an outdated manual page.


creating an eclipse/pydev project for matplotlib

finally, on to the good stuff! the first step towards creating an eclipse/pydev project from your git repo is to clone your repo. check out this howto for a refresher on cloning your group's git repo.

once you have cloned your group's repo, follow these steps to create an eclipse/pydev project from it:

  1. right-click in an empty area in package explorer and select new > project...

  2. in the new project dialog, expand pydev, select pydev project and click next >
  3. created a new pydev project

  4. in the pydev project dialog, under project contents:, uncheck use default

  5. click browse... and browse to & select your matplotlib folder

  6. name your project matplotlib (or whatever else you like)

  7. under interpreter configuration, i select don't configure PYTHONPATH because i only use eclipse for editing...more on this in a minute
  8. configuring & your matplotlib project

  9. click finish and voila! you have an eclipse/pydev project for your matplotlib repo
if you are prompted by eclipse to open the pydev perspective, say yes as this will enable all the fancy features of pydev. you probably also want to open the outline view so you can see a list of all the imports, variables, functions, classes & members defined in your matplotlib python source files. to open the outline view, select window > show view > outline. your project should now look something like this:
matplotlib with eclipse & pydev


final notes

this is the point at which i will stop. as i mentioned earlier, i only use eclipse as an editor. i do all my git'ing, building, and running from the command-line. that doesn't mean that you have to though. please feel free to extend this by not stopping here. try using eclipse-git integration (looks like you get this out-of-the-box now). try doing other fancy things, and share them with the rest of the class.

for me, having syntax highlighting, auto-complete, and "live" static code analysis to flag errors as i edit is good enough. to make the static analyzer even more "live" save your file often, it runs as soon as you save.

hope some of you found this helpful.