On the internet it is easy to find several references on how to use Jenkins-ci in combination with python.
But most of the blogs that you can find depend on an ‘older’ module called SetEnv. This module does not exists anymore.
But the bright side of this all is, that there is a new module that can be used with the name ShiningPanda Plugin
This plugin does allow you to make a virtualenv environment to install the dependent modules is e.g. using pip. The setup of this module is done by choosing Virtualenv Builder
as the buildstep of the project.
Any code written in the dialog box
below with the name: Command will be executed in the virtualenv environment. The commands that I issue are:
pip install -r pip-requires.txt
nosetests --with-xunit
This does also mean that I include a file pip-requirements.txt in the version control software which lists all the modules that are needed for this project to work.
I hope that this information is helpful for those that want to use the power of jenkins for python development.
Using nosetests
with the --with-xunit
means that a junit compatible xml file will be generated. This file can be parsed by jenkins when using **/nosetests.xml
as the junit input file in the Post-Build action step.