Package org.openrewrite.python.rpc
Class PythonRewriteRpc.Builder
java.lang.Object
org.openrewrite.python.rpc.PythonRewriteRpc.Builder
- All Implemented Interfaces:
Supplier<PythonRewriteRpc>
- Enclosing class:
PythonRewriteRpc
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the port for Python debugger to listen on.environment(Map<String, String> environment) get()marketplace(org.openrewrite.marketplace.RecipeMarketplace marketplace) metricsCsv(@Nullable Path metricsCsv) pipPackagesPath(@Nullable Path pipPackagesPath) Set the pip packages directory for recipe installations.pythonPath(Path pythonPath) Path to the Python executable.pythonVersion(String pythonVersion) Set the Python language version to parse.traceRpcMessages(boolean verboseLogging) workingDirectory(@Nullable Path workingDirectory) Set the working directory for the Python process.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
marketplace
public PythonRewriteRpc.Builder marketplace(org.openrewrite.marketplace.RecipeMarketplace marketplace) -
resolvers
public PythonRewriteRpc.Builder resolvers(List<org.openrewrite.marketplace.RecipeBundleResolver> resolvers) -
pythonPath
Path to the Python executable.- Parameters:
pythonPath- The path to the Python executable (e.g., "python3", "/usr/bin/python3")- Returns:
- This builder
-
timeout
-
log
-
metricsCsv
-
environment
-
traceRpcMessages
-
traceRpcMessages
-
debugPort
Set the port for Python debugger to listen on.- Parameters:
rewriteSourcePath- The path to the Python Rewrite source codedebugPort- The port for the debugger to listen on- Returns:
- This builder
-
workingDirectory
Set the working directory for the Python process.- Parameters:
workingDirectory- The working directory for the Python process- Returns:
- This builder
-
pipPackagesPath
Set the pip packages directory for recipe installations. When set, this directory will be added to PYTHONPATH and the openrewrite package will be automatically installed if not present.- Parameters:
pipPackagesPath- The directory where pip packages are installed- Returns:
- This builder
-
pythonVersion
Set the Python language version to parse.Supported values:
- "2" or "2.7" - Parse Python 2.7 code using parso
- "3" (default) - Parse Python 3 code using the standard ast module
- Parameters:
pythonVersion- The Python version to parse (e.g., "2", "2.7", "3")- Returns:
- This builder
-
get
- Specified by:
getin interfaceSupplier<PythonRewriteRpc>
-