Class UvLockParser

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

public class UvLockParser extends Object
Parses uv.lock files (TOML format) to extract resolved dependency information.
  • Constructor Details

    • UvLockParser

      public UvLockParser()
  • Method Details

    • findAndParse

      public static List<PythonResolutionResult.ResolvedDependency> findAndParse(Path pyprojectDir, @Nullable Path boundary)
      Find and parse a uv.lock file, walking up from the given directory.
      Parameters:
      pyprojectDir - the directory containing pyproject.toml
      boundary - the boundary to stop searching at (typically relativeTo)
      Returns:
      list of resolved dependencies, or empty list if no uv.lock found
    • hasAlternativeLockFile

      public static boolean hasAlternativeLockFile(Path startDir, @Nullable Path boundary)
      Check whether a poetry.lock or pdm.lock file exists near the given directory.
    • parse

      public static List<PythonResolutionResult.ResolvedDependency> parse(String content)
      Parse uv.lock content into a list of resolved dependencies.