Migrate backoff to tenacity
Recipe ID
org.openrewrite.python.migrate.MigrateBackoffToTenacityArtifactopenrewrite-migrate-pythonReplace backoff's retry decorators with tenacity's @retry, and add the tenacity dependency to exactly the projects where a decorator converted -- a project whose every decorator needs a hand migration gains no dependency, and neither does a repository this leaves unchanged. backoff itself stays, because a decorator tenacity cannot reproduce still needs it. Run org.openrewrite.python.migrate.FindBackoffDecoratorsNotMigrated for the decorators left to migrate by hand, then drop backoff once that list is empty.
Composite recipepythonbackofftenacitymigrationretryProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.python.migrate.MigrateBackoffToTenacityIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:RELEASE
mod config recipes jar install org.openrewrite:rewrite-python:RELEASEDefinition
This recipe runs the following recipes in order.
- Replace
backoffdecorators withtenacityorg.openrewrite.python.migrate.ReplaceBackoffDecoratorsWithTenacity - org.openrewrite.python.AddDependency
org.openrewrite.python.AddDependency