Class PythonDependencyParser

java.lang.Object
org.openrewrite.python.internal.PythonDependencyParser

public class PythonDependencyParser extends Object
Extracts dependency metadata from a parsed pyproject.toml AST (Toml.Document).
  • 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 document
      relativeTo - the base path (used as the path field in the marker)
      Returns:
      the marker, or null if the document has no [project] section
    • parsePep508

      public static @Nullable PythonResolutionResult.Dependency parsePep508(String spec)