Thursday, September 24, 2009

Building python projects on VPS currently use CentOs 5.2 and python 2.4. Here's my worklog for getting python2.6 projects to build with nose on my hudson server hosted by

Here's the result:


CentOS system setup and python installation

Install yum

Install yum from the eApps PBA Control Panel. Then
yum update

Install rpmbuild

yum install rpm-build
# accept the keys
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

Install python 2.4 devel package

yum install python-devel

Install python 2.6

You can use pre-built CentOS python 2.6 RPMs or build from source. I chose the former:

rpm -i python26-2.6-geekymedia1.i386.rpm python26-libs-2.6-geekymedia1.i386.rpm python26-devel-2.6-geekymedia1.i386.rpm

Installing easy_install

Building from src RPM fails

I tried to install the spec file, but this failed

mkdir /usr/src/redhat # otherwise you get error: cannot create %sourcedir/usr/src/redhat/SOURCES
rpm -Uvh setuptools-0.6c9-1.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bp setuptools.spec
+ python install --single-version-externally-managed --root=/var/tmp/setuptools-buildroot --record-rpm=INSTALLED_OBJECTS
usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: --help [cmd1 cmd2 ...]
or: --help-commands
or: cmd --help

error: option --record-rpm not recognized
error: Bad exit status from /var/tmp/rpm-tmp.30227 (%install)

Install from egg file

Find the packages here.
sh setuptools-0.6c9-py2.6.egg

Build setup and hudson configuration

I use nose for testing and report using its xunit plugin.

Install your python project dependencies

Make sure you install them into python 2.6 site-packages. If needed

ln -s /usr/bin/python26 python
export PATH=.:$PATH
# do something with python 2.6
# the clean up
rm python

You can now used easy_install whenever possible. For one of my projects, I installed:

Hudson config for python project

Here's hudson config for the newly created "free-style software project":

  • new Hudson custom build.
  • execute shell

    nosetests --with-xunit

  • Publish JUnit test result report

Voila !

No comments:

Post a Comment