mirror of
https://github.com/evroon/bracket.git
synced 2026-06-11 10:15:19 -04:00
Bumps [pyrefly](https://github.com/facebook/pyrefly) from 0.63.1 to 0.64.1. <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 v0.64.1</h2> <p><strong>Full Changelog</strong>: <a href="https://github.com/facebook/pyrefly/compare/0.64.0...0.64.1">https://github.com/facebook/pyrefly/compare/0.64.0...0.64.1</a></p> <h2>Pyrefly v0.64.0</h2> <p><strong>Status : BETA</strong> <em>Release date: May 05, 2026</em></p> <p>Pyrefly v0.64.0 bundles <strong>190 commits</strong> from <strong>20 contributors</strong>.</p> <hr /> <h2>✨ New & Improved</h2> <table> <thead> <tr> <th>Area</th> <th>What's new</th> </tr> </thead> <tbody> <tr> <td><strong>Type Checking</strong></td> <td>- You can now pass generic or overloaded callables to higher-order functions and Pyrefly will preserve their structure in the return type. For example, <code>identity(identity)</code> now correctly returns a generic callable instead of degrading to <code>Unknown</code>. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Same-scope class rebinds (like <code>Real = Dummy</code> after <code>class Real</code>) are now checked against the original class as if it were an implicit <code>type[Real]</code> annotation, preventing silent type changes and fixing spurious constructor-call errors. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Generic classes with missing type arguments in lax mode now default to <code>Any</code> instead of raising variance errors, improving consistency with how we handle other incomplete types. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Pydantic <code>field_validator</code> decorators with <code>mode='before'</code> and <code>mode='plain'</code> are now supported, allowing validators to accept broader input types before coercion. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Spurious unpack diagnostics are no longer emitted when the right-hand side involves <code>Never</code> (e.g. <code>a, b, c = never()</code> or <code>a, b = (never(), 1)</code>). The unpack solver is now <code>Never</code>-aware, recognizing that the producing expression cannot complete and any error message at the unpack site would be misleading. <!-- raw HTML omitted --><!-- raw HTML omitted -->- <code>assert</code> statements now check that <code>__bool__</code> is callable on the test expression, matching the behavior already in place for <code>if</code>, <code>while</code>, and ternary expressions (and aligning with mypy and pyright).</td> </tr> <tr> <td><strong>Language Server</strong></td> <td>- The language server now advertises both <code>source.fixAll</code> and <code>source.fixAll.pyrefly</code> code action kinds, enabling selective fix-on-save configuration across editors that implement the LSP protocol. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Document highlights now correctly distinguish between read and write references, setting <code>DocumentHighlightKind::WRITE</code> for assignments and declarations. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Go-to-definition on relative imports in site-packages files now correctly resolves to the package source instead of returning null when a <code>pyproject.toml</code> exists at the project root. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Notebook cell index resolution has been fixed to prevent mismatches between code cells and markdown cells, eliminating panics and incorrect byte offset calculations in Jupyter notebooks. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Cross-module "find references" (external references) is now enabled by default, returning references across the entire project rather than just the current file. <!-- raw HTML omitted --><!-- raw HTML omitted -->- A new quick fix turns the existing "Did you mean <code>Foo.BAR</code>?" diagnostic note for missing enum members into a code action that replaces the offending string literal with the proper enum member access. <!-- raw HTML omitted --><!-- raw HTML omitted -->- A new <code># pyrefly: ignore</code> quick fix inserts a suppression comment for the diagnostic at the cursor, automatically merging into an existing pyrefly-ignore directive on the same line or on a comment-only line above when present. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Numeric parameter defaults now preserve their source spelling (e.g. <code>0o777</code>, <code>0xFF</code>, <code>0b101</code>) in hover and signature display rather than being normalized to decimal. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Code actions documentation has been added to the IDE Supported Features page, covering quick fixes and <code>source.fixAll.pyrefly</code> configuration.</td> </tr> <tr> <td><strong>Onboarding & VS Code Extension</strong></td> <td>- A redesigned unconfigured-project experience: when no <code>pyrefly.toml</code> is found, Pyrefly auto-detects nearby <code>mypy.ini</code>, <code>pyrightconfig.json</code>, or <code>[tool.mypy]</code>/<code>[tool.pyright]</code> sections in <code>pyproject.toml</code> and synthesizes an in-memory configuration migrated from those settings (using the <code>legacy</code> or <code>default</code> preset respectively). With no detectable configuration, the new <code>basic</code> preset is used. <!-- raw HTML omitted --><!-- raw HTML omitted -->- A new <code>python.pyrefly.typeCheckingMode</code> workspace setting (auto / off / basic / legacy / default / strict, default <code>auto</code>) lets users pick a preset for files not covered by an explicit Pyrefly configuration, directly from the VS Code settings UI. The legacy <code>python.pyrefly.displayTypeErrors</code> setting is now deprecated, with values transparently mapped to the new model. <!-- raw HTML omitted --><!-- raw HTML omitted -->- A new <code>python.pyrefly.disableTypeErrors</code> workspace setting provides a clean per-workspace kill switch for diagnostics, independent of the type-checking mode. <!-- raw HTML omitted --><!-- raw HTML omitted -->- The VS Code status bar has been redesigned: it now shows the active preset (e.g. "Pyrefly (Legacy)", "Pyrefly (Basic)") and the tooltip explains why that preset was chosen and links to the relevant docs. <!-- raw HTML omitted --><!-- raw HTML omitted -->- After a <code>pyrefly check</code> on an unconfigured project, the CLI now prints a short upsell to <strong>stderr</strong> explaining what configuration was synthesized and pointing at <code>pyrefly init</code>. The message is routed to stderr so machine-readable stdout formats (e.g. <code>--output-format json</code>) remain untouched.</td> </tr> <tr> <td><strong>Configuration</strong></td> <td>- Configuration presets (<code>off</code>, <code>basic</code>, <code>legacy</code>, <code>default</code>, <code>strict</code>) are now available via the <code>preset</code> option, providing named collections of error severities and behavior settings as a base configuration that user settings can override. <!-- raw HTML omitted --><!-- raw HTML omitted -->- The <code>legacy</code> preset is now used by <code>pyrefly init</code> for mypy migration, disabling checks mypy doesn't have and setting looser inference defaults. <!-- raw HTML omitted --><!-- raw HTML omitted -->- The <code>implicit-any</code> error code has been split into sub-kinds (<code>implicit-any-attribute</code>, <code>implicit-any-empty-container</code>, <code>implicit-any-parameter</code>, <code>implicit-any-type-argument</code>) with <code>implicit-any</code> as the parent, allowing finer-grained control over where implicit <code>Any</code> is flagged. <!-- raw HTML omitted --><!-- raw HTML omitted -->- The <code>unbound-name</code> error is now disabled in the <code>legacy</code> preset to match mypy's default behavior, which does not flag possibly-undefined variables.</td> </tr> <tr> <td><strong>Error Reporting</strong></td> <td>- A new <code>incompatible-overload-residual</code> error kind has been introduced for cases where all branches of an overloaded callable are pruned during higher-order function analysis, making it easier to configure these errors independently. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Error messages for all-pruned overload residuals now describe the incompatibility in terms of "solved type variables" rather than "solved type constraints" for better clarity. <!-- raw HTML omitted --><!-- raw HTML omitted -->- The <code>pyrefly suppress</code> command now correctly handles removal of unused ignores via the <code>--remove-unused</code> flag, which was previously broken.</td> </tr> <tr> <td><strong>Factory Boy Support</strong></td> <td>- Pyrefly now infers the correct model return types for <code>create()</code>, <code>build()</code>, <code>create_batch()</code>, and <code>build_batch()</code> methods on <code>DjangoModelFactory</code> subclasses by reading the inner <code>Meta.model</code> attribute. <!-- raw HTML omitted --><!-- raw HTML omitted -->- False-positive <code>bad-override</code> errors on the inner <code>Meta</code> class in factory-boy factories are now suppressed, matching how we handle Django and Marshmallow.</td> </tr> <tr> <td><strong>Reporting</strong></td> <td>- The <code>pyrefly report</code> JSON output now includes a <code>path</code> field on each <code>ModuleReport</code>, for compatibility with typestats and similar tooling.</td> </tr> <tr> <td><strong>Performance</strong></td> <td>- Deeply-nested dict literals no longer cause exponential memory growth during type inference. A depth-25 dict literal that previously consumed ~7.7 GB now uses ~239 MB by computing the union of field types on demand instead of storing it redundantly. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Callable residual finalization has been optimized to avoid redundant type cloning and traversals, reducing memory churn in attribute-heavy code. <!-- raw HTML omitted --><!-- raw HTML omitted -->- Eliminated some bugs that caused Pyrefly to unnecessarily analyze dependencies, improving latency and memory use, especially in the IDE.</td> </tr> </tbody> </table> <hr /> <h2>🐛 bug fixes</h2> <p>We closed <strong>15</strong> bug issues this release 👏</p> <ul> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3057">#3057</a>: Fixed an issue where string concatenation with the <code>+</code> operator was incorrectly flagging <code>str</code> as not assignable to <code>LiteralString</code> attributes. Pyrefly now preserves <code>LiteralString</code> style when adding two explicit string literals and uses implicit style otherwise.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/105">#105</a>: Fixed premature type pinning in function calls where arguments were incorrectly narrowed before all constraints were solved. For example, <code>foo(x, y)</code> with <code>x: int | None</code> and <code>y: int | None</code> no longer incorrectly narrows <code>x</code> to <code>None</code> when passed to a generic <code>foo[T](https://github.com/facebook/pyrefly/blob/HEAD/a: T, b: T)</code>.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3198">#3198</a>: Fixed <code>pyrefly suppress --remove-unused</code> which was not actually removing unused error suppressions. The command now correctly processes the <code>--remove-unused</code> flag.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3024">#3024</a>: The language server now advertises <code>source.fixAll.pyrefly</code> in addition to <code>source.fixAll</code>, allowing users to selectively enable or disable Pyrefly's fix-all actions in editors that support LSP code action kinds.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/2819">#2819</a>: Fixed incorrect variance errors when using generic classes like Pydantic's <code>RootModel</code> in lax mode. Missing type arguments now degrade to <code>Any</code> instead of raising errors, matching our handling of other incomplete types.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3000">#3000</a>: Fixed "find references" failures in Cursor and other editors caused by relative imports in site-packages not resolving correctly when a <code>pyproject.toml</code> existed at the project root.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/2563">#2563</a>: Fixed go-to-definition on relative imports in virtual environment site-packages, which was returning null because the project root's import path was matching before the more specific site-package prefix.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3193">#3193</a>: Fixed an error where <code>list["A|B"]</code> was incorrectly rejected as <code>not-a-type</code>. Type argument subscripts are now bound as type expressions even in value context, allowing forward-ref strings to be parsed.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3286">#3286</a>: Fixed exponential memory blowup when type-checking deeply-nested dict literals, which could cause VSCode to be killed by the OS. Memory usage for a depth-25 dict dropped from ~7.7 GB to ~239 MB.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3261">#3261</a>: Fixed a false positive <code>bad-class-definition</code> when a dataclass field was assigned inside a <code>@classmethod</code> or <code>__init_subclass__</code>. Pyrefly was incorrectly extracting these as dataclass fields, even though Python's <code>dataclasses.dataclass</code> ignores them at runtime.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/2914">#2914</a>: <code>assert</code> statements now flag a non-callable <code>__bool__</code> on the test expression, closing a gap that previously only caught the issue inside <code>if</code>, <code>while</code>, and ternary expressions.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/2867">#2867</a>: Fixed <code>urlunparse</code> being inferred as returning <code>Literal[b'']</code> instead of <code>str</code>. The fix reworks <code>as_superclass</code> so tuple-like <code>NamedTuple</code> subclasses are upcast through their erased tuple element types, which stops <code>ParseResult</code> from spuriously matching <code>Iterable[None]</code> and selecting the bytes overload.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3266">#3266</a>: Added a quick fix for the existing "Did you mean <code>Foo.BAR</code>?" diagnostic note for missing enum members, turning the suggestion into a code action that rewrites the surrounding string literal.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3230">#3230</a>: Numeric parameter defaults now preserve their original spelling (e.g. <code>0o777</code>) in hover and signature display rather than being normalized to a decimal value.</li> <li><a href="https://redirect.github.com/facebook/pyrefly/issues/3302">#3302</a>: Added a <code>path</code> field to the <code>pyrefly report</code> JSON <code>ModuleReport</code>, restoring compatibility with typestats.</li> </ul> <p>Thank-you to all our contributors who found these bugs and reported them! Did you know this is one of the most helpful contributions you can make to an open-source project? If you find any bugs in Pyrefly we want to know about them! Please open a bug report issue <a href="https://github.com/facebook/pyrefly/issues">here</a></p> <hr /> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="71ff2a5cbc"><code>71ff2a5</code></a> upgrade</li> <li><a href="b3d41027a2"><code>b3d4102</code></a> Strip debuginfo from release binaries to reduce binary size</li> <li><a href="ccb904d472"><code>ccb904d</code></a> Fix Pyrefly regression with imported TypeVars via attribute access (<a href="https://redirect.github.com/facebook/pyrefly/issues/3333">#3333</a>)</li> <li><a href="fb2ef608a2"><code>fb2ef60</code></a> support vscode-python-environments extension (<a href="https://redirect.github.com/facebook/pyrefly/issues/3327">#3327</a>)</li> <li><a href="e63fa8d7d9"><code>e63fa8d</code></a> remove extensionDependency on ms-python.python (<a href="https://redirect.github.com/facebook/pyrefly/issues/3326">#3326</a>)</li> <li><a href="15b8f81792"><code>15b8f81</code></a> abstract away python-environment from extension (<a href="https://redirect.github.com/facebook/pyrefly/issues/3325">#3325</a>)</li> <li><a href="e267ba6974"><code>e267ba6</code></a> Fix provide_type race condition with config recheck cancellation (<a href="https://redirect.github.com/facebook/pyrefly/issues/3316">#3316</a>)</li> <li><a href="fe26ba3ace"><code>fe26ba3</code></a> Fix failing quick fix test</li> <li><a href="6d9611de43"><code>6d9611d</code></a> Use <code>FuncMetadata::def</code> to reduce code duplication</li> <li><a href="a545b3a13c"><code>a545b3a</code></a> Add a more general <code>FuncMetadata::def</code> helper</li> <li>Additional commits viewable in <a href="https://github.com/facebook/pyrefly/compare/0.63.1...0.64.1">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>