java.lang.Object
de.iip_ecosphere.platform.tools.maven.python.PythonUtils

public class PythonUtils extends Object
Some generic python process helper functions. For now taken over to keep this plugin on Java 8.
Author:
Holger Eichelberger, SSE
  • Field Details

    • DEFAULT_PYTHON_EXECUTABLE

      public static final File DEFAULT_PYTHON_EXECUTABLE
    • pythonExecutable

      private static File pythonExecutable
  • Constructor Details

    • PythonUtils

      public PythonUtils()
  • Method Details

    • setPythonExecutable

      public static void setPythonExecutable(File exec)
      Defines the (global) Python executable.
      Parameters:
      exec - the executable, may be null for dynamically determined
    • getPythonExecutable

      public static File getPythonExecutable()
      Returns the Python executable. We consider the following precedences:
      1. Local python3 in Linux Jenkins installation (for testing, although this is production code; with installation path)
      2. Local python3 in default Linux installation ("/usr/bin", with installation path)
      3. The global python executable setPythonExecutable(File) (with installation path)
      4. The command "python"
      Returns:
      the executable, returns at least "python"; the result may be an absolute path but must not be. Calling File.getAbsolutePath() on the result may be misleading - if required, use it as string.
    • getPythonExecutable

      public static File getPythonExecutable(String pythonBinary)
      Returns the Python executable. We consider the following precedences:
      1. Local python3 in Linux Jenkins installation (for testing, although this is production code; with installation path)
      2. Local python3 in default Linux installation ("/usr/bin", with installation path)
      3. The global python executable setPythonExecutable(File) (with installation path)
      4. The command "python"
      Parameters:
      pythonBinary - explicitly given path to python binary
      Returns:
      the executable, returns at least "python"; the result may be an absolute path but must not be. Calling File.getAbsolutePath() on the result may be misleading - if required, use it as string.