Update ruff submodule to latest ty-types-2 branch; surface ParamSpec/Concatenate#14
Merged
knutwannheden merged 2 commits intomainfrom Apr 20, 2026
Merged
Update ruff submodule to latest ty-types-2 branch; surface ParamSpec/Concatenate#14knutwannheden merged 2 commits intomainfrom
knutwannheden merged 2 commits intomainfrom
Conversation
…Concatenate Bumps ruff submodule to pull in astral-sh/ruff main through ty 0.0.31 (openrewrite/ruff ty-types-2 tip 1f844143e8). API shim changes: - ProjectDatabase::new → ProjectDatabase::fallible; the constructor now takes a MisconfigurationStrategy, and `fallible` matches our prior error-propagating behavior. - ClassLiteral gained DynamicTypedDict / DynamicEnum variants; replace the per-variant match in supertypes_from_class_literal with the uniform ClassLiteral::explicit_bases(db), which already handles them. - Type gained a Divergent(DivergentType) cycle marker; folded into the Other fallback alongside DataclassDecorator / BoundSuper. New wire-protocol fields on ParameterInfo: - concatenatePrefix (bool) — set on leading positional params of a Concatenate[T1, ..., Tn, P] / Concatenate[T1, ..., Tn, ...] signature. - paramSpecName (string) — set on the synthesized *args / **kwargs entries that stand in for a ParamSpec tail, carrying that ParamSpec's name. Both fields are omitted when absent, so consumers that ignore unknown fields see no change. TypedDict.extraItems is noted as a TODO in registry.rs: ty's inference-side parsing landed in astral-sh/ruff#24362, but the public accessor on TypedDictType is still unavailable.
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.
Motivation
Upstream ty released 0.0.22 → 0.0.31 while our submodule was pinned to ~0.0.21. This PR catches up by bumping the
ruff/submodule to the latestopenrewrite/ruffty-types-2tip (1f844143e8), fixing the API shim against breaking changes on ty's side, and exposing two new pieces of structured signature information that ty now makes available:Concatenateprefixes andParamSpectails.Examples
Callable[Concatenate[int, P], R]— the leadingintis now tagged, and the synthesized*args/**kwargscarry theParamSpecname so consumers can collapse them back intoP:{ "kind": "callable", "parameters": [ { "name": "", "kind": "positionalOnly", "typeId": 7, "hasDefault": false, "concatenatePrefix": true }, { "name": "args", "kind": "variadic", "typeId": 8, "hasDefault": false, "paramSpecName": "P" }, { "name": "kwargs", "kind": "keywordVariadic", "typeId": 9, "hasDefault": false, "paramSpecName": "P" } ], "returnType": 10 }Callable[P, R]— sameparamSpecNametreatment, noconcatenatePrefix:{ "kind": "callable", "parameters": [ { "name": "args", "kind": "variadic", "typeId": 4, "hasDefault": false, "paramSpecName": "P" }, { "name": "kwargs", "kind": "keywordVariadic", "typeId": 5, "hasDefault": false, "paramSpecName": "P" } ], "returnType": 6 }Plain signatures are unaffected — both fields are omitted when false / absent.
Summary
ruff/submodule fromf74e9836to1f844143(openrewrite/ruffty-types-2).ProjectDatabase::new(metadata, system)→ProjectDatabase::fallible(metadata, system)(upstream split the constructor and added aMisconfigurationStrategyparameter).supertypes_from_class_literaltoClassLiteral::explicit_bases, which now uniformly handles the newDynamicTypedDict/DynamicEnumvariants.Type::Divergent(DivergentType)cycle marker into theOtherfallback.concatenatePrefix: boolandparamSpecName: Option<String>toParameterInfo, populated fromsig.parameters().kind()in bothregistry.rs(forfunction/callable/boundMethoddescriptors) andcollector.rs(forCallSignatureInfoonExprCallnodes).registry.rsforTypedDict.extraItems— [ty] Infer theextra_itemskeyword argument to class-based TypedDicts as an annotation expression astral-sh/ruff#24362 landed the inference side, but the public accessor onTypedDictTypeis still unavailable.README.md.Test plan
cargo check— clean.cargo test— 25/25 integration tests pass, including three new tests:test_param_spec_signature(Callable[P, R])test_concatenate_signature(Callable[Concatenate[int, P], R])test_non_paramspec_signature_has_no_flags(regulardef add(a: int, b: int) -> int)cargo build --release— clean.--servewithinitialize/shutdown.All new fields are additive and
skip_serializing_if-gated, so existing consumers are unaffected.