Class UvLockRegeneration

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

public class UvLockRegeneration extends Object
Utility for regenerating uv.lock files by running uv lock in a temporary directory.
  • Constructor Details

    • UvLockRegeneration

      public UvLockRegeneration()
  • Method Details

    • regenerate

      public static UvLockRegeneration.Result regenerate(String pyprojectContent)
      Regenerate a uv.lock file from the given pyproject.toml content.
      Parameters:
      pyprojectContent - the pyproject.toml content to lock
      Returns:
      a result containing the new lock file content, or an error message
    • regenerate

      public static UvLockRegeneration.Result regenerate(String pyprojectContent, @Nullable String existingLockContent)
      Regenerate a uv.lock file from the given pyproject.toml content. When an existing lock file is provided it is seeded into the working directory so that uv lock performs a minimal update rather than re-resolving every dependency from scratch.
      Parameters:
      pyprojectContent - the pyproject.toml content to lock
      existingLockContent - the current uv.lock content, or null
      Returns:
      a result containing the new lock file content, or an error message