github facebook/pyrefly 0.28.0
Pyrefly v0.28.0

latest releases: 0.45.2, 0.45.1, 0.45.0...
4 months ago

pyrefly v0.28 bundles 119 commits from 20 contributors. This release introduces new features related to function and class metadata, improves class base type calculations, enhances import finding logic, and addresses several bug fixes related to LSP behavior, error reporting, and type inference.

✨ New & Improved

Area What’s new
Type Checker Export function information including names and locations, enabling Pysa to use pyrefly's function list for consistency.Add parent information to functions and classes to facilitate unique fully qualified name generation in Pysa.Introduce function flags (e.g., is_overload, is_classmethod) for richer metadata.
Class Metadata & Type Inference Support Pydantic metadata by adding it to class metadata.
Import Resolution Implement preference for .pyi files over .py over .pyc files in import finding, even if the import occurs later in the includes list. This is particularly useful for go-to-definition in the LSP, preferring implementation files over interfaces.
Error Reporting Add a check for unused coroutines, similar to pyright and mypy, to flag coroutines that are not awaited, passed to a function, or assigned to a variable.
LSP Improvements to LSP shutdown behavior, ensuring the language server exits gracefully on connection close and removing previous workarounds for exit notifications.
Configuration Add support for ignore files (.gitignore, .ignore, .git/exclude) with a config (use-ignore-files) to enable and disable their use.
Website Sandbox Added a dropdown to select the Python version in the sandbox, allowing users to test against different Python versions (3.8-3.12).

🐛 Other bug fixes

  • Fix handling of args and kwargs for lambda functions, where they were incorrectly treated as position arguments.
  • Address autocomplete issue where redeclarations were not appearing (reported as #818).
  • Fix issues with completions (#850).
  • Filter out synthetic narrow keys from named_bindings (#851, #841).
  • Improve error suppression logic to handle suppressions on the line above or same line as the error.
  • Fix overload selection involving type dict field errors, addressing a bug where an overload that should fail was erroneously selected.
  • Fix for #811, where while True with no breaks treated as non-terminating.

🚨 Potentially breaking

If you are using Pyrefly in your CI processes, the following changes may cause your CI to break when upgrading to the new version of Pyrefly

  • pyrefly autotype renamed to pyrefly infer to reduce confusion with existing tools.

📦 Upgrade

To upgrade to the latest version of Pyrelfy, run the following terminal command:

pip install --upgrade pyrefly==0.28

🖊️ Contributors this release

Thank-you to all our wonderful contributors!

Aaron Pollack, Abby Mitchell, Adist319, Carlos Fernandez, Conner Nilsen, Danny Yang, Doğaç Eldenk, Fangyi Zhou, Jia Chen, Kyle Into, Maggie Moss, Maxime Arthaud, Neil Mitchell, Rebecca Chen, Rubmary Rojas, Sam Goldman, Sam Zhou, Xavi Simpson, Zeina Migeed

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.