restlib uses what is becoming a pretty standard and a quite simple toolset.
You can clone the repo over http via git through the following command::
$ git clone git://gitorious.org/restlib/mainline.git
PEP 0008 is used as the base for the style in this project. Above and beyond the standard style guide the following is required:
- file names housing python code are always lowercase
- classes are always CamelCase or, if it is an acronym, all UPPERCASE
- Every file containing code has the standard copyright information at the top
- Every file containing code has docstrings at the top, class, and method/function levels
- Classes and functions have two empty newlines in between them
- methods have one empty newline between them
- Place imports in the scope they belong in
- Try to avoid * imports
- variables at the global scope must be in ALLCAPS
I recommend the following in your .git/info/exclude:
*.pyc *.pyo *.pidaproject MANIFEST apidocs dist *.swp
The best way to develop on restlib is to branch feature sets. For instance, if you were to add xml deserialization you would want to branch locally and work on that branch.:
$ git branch * master $ git status # On branch master nothing to commit (working directory clean) $ git branch xmldeserialization $ git checkout xmldeserialization
Now we pretend you are all finished and have done at least one commit to the xmldeserialization branch.:
$ git-format-patch master 0001-created-initial-classes.patch 0002-added-in-documentation.patch $
You now have patch sets which you can send in for perusal and acceptance. You can submit them via email. If you are interested in working directly on the project then submitting a few patches is the place to start. If, for some reason, you are unable to attach patches to the ticket system you can email the patches to
the user steve at the domain restlib dot(.) org.
The tests for restlib require twisted packages to be installed. If you are missing a package it will let you know like so::
$ ./setup.py test running test cannot import name server You seem to be missing one ore more required dependencies. Please install twisted.web.server, twisted.web.resource and twisted.internet.reactor. Please note that these dependencies are only needed in testing. $
Running the test suite is as simple as running setup.py test. The results look like::
$ ./setup.py test running test test_logger_level (tests.test_logger.TestGetRestlibLogger) ... ok test_logger_name (tests.test_logger.TestGetRestlibLogger) ... ok test_rest__do_allowed_types (tests.test_rest.TestREST) ... 2008-06-11 22:40:13,728 ERROR REST: BREAK was not in the list of valid type. ok test_rest_http_delete (tests.test_rest.TestREST) ... ok test_rest_http_delete_with_params (tests.test_rest.TestREST) ... ok test_rest_http_get (tests.test_rest.TestREST) ... ok test_rest_http_get_with_params (tests.test_rest.TestREST) ... ok test_rest_http_post (tests.test_rest.TestREST) ... ok test_rest_http_post_with_params (tests.test_rest.TestREST) ... ok test_rest_http_put (tests.test_rest.TestREST) ... ok test_rest_http_put_with_params (tests.test_rest.TestREST) ... ok test_rest_init (tests.test_rest.TestREST) ... ok ---------------------------------------------------------------------- Ran 12 tests in 0.049s OK $