script-python-executable-path

--script-python-executable-path is a global parameter for the Liquibase Checks extension. It specifies the path Liquibase uses to run the Python executable associated with a virtual environment.

Uses

By default, Liquibase runs Custom Policy Checks using the built-in Python virtual environment bundled with the Liquibase Checks extension JAR. A virtual environment isolates the Python libraries you install for a particular project. This prevents conflicts with other projects, which might use different versions of modules in those libraries.

However, the built-in Python virtual environment only comes with a few external modules. If you want to install additional modules, or if you want your IDE to recognize the Liquibase Python modules, you have to create your own virtual environment.

Once you create your custom virtual environment, you can use the --script-python-executable-path parameter to specify the path to the Python executable for that environment. This tells Liquibase to use your custom virtual environment to execute Python scripts while running Policy Checks Commands.

For more information, see Create a Python Virtual Environment.

Syntax

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file (defaults file)
liquibase.script.python.executablePath: <string>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: checks run
        globalArgs: { script-python-executable-path: "<string>" }
Global CLI parameter
liquibase
 --script-python-executable-path=<string> checks run
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.script.python.executablePath=<string>
Liquibase Environment Variables
LIQUIBASE_SCRIPT_PYTHON_EXECUTABLE_PATH=<string>

For more information, see Working with Command Parameters.

Related links