Here's the result:
Prerequisites:
- a working (CentOs 5.2) hudson CI installation
- a python project hosted on a SCM that uses nose for its unit testing needs. See alternatives
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 setup.py install --single-version-externally-managed --root=/var/tmp/setuptools-buildroot --record-rpm=INSTALLED_OBJECTS
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py 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
**/nosetests.xml
Voila !
No comments:
Post a Comment