Package org.openrewrite.python.internal
Class PythonDependencyParser
java.lang.Object
org.openrewrite.python.internal.PythonDependencyParser
Extracts dependency metadata from a parsed pyproject.toml AST (Toml.Document).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable PythonResolutionResultcreateMarker(org.openrewrite.toml.tree.Toml.Document doc, @Nullable Path relativeTo) Create a PythonResolutionResult marker from a parsed Toml.Document.static @Nullable PythonResolutionResult.DependencyparsePep508(String spec)
-
Constructor Details
-
PythonDependencyParser
public PythonDependencyParser()
-
-
Method Details
-
createMarker
public static @Nullable PythonResolutionResult createMarker(org.openrewrite.toml.tree.Toml.Document doc, @Nullable Path relativeTo) Create a PythonResolutionResult marker from a parsed Toml.Document.- Parameters:
doc- the parsed pyproject.toml documentrelativeTo- the base path (used as the path field in the marker)- Returns:
- the marker, or null if the document has no [project] section
-
parsePep508
-