Class JpyConfigFromSubprocess

java.lang.Object
io.deephaven.jpy.JpyConfigFromSubprocess

public final class JpyConfigFromSubprocess extends Object
  • Constructor Details

    • JpyConfigFromSubprocess

      public JpyConfigFromSubprocess()
  • Method Details

    • getPythonName

      public static String getPythonName()
      Find the "best" python name. If the system property "deephaven.python.name" is set, return it. Otherwise, if the environment variable "VIRTUAL_ENV" is set, return "${VIRTUAL_ENV}/bin/python". Otherwise, return "python3".
      Returns:
      the python name
    • fromSubprocess

      public static JpyConfigSource fromSubprocess(Duration timeout) throws IOException, InterruptedException, TimeoutException
      Equivalent to fromSubprocess(getPythonName(), timeout).
      Parameters:
      timeout - the timeout
      Returns:
      the jpy configuration, based on a python execution in the current environment
      Throws:
      IOException - if an IO exception occurs
      InterruptedException - if the current thread is interrupted while waiting for the command to execute
      TimeoutException - if the command times out
      See Also:
    • fromSubprocess

      public static JpyConfigSource fromSubprocess(String pythonName, Duration timeout) throws IOException, InterruptedException, TimeoutException
      Create the configuration based off of a python subprocess that introspects itself. The process will be executed based off of pythonName, which may be a path, or will otherwise be sourced from the environment PATH.
      Parameters:
      pythonName - the python command
      timeout - the timeout
      Returns:
      the jpy configuration, based on a python execution in the current environment
      Throws:
      IOException - if an IO exception occurs
      InterruptedException - if the current thread is interrupted while waiting for the command to execute
      TimeoutException - if the command times out