Installing Spring Python

Spring Python is easy to install. It comes with two installable tar balls. One is the core library itself. The other is a set of samples you can optionally install to help get a better understanding of Spring Python. As it is written in pure Python, the installed files are the source code as well, so you can see how Spring Python works.

Note

This installation section does NOT show how to install all the parts needed to develop patches for the Spring Python project. For more information on setting up a developer's environment, please join the Spring Python mailing list at http://lists.springsource.com/listmanager/listinfo/springpython-users where you can ask about current development requirements.

Setting up an environment for Spring Python

Installing Spring Python currently requires Python 2.4, 2.5, or 2.6. It can also be run on Jython 2.5. At the time of this writing, it hasn't been extended to support Python 3 due to lack of backwards compatibility and immaturity. However, as Python 3 gains acceptance in the user community, Spring Python will move to support it as well.

Spring Python makes it easier to integrate with certain 3rd party libraries. Installation of those 3rd party libraries is not covered in this book. For example, to write queries against an Oracle database, you need to install the cxora package.

Installing from a pre-built binary download

The binaries are hosted as tar balls by SpringSource, in the community section. They are non-OS specific and should work on any platform.

  1. Go to http://www.springsource.org/download/community. You can either fill out the registration information, or simply click on the link to take you to the download site
    Installing from a pre-built binary download
  2. Click on Spring Python to see the latest version:
    Installing from a pre-built binary download
  3. Download springpython-<release>.tar.gz to get the core library
  4. Unpack the tarball, and go to the directory containing setup.py
  5. Type the following command to install Spring Python

    Note

    Note: This step may require admin privileges!

    $ python setup.py install
    
    
  6. You should now be able to test the installation.
$ python
>>> import springpython
>>> dir()
['__builtins__', '__doc__', '__name__', 'springpython']

Installing from source

Spring Python can be installed from source code like many other open source projects. The code is hosted on a subversion repository. The following steps will help you download the code and install it on your machine:

  1. Type the following command to checkout the latest trunk repository:
    $ svn checkout https://src.springframework.org/svn/ se-springpython-py/trunk/springpython springpython
    
    

    This will create a local directory springpython containing the latest changes.

  2. Move in to the directory where build.py is located. This script serves as the key tool to build, package, and test Spring Python. Type the following command to generate an installable Spring Python package:
    $ ./build.py -package
    
    
  3. Move to target/artifacts, the directory containing the newly generated tar balls.
  4. Unpack the tar ball springpython-<release>.tar.gz, and go to the directory containing setup.py and type the following command to install Spring Python:

Note

Note: This step may require admin privileges.

$ python setup.py install

  1. You should now be able to test the installation.
$ python
>>> import springpython
>>> dir()
['__builtins__', '__doc__', '__name__', 'springpython']

  1. Using the subversion repository to fetch source code sets you up to easily install new updates.
  2. Type the following command to update your checkout.
    $ svn update /path/for/springpython
    
    
  3. Repeat the steps with build.py, target/artifacts, and setup.py.

Tip

Official releases are found in the tags section of the subversion repository, adjacent to the trunk.

Note

You can also visually inspect the code using SpringSource's Fisheye viewer at https://fisheye.springframework.org/browse/ se-springpython-py. This provides a way to view the code, change sets, and change logs as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.71.21