Skip to content

Commit e8622fe

Browse files
committed
fix(README): replace relative imports with absolute imports in quickstart
The quickstart examples used relative imports (e.g., `from .activities`) which fail when scripts are run directly with the error "attempted relative import with no known parent package".
1 parent 1138ff2 commit e8622fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ from temporalio import workflow
164164

165165
# Import our activity, passing it through the sandbox
166166
with workflow.unsafe.imports_passed_through():
167-
from .activities import say_hello
167+
from activities import say_hello
168168

169169
@workflow.defn
170170
class SayHello:
@@ -184,8 +184,8 @@ from temporalio.client import Client
184184
from temporalio.worker import Worker
185185

186186
# Import the activity and workflow from our other files
187-
from .activities import say_hello
188-
from .workflows import SayHello
187+
from activities import say_hello
188+
from workflows import SayHello
189189

190190
async def main():
191191
# Create client connected to server at the given address
@@ -220,7 +220,7 @@ import asyncio
220220
from temporalio.client import Client
221221

222222
# Import the workflow from the previous code
223-
from .workflows import SayHello
223+
from workflows import SayHello
224224

225225
async def main():
226226
# Create client connected to server at the given address

0 commit comments

Comments
 (0)