This plugin adds Python support to Jenkins with some useful builders (Python builder, virtualenv builder, tox builder...) and the ability to use a Python axis in multi-configuration projects (for testing on multiple versions of Python).
To configure Python installations, step in
Manage Jenkins > Global Tool Configuration. Then look for the
To configure a new Python installation click on
Add Python, then fill
the following fields:
Name: the name of this Python installation, make it meaningful by including the Python's version for example.
Home or executable: the path to the root folder of the Python installation (CPython, PyPy, Stackless Python, Jython or IronPython) or the path to the Python executable, such as:
/opt/local/Library/Frameworks/Python.framework/Versions/2.7on MacOS X (MacPorts).
A good practice is to install raw Pythons and then use the
Virtualenv Builder to setup your execution environment.
Five builders dedicated to Python:
Virtualenv Builder(recommended): creates an isolated environment with virtualenv,
Buildout Builder: use Buildout to build your project,
Tox Builder: use tox to build your project, only available for Jenkins multi-configuration projects,
Python Builder: use a Python installation configured on Jenkins via
Manage Jenkins > Global Tool Configuration > Python,
Custom Python Builder: use an arbitrary Python installation, typically a manually created virtualenv environment.
One publisher dedicated to Python:
Publish coverage.py HTML reports: this publisher aims at displaying HTML reports generated by the coverage package.
Have you configured some Python installations in the
Python section of
Manage Jenkins > Global Tool Configuration page?
See this blog post.
- Support pip's requirements.txt in virtualenv builders (thanks @myusuf3 for the idea).
- Ease PyLint code analysis (and associated reporting).
- Improve coverage reporing.
- Automate installation of Pythons.
- Your idea here... contact us!
- Bundle virtualenv 16.0.0
- Do not use
- Bundle virtualenv 15.0.2
Toxaxis default environments
- Bundle virtualenv 13.1.2 (JENKINS-30068, JENKINS-27551),
- Fix JENKINS-28428: coverage 4 renames status.dat to status.json.
- Bundle virtualenv 1.11.6,
- Remove package manager selector on
- Remove hosted mode.
- Fix JENKINS-18415: can't run shining panda jobs on Jenkins 1.519.
- Bundle virtualenv 1.9.1.
- Copyright 2013.
- Bundle virtualenv 1.8.4.
path to executable is now allowed in the
Homefield of a Python installation,
- Configurable ShiningPanda working directory,
- Bundle virtualenv 1.8.2.
- Bundle virtualenv 1.7.2,
Buildout Builder: bootstrap.py of zc.buildout 2 always uses distribute.
- Fix help.
- Add IronPython support,
- Switch from Affero GPL to something we could call a Lesser Affero GPL (see here),
- Fix path to Jython 2.2.1 executable.
- Bundle the development branch of virtualenv (22.214.171.124.post1@e299c87a1b9a63fcc2c3279cef3bf42e14ba0d32) to include PyPy and Jython fixes for Windows,
- Fix the path to the binary of a PyPy based virtualenv on Windows in
configuration file not set when calling
- Improve the
Virtualenv Buildercleanup algorithm to avoid useless virtual environment creations,
- Move virtual environments generated by the
$JENKINS_HOME/shiningpandato avoid deletions caused by full checkouts, as a consequence the
Virtualenv homefield becomes a
Virtualenv Builderwith the same
Namewill use the same virtual environment installation,
- Fix the workspace addition in the
- Add a
Custom Python Builderto specify the type of the
Commandfield. In addition to shell (
Shellnature), you can now type some Python with the
Pythonnature, and some shell commands translated at runtime to match the targeted platform (variables, separator, ...) with the
- Add a coverage.py HTML report publisher,
- Add a
TOXENV patternfield to the
Tox Builderto compute the test environment (an alternative to
- Detect Python installations in standard locations at first launch,
- Unable to submit job configuration if only
Custom environmentsfield is used in
Toxaxis (Mantis 12),
- In specific cases the Python version was still asked in Virtualenv Builder and Python Builder on multi-configuration projects (Mantis 14),
- Create symbolic links to Python shared libraries in
$VIRTUAL_ENV/libon Unix (see virtualenv 216),
- Copyright 2012.
- Embed virtualenv 1.7 including pull request #193.
- As a consequence,
No site packagesbecomes
System site packages(with the opposite value) for
- Fix a 0.4 to 0.5 backward compatibility bug on Python installations.
- Virtualenv is no more required in Python installations.
- Windows support.
- Jython support.
Custom Virtualenv Builderbecomes
Custom Python Builderand handles now any kind of Python installation.
Standard Python Builderbecomes
- Full path to Python executable available via
PYTHON_EXEenvironment variable in
Pythonaxis displayed as a tree on shiningpanda-ci.com.
- Adding ability to pass
--no-site-packagesto virtualenv (thanks @amcfague).
- Add an explicit option on builders with
Commandto ignore non-zero exit code (previously done by specifying an header, which are now ignored).
- Whitespace characters are not allowed in Python names (as they are used to create the workspace path in multi-configuration projects).
- Make the build fail if there a some whitespace characters in
User-defined Axisvariables in all builders (multi-configuration projects).
- PyPy support.
If you want to run ShiningPanda plugin tests, ensure that you're on UNIX
and that following environment variables are not set:
You'll also need some Python installations:
- a CPython 2 installation,
- a CPython 3 installation,
- a PyPy installation,
- a Jython installation.
To declare them, create a new property file by copying the template (only if template's configuration does not match your environment):
cp src/test/resources/test.properties.model src/test/resources/test.properties
test.properties and modify the following entries:
CPython.2.Home: CPython 2's home folder (
CPython.3.Home: CPython 3's home folder (
PyPy.Home: PyPy's home folder,
Jython.Home: Jython's home folder (
You can also provide these values via command line:
To run all the tests:
mvn clean install
To run a test:
And to debug one (with Eclipse for instance):
mvn -Dmaven.surefire.debug -Dtest=jenkins.plugins.shiningpanda.TestVirtualenvBuilder
For those developing on Eclipse, its test runner is not compatible with Jenkins's base test case. You'll need to run tests via command line.
And if you just want to check that everything is working for the
just have a look on our continuous integration