Getting the Source

You will need to install a Mercurial client first.

On the command line

Once you have Mercurial, checkout the entire project:

$ hg clone https://hg.codeplex.com/csb CSB

This will create a project called "CSB" in the current directory. For committing any changes, you will also need to provide your CodePlex username and password.

Using Eclipse

Install the PyDev and MercurialEclipse plugins (you still need a separate Mercurial client, so don't skip that). Once you are done, checkout the entire project:

File / New / Project... / Mercurial / Clone Existing Mercurial Repository

In the URL field enter "https://hg.codeplex.com/csb" and use your CodePlex username and password.

Building

Use csb.build to build, test and package the entire project:

$ python csb/build.py -o <output directory>

Full details are provided here.

Testing

You should run the complete test suite before each commit. All CSB tests are executed with the csb.test.Console. To execute all tests:

$ python csb/test/app.py "csb.test.cases.*"

or just:

$ python csb/test/app.py         

To execute test suites for specific modules only:

$ python csb/test/app.py "csb.test.cases.module1.*" "csb.test.cases.module2"...

Run with "-h" for help. For more details on our test framework, including guidelines for writing
unit test, please refer to the API documentation, package csb.test.

Note: on python 2.6 make sure you have the unittest2 package.
You should also test the syntax of your docstrings before each commit:

$ epydoc --html -v -o /tmp --name CSB --fail-on-error --fail-on-warning --fail-on-docstring-warning csb

For convenience, you can run test.sh before pushing code to the repository to make sure that all test cases and docstring checks pass.

Methodology

We have embraced a Test-driven development (TDD) approach. That is, all new features and bug fixes must be accompanied by corresponding test cases in a subpackage of csb.test.cases. For more details on this topic please read the API documentation, package csb.test.

Style Guide

Compatibility

To ensure cross-interpreter compatibility, please write Python 3 compatible code. In the rare event that a given construct in Python 3 is not backwards compatible with Python 2.6, please ensure portability by following these guidelines:

Commit Messages

You should always provide a message for each commit. Commit comments should follow the general Mercurial guidelines:
Here is a sample commit comment:

Fixed issue #00010: SomeObject crashes with an exception for structures with no title

csb.bio.structure:
 - added a new Structure.xxxx property

csb.bio.io.wwpdb:
 - SomeObject will now check for empty titles

csb.test.cases.bio.io.wwpdb:
 - added regression tests	

Coding Style, Commenting and Formatting

Format your code using 4-spaces indentation (not tabs). In Eclipse just use Ctrl+Shift+F.
Your code should follow the PEP8 style guide strictly. Here is a summary:
Additional requirements:
Here is a code template:

"""
Module short summary.

Module multi-line description...
"""

import module1
import module2

from module3 import ObjectOne, ObjectTwo
from module4 import ObjectThree


class ClassName(object):
    """
    Class description...
    ... ends here.

    @param param_name: description
    @type param_name: L{SomeObject} or built-in (str, int, etc)
    """

    __metaclass__ = ABCMeta

    CONSTANT_NAME = value

    def __init__(self, param_name):
        self._private_field = None

    @property
    def property_name(self):
        """
        Description...
        """
        return self._private_field
    @property_name.setter
    def property_name(self, value):
        # validate value here...
        self._property_name = value

    def method_name(self, param_name)
        """
        Description...
        
        @param param_name: description
        @type param_name: L{SomeObject} or built-in (str, int, etc)

        @return: description of @rtype
        @rtype: L{SomeObject} or built-in (str, int, etc)
        
        @raise ExceptionName: condition
        """
        (body)

    @abstractmethod
    def abstract_method_name(self, param_name):
        """
        (docstring)
        """
        pass

    @staticmethod
    def static_method_name(param_name):
        """
        (docstring)
        """
        (body)