118 lines
4.0 KiB
Plaintext
118 lines
4.0 KiB
Plaintext
Setting up a development sandbox for :mod:`pyogp.lib.base`
|
|
==========================================================
|
|
|
|
In order to contribure code you first need be able to set it up.
|
|
We will first cover the prerequisites and will explain the actual process after that.
|
|
|
|
Prerequisites
|
|
-------------
|
|
|
|
|
|
You need to have the following things installed:
|
|
|
|
* `subversion <http://subversion.tigris.org>`_ (1.4.x is recommended right now)
|
|
* `Python <http://python.org/download/>`_ (2.5 is what we use, might work with 2.4)
|
|
* a development environment with a C/C++ compiler (you can try without but it might fail)
|
|
|
|
.. note:: subversion 1.5.x was tried, and it gave errors such as "unrecognized .svn/entries format" and
|
|
"log not found". We suggest using svn 1.4.x. Also, if you use TortoiseSVN, use the 1.4.x version
|
|
as well. Finally, it seems that these steps need to be done in order, but that is not fully confirmed.
|
|
You might try the `libdev_mac` buildout though as this should work with subversion 1.5.
|
|
|
|
|
|
Mac specific requirements
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
make sure you have X-Code installed
|
|
|
|
Installing ``easy_install`` and ``virtualenv``
|
|
**********************************************
|
|
|
|
In order to install Python Packages and creating a development sandbox you have to do the following:
|
|
|
|
1. Download ez_setup.py and run it with your Python interpreter. You can find it here:
|
|
http://peak.telecommunity.com/dist/ez_setup.py
|
|
|
|
Eventually you have to be root to do this depending on your system (mostly non-windows). It should look like this on a unix based machine::
|
|
|
|
wget http://peak.telecommunity.com/dist/ez_setup.py
|
|
sudo python ez_setup.py
|
|
|
|
|
|
2. Install ``virtualenv`` like this::
|
|
|
|
easy_install virtualenv
|
|
|
|
or if you need to be root something like this::
|
|
|
|
sudo easy_install virtualenv
|
|
|
|
on Windows, you may need a different path to ``easy_install``::
|
|
|
|
c:\Python25\Scripts\easy_install.exe virtualenv
|
|
|
|
Getting the buildout
|
|
********************
|
|
|
|
We use zc.buildout to automatically setup a development environment. buildout gives you the ability to install packages only locally instead of your global python installation. It's sort of a local python installation which helps you avoiding version conflicts of packages.
|
|
|
|
|
|
First check out the buildout into a directory of your choice::
|
|
|
|
svn co http://svn.secondlife.com/svn/linden/projects/2008/pyogp/buildouts/libdev/trunk/ libdev
|
|
|
|
If you are using svn1.5 or have otherwise problems on Mac OSX, try this buildout instead::
|
|
|
|
svn co http://svn.secondlife.com/svn/linden/projects/2008/pyogp/buildouts/libdev_mac/trunk/ libdev
|
|
|
|
It needs Python2.5 though (which is the standard Python version of Mac OSX though)
|
|
|
|
Now turn this directory into a virtual python environment which is independant of your normal Python installation::
|
|
|
|
cd libdev
|
|
virtualenv . --no-site-packages
|
|
|
|
on Windows, you may need to specify the path::
|
|
|
|
c:\Python25\Scripts\virtualenv.exe . --no-site-packages
|
|
|
|
Now run the bootstrap.py file with the newly created local Python interpreter::
|
|
|
|
bin/python bootstrap.py
|
|
|
|
or on Windows::
|
|
|
|
Scripts\python bootstrap.py
|
|
|
|
This creates a bunch of directories and the bin/buildout script (bin\buildout.exe on windows). We now run this::
|
|
|
|
bin/buildout -v
|
|
|
|
or on Windows::
|
|
|
|
bin\buildout.exe -v
|
|
|
|
The development sandbox is ready. There now is a bin/pyogp which is a python interpreter which contains all the installed packaged and the pyogp library and related projects.
|
|
|
|
Run the tests
|
|
-------------
|
|
|
|
Run the tests by simply saying::
|
|
|
|
bin/client_unittest
|
|
|
|
Hopefully they all pass.
|
|
|
|
Using the login example
|
|
-----------------------
|
|
|
|
To test this installation you can (at least at this stage of the project) try the following::
|
|
|
|
bin/login <firstname> <lastname>
|
|
|
|
Give your Avatar name and it will ask for a password. Then it tries to login using the Linden Lab Agent Domain and placing the avatar on a different's grid region. You need to be in the gridnauts group though.
|
|
|
|
.. note:: Agents used in testing need to be in the gridnauts group in sl.
|
|
|
|
|