← All recipes
Moderne licensed

Migrate backoff to tenacity

Recipe IDorg.openrewrite.python.migrate.MigrateBackoffToTenacityArtifactopenrewrite-migrate-python

Replace 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.MigrateBackoffToTenacity

If 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:RELEASE

Definition

This recipe runs the following recipes in order.