Difference between revisions of "PyOGP Client Library Development Sandbox"

From Second Life Wiki
Jump to navigation Jump to search
Line 131: Line 131:


Here's a simple setup that Enus likes:
Here's a simple setup that Enus likes:
: cd ~
cd ~
: mkdir sandbox
mkdir sandbox
: cd sandbox
cd sandbox
: virtualenv . --no-site-packages
virtualenv . --no-site-packages
: cd ~
cd ~
: mkdir hg
mkdir hg
: cd hg
cd hg
: hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.apps/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.apps/
: hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.base/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.base/
: hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.client/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.client/
: cd pyogp.lib.base
cd pyogp.lib.base
: ~/sandbox/bin/python setup.py install
~/sandbox/bin/python setup.py install
: cd pyogp.lib.client
cd pyogp.lib.client
: ~/sandbox/bin/python setup.py install
~/sandbox/bin/python setup.py install
: cd pyogp.apps
cd pyogp.apps
: ~/sandbox/bin/python setup.py install
~/sandbox/bin/python setup.py install


You now have all the source, plus a sandbox, for tinkering with pyogp!
You now have all the source, plus a sandbox, for tinkering with pyogp!

Revision as of 13:16, 3 May 2010

We will first run down the general explanation and add platform specific notes later.

Note

We're migrating to Mercurial... Please check back soon for updated docs.

PyOGP package install instructions need some work... stay tuned. Feel free to follow the buildout directions to use the Subversion repositories for now.

Repositories

Need some work before they are ready as installed packages. In the meantime, just add the path to "pyogp.{package}" to your PYTHONPATH to use the libs, assuming you have the other dependencies.

Needs updates to work:

Defunct until someone picks them up and fixes them:

Browse the Code

If all you want to do is glance at the source code, use the bitbucket source browser:

Prerequisites

You must have the following installed:

  • Mercurial - 1.3 or greater
  • Python 2.4.4, 2.5.x (fails on 2.6 currently and untested on 3.0)

Note: Snow Leopard upgrades require a reinstall of XCode, in this case to accommodate gcc (and greenlet).

Note: Buildout does not yet support subversion 1.6, only 1.4.4-1.5.x.

Environment Preparation

Setuptools and easy_install are Python standard means for installing modules. For more info, start here: http://pypi.python.org/pypi/setuptools.

Virtualenv is a method which allows you to create isolated Python environments, separate from your base install if you so prefer. For more, see here: http://pypi.python.org/pypi/virtualenv.

Your distribution may have Python's setuptools and virtualenv packages in its package repository. If so, it is probably best to use your normal package installation procedures (see below for information on specific Linux distributions). If the packages are not available then follow these generic instructions.

Generic *nix distribution

In order to install Python Packages and creating a development sandbox you have to do the following:

easy_install

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
 -or-
curl -O tp://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py

virtualenv

One may choose to create an isolated python instance on your host, to be able to work with PyOGP without installing packages to your base Python install on your host.

To use a dedicated python installation in your host, 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

setup.py

Grab the source files for each of the pyogp repos, and install them to a virtualenv instance (see above for installing virtualenv if you don't have it)..

Here's a simple setup that Enus likes:

cd ~
mkdir sandbox
cd sandbox
virtualenv . --no-site-packages
cd ~
mkdir hg
cd hg
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.apps/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.base/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.client/
cd pyogp.lib.base
~/sandbox/bin/python setup.py install
cd pyogp.lib.client
~/sandbox/bin/python setup.py install
cd pyogp.apps
~/sandbox/bin/python setup.py install

You now have all the source, plus a sandbox, for tinkering with pyogp!

Run the tests

See PyOGP_Client_Library#Pyogp_Unit_Tests for details...

The structure of the sandbox

You now might wonder what all those directories are good for. To learn more about this check out the Filesystem Structure