You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The Python action in Continua is a wrapper around the python.exe command line. If you're having trouble using the Python action, please refer to the Command Line Reference.

Python action is used to run python scripts, modules or commands.

Python

Working Folder

The working directory for the python command line. Leave blank to default to the workspace folder.

What To Run

Select what to run.

  • Script
  • Module
  • Command

Command Line Version

Select the version of the Python command line that is installed on the agent. Some other settings and options may be unavailable depending which the command line version is selected.

Use command line executable in virtual environment scripts folder if it exists.

If this is ticked and exists, the pip executable in the virtual environment scripts folder will be used instead.

Using 

The Using drop down is populated by any property collector properties whose namespace matches the pattern defined by the Python action. The pattern for this action is ^Python\..*. The default property collector searches the environment path for "python.exe".

If you create a property collector for this action, make sure you select the Path Finder PlugIn type and give it a name that will match the pattern above in blue. Example names listed here, search the table's Plugin column for "Pip".

For more in-depth explanations on property collectors see Property Collectors.

Alternatively, you can select the Custom option from the Using drop down list and specify a path in the resulting input field that will be displayed. Please read Why it's a good idea to use a property collector before using this option.


Script

Script

Path to a python script file, a directory containing a __main__.py file, or a zipfile containing a __main__.py file to run.

Arguments

List of arguments to be passed to the script. One per line.


Module

Module

The name of the module or package to run. [-m]

Arguments

List of arguments to be passed to the module. One per line.


Commands

Commands

Python code to be executed in command. One statement per line or separated by a ';' with significant leading white space as in normal module code. It is suggested that this method is used only when running simple commands. [-c]

Arguments

List of arguments to be passed to the command. One per line.


Settings

Run Python in isolated mode.

If this is ticked, Python is run in isolated mode. [-I]

Ignore all PYTHON* environment variables.

If this is ticked, all PYTHON* environment variables are ignored. [-E]

Don't add the user site-packages directory to sys.path.

If this is ticked, the user site-packages directory is not added to the sys.path. [-s]

Validation of Hash-Based .pyc Files

Slecetd the validaiton.

  • Default - 
  • Always - 
  • Never -

Code Optimisation

Select the type of code optimisation

  • No code optimisation
  • Re
  • Remove

Don't try to write .pyc files on the import of source modules

If this is ticked, 

Turn on hash randomisation

If this is ticked, 


Disable the import of the module site and the site-dependent manipulations of the sys.path that it entails.

If this is ticked, 

Force the stdout and stderr streams to be unbuffered,

If this is ticked, 

Skip the first line of the source.

If this is ticked, 

Implementation Specific Options

If this is ticked, 


Options

Verbosity

The amount of information detail to display in the build log. [-qqq | -qq | -q | -v]

Log File

The path to a verbose appending log file. [--log]

Disable the cache.

If this is ticked, the cache is disabled. [--no-cache-dir]

Cache Directory

The path to a directory to store the cache data. [--cache-dir]

Run pip in an isolated mode, ignoring environment variables and user configuration.

If this ticked, pip is run in an isolated mode, ignoring environment variables and user configuration. [--isolated]

Exists Action

Specify what to do if path already exists. [--exists-action]

  • SwitchOnly relevant to VCS checkout. Attempt to switch the checkout to the appropriate URL and/or revision. 
  • Ignore - Abort current operation (e.g. don’t copy file, don’t create archive, don’t modify a checkout).
  • Wipe - Delete the file or VCS checkout before trying to create, download, or checkout a new one.
  • BackupRename the file or checkout to {name}{'.bak' * n}, where n is some number of .bak extensions, such that the file didn’t exist at some point. So the most recent backup will be the one with the largest number after .bak.
  • Abort - Abort pip and return non-zero exit status.

Timeout (in seconds) 

How many seconds to wait for the action to finish before timing out. The default is 86400 seconds (24 hours).

Treat failure as warning

Tick to continue build on failure marking the action with a warning status.

Ignore warnings

If this is ticked, any warnings logged will not mark the action with a warning status.


Environment

Environment Variables

Multiple environment variables can be defined - one per line. These are set before the command line is run.

Log environment variables

If this is ticked, environment variable values are written to the build log. 

Generate system environment variables

Tick this checkbox to set up a list of new environment variables prefixed with 'ContinuaCI.' for all current system expression objects and variables.

Mask sensitive variable values in system environment variables

This checkbox is visible only if the 'Generate system environment variables' checkbox is ticked.

If this is ticked, the values of any variables marked as sensitive will be masked with **** when setting system environment variables. Clear this to expose the values.


  • No labels