Repository navigation
Upgrade pyright to 1.1.414 - #1015
Merged
Merged
Conversation
Fix the new errors: Generator returns for @contextmanager, imports from exporting modules, and str narrowing for non-finite JSON numbers.
Match non-finite JSON numbers with str("Infinity" | ...) instead of a guard,
and give the publisher test's signing config its real type in place of Any
and type: ignore.
stobrien89
approved these changes
Dec 5, 2026
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
uv.lockhas held pyright at 1.1.406 since October 2025, because Dependabot's weeklypipupdates never touchuv.lock(fixed separately in #1016). This bumps the lockfile and the>=floor to 1.1.414. On 1.1.406, strict checking ofpackagesspends about 66 of its 70 seconds insmithy_python/_client_emitter.py. Pyright 1.1.409 fixed that, andpyright packagesnow finishes in about 4.5 seconds.The newer pyright reports 27 errors from four changes in pyright and typeshed. None of the fixes change runtime behavior.
@contextmanagerreturningIteratoris deprecated (15 errors). Typeshed now deprecates annotating@contextmanagerfunctions as-> Iterator[X](Fix the signatures of@(async)contextmanagerpython/typeshed#12087). They now returnGenerator[X].reportPrivateImportUsagefor packages checked from source (Fix reportPrivateImportUsage errors disappearing microsoft/pyright#11237). One annotation insmithy_http/aio/crt.pyand seven test references now go through the module that defines each name, or throughmonkeypatch.str(3 errors). Since 1.1.407, pyright doesn't narrow amatchsubject from a pattern likecase "NaN", because matching uses==.smithy_jsonnow usesstr("Infinity" | "-Infinity" | "NaN")class patterns, which check the type before comparing the value.test_publisher.pybuilt its signing config from stubs behind four# type: ignorecomments, so pyright couldn't infer its type. The stubs now implement the signer and resolver protocols, and the variable is annotated with the config type the async publisher accepts.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.