Fix deferred logger annotations on Python 3.14 - #7
Merged
Merged
Conversation
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.
Summary
Fix the two blockers found by the new release validation:
LoggerBasefrom the package root rather than its documentedexpedantic.loggernamespace.Root cause
LoggerBase._resolve_schema()walks each class in the MRO, but usedtyping.get_type_hints(cls). Despite the per-class loop,get_type_hints()merges inherited annotations. Under Python 3.14's deferred annotation semantics, resolving a subclass could therefore try to evaluate base-class names in the subclass module and discard the whole schema when that failed. The preceding"__annotations__" in cls.__dict__check was also incompatible with lazy annotation storage.Changes
inspect.get_annotations(cls, eval_str=True), which ignores inherited annotations and resolves each class in its own namespace;__annotations__dictionary check;inspect.isclass();The full Python 3.10–3.14 matrix, optional dataframe suite, and distribution build will run on this PR.