Package org.openrewrite.python.rpc
Class PythonRewriteRpc
java.lang.Object
org.openrewrite.rpc.RewriteRpc
org.openrewrite.python.rpc.PythonRewriteRpc
public class PythonRewriteRpc
extends org.openrewrite.rpc.RewriteRpc
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PythonRewriteRpc.Builderbuilder()static @Nullable PythonRewriteRpcget()static PythonRewriteRpcStream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, @Nullable Path relativeTo, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory.Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory.Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory.static voidResets the cached state of the current Python RPC instance.static voidsetFactory(PythonRewriteRpc.Builder builder) voidshutdown()static voidMethods inherited from class org.openrewrite.rpc.RewriteRpc
batchSize, generate, getLanguages, getMarketplace, getObject, livenessCheck, log, parse, prepareRecipe, prepareRecipe, print, print, print, print, reset, send, timeout, traceGetObject, visit, visit
-
Method Details
-
get
-
getOrStart
-
setFactory
-
shutdown
public void shutdown()- Overrides:
shutdownin classorg.openrewrite.rpc.RewriteRpc
-
shutdownCurrent
public static void shutdownCurrent() -
resetCurrent
public static void resetCurrent()Resets the cached state of the current Python RPC instance. This clears all parsed objects and references on both the Java and Python sides, preventing memory accumulation across multiple parse operations.Call this between tests or after batch operations that don't need to share state.
-
parseProject
public Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory. Discovers and parses all relevant source files.- Parameters:
projectPath- Path to the project directory to parsectx- Execution context for parsing- Returns:
- Stream of parsed source files
-
parseProject
public Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory. Discovers and parses all relevant source files.- Parameters:
projectPath- Path to the project directory to parseexclusions- Optional glob patterns to exclude from parsingctx- Execution context for parsing- Returns:
- Stream of parsed source files
-
parseProject
public Stream<org.openrewrite.SourceFile> parseProject(Path projectPath, @Nullable List<String> exclusions, @Nullable Path relativeTo, org.openrewrite.ExecutionContext ctx) Parses an entire Python project directory. Discovers and parses all relevant source files.- Parameters:
projectPath- Path to the project directory to parseexclusions- Optional glob patterns to exclude from parsingrelativeTo- Optional path to make source file paths relative toctx- Execution context for parsing- Returns:
- Stream of parsed source files
-
builder
-