Difference between revisions of "PyOGP Client Library Development Sandbox"

From Second Life Wiki
Jump to navigation Jump to search
Line 37: Line 37:
* Mercurial - 1.3 or greater
* Mercurial - 1.3 or greater
* Python 2.4.4, 2.5.x (fails on 2.6 currently and untested on 3.0)
* Python 2.4.4, 2.5.x (fails on 2.6 currently and untested on 3.0)
* pyopenssl http://sourceforge.net/projects/pyopenssl/files/pyopenssl-win/0.8a1/pyOpenSSL-0.8a1.winxp32-py2.5.msi/download (Windows 32-bit)


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


  wget http://peak.telecommunity.com/dist/ez_setup.py
  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
  sudo python ez_setup.py


Line 79: Line 80:
  c:\Python25\Scripts\easy_install.exe virtualenv
  c:\Python25\Scripts\easy_install.exe virtualenv


== Install methods ==
<!--
== Install method ==


Python modules can be installed in a variety of ways...
Python modules can be installed in a variety of ways... we're encouraging the virtualenv and setup.py method.


=== Install Method 1: buildout [Defunct] ===
=== Install Method 1: buildout [Defunct] ===
Line 123: Line 125:


Give your Avatar name and it will ask for a password. Then it tries to login to the Preview Grid.
Give your Avatar name and it will ask for a password. Then it tries to login to the Preview Grid.
-->
=== setup.py ===


=== Install Method 2: 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)..
 
How to check out packages and using them independently of buildout.
 
If you are comfortable, feel free to use setup.py (with or without a dedicated virtualenv) in any of the following repos:


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.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
: ~/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


Each of the repos already has eggs embedded, and pyogp.apps has the appropriate dependency on pyogp.lib.base configured, which can be checked out and installed in isolation.
You now have all the source, plus a sandbox, for tinkering with pyogp!
 
1.  Check out the repository of your choice
hg clone https://enus_linden@bitbucket.org/enus_linden/{pyogp package}/
 
2. Run setup.py
cd <your pyogp dir>
python setup.py install


== Run the tests ==
== Run the tests ==

Revision as of 14:15, 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