-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDS-335] Resolve import cycles using postponed annotations (#137)
* [SDS-335] Resolve import cycles using postponed annotations Postponed annotations allow us to use forward code references without having access to them statically, but we can have access at runtime. Using the TYPE_CHECKING constant from typing makes sure that we don't have circular dependencies in the actual code. The "correct" approach would be to extract interfaces. For example, we could have a generic API interface or a generic Job interface that exposes the methods and properties that we need access to. However, this is not particularly "Pythonese", so this approach seemed more lightweight. * Address review comments * Add a .coveragerc so we can ignore TYPE_CHECKING warning lines for coverage
- Loading branch information
1 parent
c2e6546
commit 3848324
Showing
4 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[report] | ||
exclude_lines = | ||
if TYPE_CHECKING: |
This file contains 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
This file contains 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
This file contains 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