Repository navigation
Conversation
The SDK's `Client` inherits the generated extension, so `temporalio.client` imports the generated package. A run-time import back made importing the package first a circular import. Co-authored-by: Tim Conley <timothy.conley@temporal.io>
The import cycle fix needs the same sample that the source fallback and the sync produce.
The import cycle fix builds on the source fallback. So it takes the `sequence` of `append` too.
The import cycle fix builds on the source fallback. So it takes the new sample comments too.
Owner
Author
|
Replaced by temporalio#409. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes a generated Python client module import
temporalio.clientonly for type checking.An SDK makes its
Clientclass inherit the generated client extension. Sotemporalio.clientimports the generated package while it is being imported itself, and the generated modules
imported
temporalio.clientback at module level. In sdk-python,import <generated>.clientbefore
import temporalio.clientthen failed with a circular import error.The generated modules use
temporalio.clientin annotations only, and each one starts withfrom __future__ import annotations. So the import moves undertyping.TYPE_CHECKING.Only the client-target Python outputs change, and only in their import lines.
Notes for the review.
temporalio.client. A later use atrun time would need a plain import again.
temporalio.clientdoesn't import the generated package, so the new testchecks that a generated client package loads with no
temporalio.clientinsys.modules. Ialso regenerated the Stream bindings in sdk-python with this change, and the import order that
failed there works.