← All recipes
Moderne licensed

Find deprecated Path.link_to() usage

Recipe IDorg.openrewrite.python.migrate.FindPathlibLinkToArtifactopenrewrite-migrate-python

Find usage of Path.link_to() which was deprecated in Python 3.10 and removed in 3.12. Use hardlink_to() instead (note: argument order is reversed). link_to is not a name reserved to pathlib, so this only reports calls whose receiver resolves to a Path; a parse without type attribution reports nothing.

Single recipepythonpathlibmigration3.12Proprietary

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.FindPathlibLinkTo

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python