mirror of
https://github.com/evroon/bracket.git
synced 2026-09-14 23:18:29 -04:00
Bumps [pyrefly](https://github.com/facebook/pyrefly) from 1.1.1 to 1.2.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/facebook/pyrefly/releases">pyrefly's releases</a>.</em></p> <blockquote> <h2>Pyrefly v1.2.0</h2> <p><em>Release date: July 31, 2026</em></p> <p>Pyrefly v1.2.0 bundles <strong>901 commits</strong> from <strong>59 contributors</strong>.</p> <hr /> <h2>✨ New & Improved</h2> <h3>Type Checking</h3> <ul> <li>Attrs classes are now fully supported with comprehensive field synthesis, validation, and special-method generation. Pyrefly recognizes <code>@attr.s</code>, <code>@define</code>, <code>@frozen</code>, and their variants, handling field specifiers (<code>attr.ib()</code>, <code>field()</code>), converters, validators, defaults, and private-field aliasing. Converters are typed from their real input type rather than <code>Any</code>, including the <code>@<field>.converter</code> decorator, <code>attrs.converters.pipe</code>, <code>attrs.converters.default_if_none</code>, and generic converters like <code>copy.deepcopy</code>. See the new <a href="https://pyrefly.org/en/docs/attrs/">attrs documentation</a> for details.</li> <li><code>functools.partial</code> is now type-checked instead of treated as opaque. Bound arguments are validated at construction and Pyrefly synthesizes a precise residual signature for the remaining parameters, so errors surface at both the <code>partial(...)</code> call and the later invocation. Generic functions, overloads, constructors, bound methods, and <code>**Unpack[TypedDict]</code> parameters are supported, and results expose <code>.func</code>, <code>.args</code>, and <code>.keywords</code>. Precise residual callable assignment is enabled by the <code>strict</code> and <code>all</code> presets or explicitly with <code>strict-partial-subtyping</code>.</li> <li>Functions decorated with <code>functools.singledispatch</code> now type-check calls using the signature of the function you decorated, and registered implementations are checked against that function's first parameter. Generic <code>singledispatch</code> functions infer from call arguments instead of reporting <code>Unknown</code>.</li> <li>Pyrefly can now warn when a function declared to return a concrete type returns <code>Any</code>, with separate diagnostics for explicit and inferred cases. Off by default, and migrated automatically from mypy's <code>warn_return_any</code>.</li> <li>Pattern matching is substantially more precise: positional class patterns resolve attribute names from <code>__match_args__</code> at solve time, sequence element captures read from the narrowed subject so sibling constraints refine them, and <code>isinstance</code> on a facet filters the parent union to matching members. Fully covered class and sequence patterns now subtract their union member from later cases.</li> <li>Unpacking a variadic tuple with a fixed prefix and suffix no longer smears those elements into the starred capture, so <code>a, *rest, b = t</code> where <code>t: tuple[int, *tuple[bool, ...], str]</code> types <code>rest</code> as <code>list[bool]</code>.</li> <li>TypedDict classes now synthesize <code>__required_keys__</code> and <code>__optional_keys__</code>, so protocols requiring them (like those in langgraph) satisfy structural checks. <code>.get()</code> and <code>.pop()</code> with literal defaults preserve the field type.</li> <li>Overload handling improved throughout: constrained TypeVar arguments expand during resolution, rejected overloads no longer leak argument errors into diagnostics, and exact callback-forwarding signatures resolve overloaded callbacks against forwarded arguments for helpers like <code>asyncio.to_thread</code>.</li> <li>Enum <code>.value</code> on an enum type now infers as the union of member literal values instead of widening to the mixed-in data type.</li> <li>Lambda parameters are contextually typed more thoroughly. Types are stored directly rather than resolved through inference variables, and <code>*args</code>/<code>**kwargs</code> resolve from callable hints to <code>tuple[...]</code> and <code>dict[str, ...]</code> inside the body while preserving element types in the signature.</li> <li>All properties are now treated as data descriptors, and reflected binary-operation dunders are tried first for proper subclasses, fixing a class of incorrect attribute and operator results.</li> <li>Cyclic type aliases reachable from an annotation are now detected instead of hanging, and class finality is taken into account when deciding whether a condition is redundant.</li> <li>Continued basedpyright parity work: class instance truthiness is recognized, code under <code>if TYPE_CHECKING</code> is handled consistently, <code>typing_extensions.sentinel</code> is supported with relaxed naming restrictions, and <code>super(cls, cls)</code> is accepted.</li> <li><code>copy.replace</code> is now type-checked like dataclass replacement, and <code>isinstance(x, type)</code> preserves type arguments when narrowing unions.</li> <li>Narrowing a receiver typed as <code>Self</code> to a subclass now preserves <code>Self</code>, eliminating false return errors in methods that return the narrowed receiver.</li> </ul> <h3>Library Support</h3> <ul> <li>Pydantic constructor synthesis now honors <code>populate_by_name</code> and built-in <code>alias_generator</code> functions, ignores <code>Field(init=False)</code> to match runtime, and treats <code>frozen</code> as a readonly field reason.</li> <li>Django <code>ForeignKey</code> targets now resolve attribute expressions and string references such as <code>"app_label.Model"</code>, preserving the generated relation and <code><field>_id</code> types.</li> <li>Bare factory-boy factory calls now return the model type via <code>FactoryMetaClass</code>.</li> <li>PEP 561 partial stub packages are now supported in imports. Pyrefly reads the <code>partial</code> marker from <code>py.typed</code> and merges the stubs with the runtime package, deferring to the runtime package for omitted modules while preserving <code>.pyi</code>-before-<code>.py</code> precedence for provided ones.</li> <li>A configured <code>typeshed-path</code> now supplies stdlib stubs as well as third-party stubs, enabling complete custom-typeshed testing and overrides.</li> </ul> <h3>Language Server</h3> <ul> <li>Hover now resolves keyword arguments, renders callable protocols as their <code>__call__</code> signature, preserves overload docstrings at call sites, shows enum fields, wraps nested callable and <code>Concatenate[...]</code> signatures for readability, and covers <code>and</code>/<code>or</code> operators, augmented assignments, and union methods.</li> <li>Auto-import completions respect <code>python.analysis.autoImportCompletions</code>, rank deprecated stdlib typing aliases below their modern equivalents, avoid duplicates for already-imported modules, and preserve import aliases correctly.</li> <li>Rename now works on aliased imports and across files for keyword arguments, and renaming a Protocol class targets the class rather than <code>__init__</code>.</li> <li>Go-to-definition now navigates directly to symbols in non-Python files such as <code>.thrift</code>, including nested attribute and enum access and intermediate components of multi-dotted imports.</li> <li>Inlay hints debounce server-side (default 150ms), preventing width jitter while typing. <code>NewType</code> values now use their callable constructor signature instead of producing an invalid <code>type[N]</code> annotation.</li> <li>Notebook support improved: hover and type lookups work past the first cell, and inlay hints, document symbols, references, and diagnostic grouping work in cells following markdown cells.</li> <li>Document symbols fall back to flat <code>SymbolInformation</code> for clients such as Helix, semantic tokens cover <code>with ... as</code> and <code>except ... as</code> bindings, and cross-file diagnostics refresh on save in strict-spec clients such as Zed.</li> <li><code>#region</code>/<code>#endregion</code> markers create folding regions, and selection ranges now follow AST nesting from expression to statement to scope to document.</li> <li>Baselined errors now appear as hints instead of errors, making it easier to distinguish new issues from known technical debt. Baselining also now applies correctly to unused-ignore diagnostics.</li> <li>Match captures receive consistent semantic highlighting and preserve their declaration identity for go-to-definition.</li> <li><code>lspArguments</code> defaults to <code>["lsp"]</code> when empty, preventing startup failures in dev containers and remote environments.</li> <li>The VSCode extension adds an "Infer Types for Current File" command to the command palette.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/facebook/pyrefly/commit/1933169ad8ee9e4d4114112eb56ef0811fb0a094"><code>1933169</code></a> cut 1.2.0</li> <li><a href="https://github.com/facebook/pyrefly/commit/df11f5d1e2e5c1623659ed7b5b6cb36d33cada7e"><code>df11f5d</code></a> Enforce call-boundary consumption in production</li> <li><a href="https://github.com/facebook/pyrefly/commit/e67bc8e7a319e1c01abceed03f35a87ed3ae8cd0"><code>e67bc8e</code></a> Transfer quantified handles to call boundaries</li> <li><a href="https://github.com/facebook/pyrefly/commit/6ba516f98687c37ff72cb76118e2cae12fce3c9b"><code>6ba516f</code></a> Move deferred call state into its boundary</li> <li><a href="https://github.com/facebook/pyrefly/commit/8888e70c5342f24f18c2e2961e2fd68e8e20b7a1"><code>8888e70</code></a> Scope call contexts to a lexical boundary</li> <li><a href="https://github.com/facebook/pyrefly/commit/f8c9e7cf2e6dedcf521c8d6001d171d33fab3f27"><code>f8c9e7c</code></a> LSP: default lspArguments to ["lsp"] when empty</li> <li><a href="https://github.com/facebook/pyrefly/commit/3f0c2285c96579385d1fee8295cd669a76e9b592"><code>3f0c228</code></a> Remove dead .hgignore</li> <li><a href="https://github.com/facebook/pyrefly/commit/335510d760c4e8e8642c32e994886de7e9495519"><code>335510d</code></a> improve Sandbox: link shortening <a href="https://redirect.github.com/facebook/pyrefly/issues/1063">#1063</a> (<a href="https://redirect.github.com/facebook/pyrefly/issues/4327">#4327</a>)</li> <li><a href="https://github.com/facebook/pyrefly/commit/41094b96c71e8da4506745157effeafe21e17e5a"><code>41094b9</code></a> Keep lambda hint decomposition transactional</li> <li><a href="https://github.com/facebook/pyrefly/commit/3193b6a3a17a3995ea244e3cdc383cda227c06d9"><code>3193b6a</code></a> fix behavior of init=False for pydantic.BaseModel (<a href="https://redirect.github.com/facebook/pyrefly/issues/4352">#4352</a>)</li> <li>Additional commits viewable in <a href="https://github.com/facebook/pyrefly/compare/1.1.1...1.2.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: evroon <11857441+evroon@users.noreply.github.com>