Skip to content

General Development Instructions

kathi-fletcher edited this page Feb 27, 2013 · 1 revision

What you need to read

This page and the README on oerpub.rhaptoslabs.swordpushweb-buildout are the two most important guides for OERPUB development!

OS requirements

To get your own local instance of the OERPUB client you will need to set up your development environment and get the source code for the uploader from github.

  1. Have Ubuntu 10.04 or higher
  2. Install git with sudo apt-get install git-core
  3. Register a new account on github.com and follow github's instructions
  4. Create your development instance of the uploader, oerpub.rhaptoslabs.swordpushweb-buildout by following the instructions in the README With these steps you should now have your own local server which you can use for development. The readme describes how to update the code from github.

All source files are inside the src/ folder. You can modify and analyse them. In the following section we describe the usage of git and github to show how to contribute to code.

git basics

If you know git you do not need this instructions. If you are not familiar with git, get used to it!

Some good links to read:

git workflow

We use a simplified git flow - a successful Git branching model.

The difference is that we do not have a master and develop branch. Master and develop are the same on OERPUB and we have currently two release branches.

Bugs, features and projectmanagement

It's all on this site: redmine.oerpub.org

The first buildout

Please read README on oerpub.rhaptoslabs.swordpushweb-buildout !

Change existing code

To contribute to code you need to understand the structure of the source code.

The oerpub.rhaptoslabs.swordpushweb-buildout is the main repository. It builds and downloads all other git repositories. I will call them modules because each repository (oerpub.rhaptoslabs.xxx) has its own purpose.

To get an overview of all used modules look at the [sources] section inside buildout.cfg (readonly-access) or dev.cfg

If you want to change code, create a branch and then modify the buildout.cfg and dev.cfg to point on your own branch of the module. You can also find all modules in the src/ folder.

Add a new module to buildout and eggify new modules

For adding a new module to buildout you have to add an egg to the [pyramid] section and add the repository url to the [sources] section.

Place the readonly repository into buildout.cfg and the read-/write one into dev.cfg .

How to eggify source code

For creating eggs, the best way is to create an egg skeleton using paster, and then just place your code in the lowest-level directory.

Here's a chunk from my history file, where I installed zopeskel in a separate virtualenv to create the oerpub eggs:

cd instances/
mkdir test-zopeskel
cd test-zopeskel/
virtualenv --no-site-packages .
./bin/easy_install -U ZopeSkel
./bin/paster create --list-templates
./bin/paster create -t oerpub.rhaptoslabs.mynewshinymodule

Remove CONTRIBUTORS.txt and rename README.txt to README.rst. Do this also in setup.py. Set author, email and url in setup.py .

Very important: Do not forget to include the right license (GPL 3) and Licensing text for Shuttleworth Foundation (TODO: needed link to text)

Debugging code inside the pyramid web-framework (swordpushweb)

Add this two lines to your point of interest to get a python debug console:

import pdb;pdb.set_trace()
form.data