PR 1/x for adding the sync surface for the new data client
This class adds ast transformers for converting existing async classes into sync copies.
The conversion works through the following phases:
generate.py is called with a path, and finds all Python files in all subdirectories
CrossSyncClassDecoratorHandler is called on each file, looking for any classes decorated with @CrossSync.export_sync
For all classes found, they are passed through:
CrossSyncMethodDecoratorHandler to look for any methods annotated with CrossSync decorators (CrossSunc.convert, CrossSync.drop_method, CrossSync.pytest, etc).
RmAioFunctions to strip out any asyncio keywords annotated with CrossSync.rmaio()
SymbolReplacer to replace CrossSync with CrossSync._Sync_Impl in the codebase, and other user-specified symbol transformatioons
Next PR will add annotations to existing code to guide transformations
PR 1/x for adding the sync surface for the new data client
This class adds ast transformers for converting existing async classes into sync copies.
The conversion works through the following phases:
generate.py
is called with a path, and finds all Python files in all subdirectoriesCrossSyncClassDecoratorHandler
is called on each file, looking for any classes decorated with@CrossSync.export_sync
CrossSyncMethodDecoratorHandler
to look for any methods annotated with CrossSync decorators (CrossSunc.convert
,CrossSync.drop_method
,CrossSync.pytest
, etc).RmAioFunctions
to strip out any asyncio keywords annotated withCrossSync.rmaio()
SymbolReplacer
to replaceCrossSync
withCrossSync._Sync_Impl
in the codebase, and other user-specified symbol transformatioonsNext PR will add annotations to existing code to guide transformations