Package org.openrewrite.python.internal
Class UvLockRegeneration
java.lang.Object
org.openrewrite.python.internal.UvLockRegeneration
Utility for regenerating uv.lock files by running
uv lock in a temporary directory.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UvLockRegeneration.Resultregenerate(String pyprojectContent) Regenerate a uv.lock file from the given pyproject.toml content.static UvLockRegeneration.Resultregenerate(String pyprojectContent, @Nullable String existingLockContent) Regenerate a uv.lock file from the given pyproject.toml content.
-
Constructor Details
-
UvLockRegeneration
public UvLockRegeneration()
-
-
Method Details
-
regenerate
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 thatuv lockperforms a minimal update rather than re-resolving every dependency from scratch.- Parameters:
pyprojectContent- the pyproject.toml content to lockexistingLockContent- the current uv.lock content, ornull- Returns:
- a result containing the new lock file content, or an error message
-