Package org.openrewrite.python
Class ChangeDependency
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.ScanningRecipe<org.openrewrite.python.ChangeDependency.Accumulator>
org.openrewrite.python.ChangeDependency
- All Implemented Interfaces:
Cloneable
public class ChangeDependency
extends org.openrewrite.ScanningRecipe<org.openrewrite.python.ChangeDependency.Accumulator>
Change a dependency to a different package in pyproject.toml.
Searches all dependency arrays in the document (no scope restriction).
When uv is available, the uv.lock file is regenerated to reflect the change.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.python.ChangeDependency.AccumulatorgetInitialValue(org.openrewrite.ExecutionContext ctx) org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> getScanner(org.openrewrite.python.ChangeDependency.Accumulator acc) org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> getVisitor(org.openrewrite.python.ChangeDependency.Accumulator acc) Methods inherited from class org.openrewrite.ScanningRecipe
clone, generate, generate, getAccumulator, getVisitorMethods inherited from class org.openrewrite.Recipe
addDataTable, builder, buildRecipeList, causesAnotherCycle, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions
-
Constructor Details
-
ChangeDependency
public ChangeDependency()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getInstanceNameSuffix
- Overrides:
getInstanceNameSuffixin classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getInitialValue
public org.openrewrite.python.ChangeDependency.Accumulator getInitialValue(org.openrewrite.ExecutionContext ctx) - Specified by:
getInitialValuein classorg.openrewrite.ScanningRecipe<org.openrewrite.python.ChangeDependency.Accumulator>
-
getScanner
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getScanner(org.openrewrite.python.ChangeDependency.Accumulator acc) - Specified by:
getScannerin classorg.openrewrite.ScanningRecipe<org.openrewrite.python.ChangeDependency.Accumulator>
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor(org.openrewrite.python.ChangeDependency.Accumulator acc) - Overrides:
getVisitorin classorg.openrewrite.ScanningRecipe<org.openrewrite.python.ChangeDependency.Accumulator>
-