Skip to content

Commit 0adef5e

Browse files
committed
fix from import
1 parent 52d627e commit 0adef5e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

livekit-protocol/generate_proto.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ find "$API_OUT_PYTHON" -maxdepth 1 -name '*.py' -o -name '*.pyi' | xargs perl -i
105105
# fix logger imports for files in subdirectories (need parent-relative import)
106106
find "$API_OUT_PYTHON" -mindepth 2 -name '*.py' -o -name '*.pyi' | xargs perl -i -pe 's|from logger import options_pb2 as ([^ ]+)|from ..logger_pb import options as $1|g'
107107

108-
find "$API_OUT_PYTHON"/agent_pb -name '*.py' -o -name '*.pyi' | xargs perl -i -pe 's|from agent import livekit_agent_(\w+)_pb2 as ([^ ]+)|from . import agent_$1 as $2|g'
108+
# fix `from agent import agent_xxx as xxx` to `from . import agent_xxx as xxx`
109+
find "$API_OUT_PYTHON"/agent_pb -name '*.py' -o -name '*.pyi' | xargs perl -i -pe 's|from agent import (agent_\w+) as ([^ ]+)|from . import $1 as $2|g'
109110

110111
# fixes - error: ClassVar can only be used for assignments in class body [misc]
111112
perl -i -pe 's|^(\w+_FIELD_NUMBER): _ClassVar\[int\]|$1: int|g' "$API_OUT_PYTHON/logger_pb/options.pyi"

0 commit comments

Comments
 (0)