unasync icon indicating copy to clipboard operation
unasync copied to clipboard

Imports from _async module doesn't get converted to imports from _sync

Open anand2312 opened this issue 2 years ago • 1 comments

Imports from the _async module seem to be unaffected:

from library._async.module import AsyncFoo

gets converted to

from library._async.module import SyncFoo

Expected result:

from library._sync.module import SyncFoo

Currently working around it by exporting both the classes from a common place, but it'd be nice to have this work.

anand2312 avatar Sep 30 '23 14:09 anand2312

You can find examples of using the additional_replacements parameter of Rule to add custom replacements.

https://unasync.readthedocs.io/en/latest/#usage-outside-of-setuptools

This should allow you to achieve what you're after.

robsdedude avatar Dec 19 '23 13:12 robsdedude