jenkins.plugins.shiningpanda.interpreters
Class Virtualenv

java.lang.Object
  extended by jenkins.plugins.shiningpanda.interpreters.Python
      extended by jenkins.plugins.shiningpanda.interpreters.Virtualenv

public class Virtualenv
extends Python


Constructor Summary
Virtualenv(hudson.FilePath home)
          Constructor using fields
 
Method Summary
 boolean buildout(hudson.Launcher launcher, hudson.model.TaskListener listener, Workspace workspace, hudson.FilePath pwd, hudson.EnvVars environment, String buildoutCfg, boolean useDistribute)
          Bootstrap BUILDOUT and start its binary.
 boolean create(hudson.Launcher launcher, hudson.model.TaskListener listener, Workspace workspace, hudson.FilePath pwd, hudson.EnvVars environment, Python interpreter, boolean useDistribute, boolean systemSitePackages)
          Create this VIRTUALENV
 void delete()
          Delete this VIRTUALENV
 Map<String,String> getEnvironment(boolean includeHomeKey)
          Get the environment for this interpreter.
 hudson.FilePath getExecutable()
          Get the PYTHON executable.
static String getSignature(Workspace workspace, Python interpreter, boolean useDistribute, boolean systemSitePackages)
          Get a virtual environment signature.
 hudson.FilePath getSignatureFile()
          Get the signature file path.
 boolean isOutdated(Workspace workspace, Python interpreter, boolean useDistribute, boolean systemSitePackages)
          Check if this VIRTUALENV is out dated.
 boolean isValid()
          Check if this is a valid interpreter.
 Virtualenv isVirtualenv()
          Is this a VIRTUALENV?
 boolean pipInstall(hudson.Launcher launcher, hudson.model.TaskListener listener, Workspace workspace, hudson.FilePath pwd, hudson.EnvVars environment, String packageName)
          Install a package with PIP.
 boolean tox(hudson.Launcher launcher, hudson.model.TaskListener listener, hudson.FilePath pwd, hudson.EnvVars environment, String toxIni, boolean recreate)
          Call TOX.
 
Methods inherited from class jenkins.plugins.shiningpanda.interpreters.Python
fromHome, getEnvironment, getHome, isCPython, isIronPython, isJython, isPyPy, isUnix, isWindows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Virtualenv

public Virtualenv(hudson.FilePath home)
           throws IOException,
                  InterruptedException
Constructor using fields

Parameters:
home - The home folder
Throws:
InterruptedException
IOException
Method Detail

isValid

public boolean isValid()
                throws IOException,
                       InterruptedException
Description copied from class: Python
Check if this is a valid interpreter.

Overrides:
isValid in class Python
Returns:
true if this is a valid interpreter
Throws:
IOException
InterruptedException

getEnvironment

public Map<String,String> getEnvironment(boolean includeHomeKey)
                                  throws IOException,
                                         InterruptedException
Description copied from class: Python
Get the environment for this interpreter.

Specified by:
getEnvironment in class Python
Parameters:
includeHomeKey - If true, add home variable such as PYTHONHOME
Returns:
The environment
Throws:
IOException
InterruptedException

getExecutable

public hudson.FilePath getExecutable()
                              throws IOException,
                                     InterruptedException
Description copied from class: Python
Get the PYTHON executable.

Specified by:
getExecutable in class Python
Returns:
The executable file if exists, else null
Throws:
IOException
InterruptedException

isVirtualenv

public Virtualenv isVirtualenv()
Description copied from class: Python
Is this a VIRTUALENV?

Overrides:
isVirtualenv in class Python
Returns:
true if this is a VIRTUALENV, else false

isOutdated

public boolean isOutdated(Workspace workspace,
                          Python interpreter,
                          boolean useDistribute,
                          boolean systemSitePackages)
                   throws IOException,
                          InterruptedException
Check if this VIRTUALENV is out dated. It can be out dated if it does not exist, if it is not valid, or if the signature doesn't match the desired one.

Parameters:
workspace - The workspace
interpreter - The interpreter
useDistribute - True id use distribute, else false
systemSitePackages - True if include system packages, else false
Returns:
true if this VIRTUALENV is out dated, else false
Throws:
IOException
InterruptedException

getSignatureFile

public hudson.FilePath getSignatureFile()
Get the signature file path.

Returns:
The signature file path

delete

public void delete()
            throws IOException,
                   InterruptedException
Delete this VIRTUALENV

Throws:
IOException
InterruptedException

create

public boolean create(hudson.Launcher launcher,
                      hudson.model.TaskListener listener,
                      Workspace workspace,
                      hudson.FilePath pwd,
                      hudson.EnvVars environment,
                      Python interpreter,
                      boolean useDistribute,
                      boolean systemSitePackages)
               throws InterruptedException,
                      IOException
Create this VIRTUALENV

Parameters:
launcher - The launcher
listener - The listener
workspace - The workspace
pwd - The working directory
environment - The environment
interpreter - The interpreter
useDistribute - Use DISTRIBUTE or SETUPTOOLS?
systemSitePackages - Give access to the global site-packages directory
Returns:
true if creation was successful, else false
Throws:
InterruptedException
IOException

pipInstall

public boolean pipInstall(hudson.Launcher launcher,
                          hudson.model.TaskListener listener,
                          Workspace workspace,
                          hudson.FilePath pwd,
                          hudson.EnvVars environment,
                          String packageName)
                   throws InterruptedException,
                          IOException
Install a package with PIP.

Parameters:
launcher - The launcher
listener - The listener
workspace - The workspace
pwd - The working directory
environment - The environment
packageName - The package to install
Returns:
true if installation was successful, else false
Throws:
InterruptedException
IOException

tox

public boolean tox(hudson.Launcher launcher,
                   hudson.model.TaskListener listener,
                   hudson.FilePath pwd,
                   hudson.EnvVars environment,
                   String toxIni,
                   boolean recreate)
            throws InterruptedException,
                   IOException
Call TOX.

Parameters:
launcher - The launcher
listener - The listener
pwd - The working directory
environment - The environment
toxIni - The tox.ini file
recreate - If true recreate the environments
Returns:
true if TOX was successful, else false
Throws:
InterruptedException
IOException

buildout

public boolean buildout(hudson.Launcher launcher,
                        hudson.model.TaskListener listener,
                        Workspace workspace,
                        hudson.FilePath pwd,
                        hudson.EnvVars environment,
                        String buildoutCfg,
                        boolean useDistribute)
                 throws InterruptedException,
                        IOException
Bootstrap BUILDOUT and start its binary.

Parameters:
launcher - The launcher
listener - The listener
workspace - The workspace
pwd - The working folder
environment - The environment
buildoutCfg - The BUILDOUT configuration file
useDistribute - Use DISTRIBUTE instead of SETUPTOOLS
Returns:
true if setup was successful, else false
Throws:
InterruptedException
IOException

getSignature

public static String getSignature(Workspace workspace,
                                  Python interpreter,
                                  boolean useDistribute,
                                  boolean systemSitePackages)
                           throws IOException,
                                  InterruptedException
Get a virtual environment signature.

Parameters:
workspace - The workspace
interpreter - The interpreter
useDistribute - Use distribute package
systemSitePackages - Use system packages
Returns:
The signature
Throws:
IOException
InterruptedException


Copyright © 2004-2012. All Rights Reserved.