Package io.deephaven.jpy
Class JpyConfigFromSubprocess
java.lang.Object
io.deephaven.jpy.JpyConfigFromSubprocess
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JpyConfigSource
fromSubprocess
(String pythonName, Duration timeout) Create the configuration based off of a python subprocess that introspects itself.static JpyConfigSource
fromSubprocess
(Duration timeout) Equivalent tofromSubprocess(getPythonName(), timeout)
.static String
Find the "best" python name.
-
Constructor Details
-
JpyConfigFromSubprocess
public JpyConfigFromSubprocess()
-
-
Method Details
-
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 tofromSubprocess(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 occursInterruptedException
- if the current thread is interrupted while waiting for the command to executeTimeoutException
- 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 ofpythonName
, which may be a path, or will otherwise be sourced from the environment PATH.- Parameters:
pythonName
- the python commandtimeout
- the timeout- Returns:
- the jpy configuration, based on a python execution in the current environment
- Throws:
IOException
- if an IO exception occursInterruptedException
- if the current thread is interrupted while waiting for the command to executeTimeoutException
- if the command times out
-