Skip to content

Releases: facebook/pyrefly

Pyrefly v0.30.0

26 Aug 13:57

Choose a tag to compare

Status : ALPHA
Release date: 25 August 2025

pyrefly v0.30.0 bundles 195 commits from 20 contributors 👏

✨ New & Improved

Area What’s new
Completions - Enhanced completions for super with multiple inheritance implemented completion for unions

- When the attribute base is a union, suggestions are now combined from every branch of the union. This might lead to errors, but it's more helpful to make the suggestion
Type System - added a configuration flag to turn off "infer from first use" behavior. Inferring types from first usage is valuable for catching bugs but it can lead to false positives so this new flag allows users to turn it off. Turning it off behaves like pyright, leaving it on behaves like mypy.

- implicit attribute definition errors are now turned off by default. These errors were raised when an attribute is only declared in a non-constructor method, but it can be a source of false positives in dynamic code.

- When type args are not explicitly set, push the class type params into methods (matches mypy approach, differs from pyright that implicitly instantiates with Any/default) ensured qualified names are printed for enums as part of unions.

- Enable creation of empty enums and named tuples using functional syntax Default excludes now align with Pylance (incl. Node_modules, __pycache__ and *venv)

🐛 Bug fixes

We closed 11 bug issues this release 👏

  • #984 - empty enums incorrectly given type Never, rather than Any
  • #865 - completion not working for Pytorch torch.zeros module
  • #514 - issue returning generic Self
  • Other bug fixes: #971, #967, #743, #567, #348, #261, #186, #103

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 here

📦 Upgrade

pip install --upgrade pyrefly==0.30

How to safely upgrade your codebase

Upgrading the version of Pyrefly you're using or a third-party library you depend on can reveal new type errors in your code. Fixing them all at once is often unrealistic. We've written scripts to help you temporarily silence them. After upgrading, follow these steps:

  1. pyrefly check --suppress-errors
  2. run your code formatter of choice
  3. pyrefly check --remove-unused-ignores
  4. Repeat until you achieve a clean formatting run and a clean type check.

This will add # pyrefly: ignore comments to your code, enabling you to silence errors and return to fix them later. This can make the process of upgrading a large codebase much more manageable.

Read more about error suppressions in the Pyefly documentation

🖊️ Contributors this release

@javabster, @capickett, Carlos Fernandez, @connernilsen , @yangdanny97, @grievejia, @kinto0, @arthaud, @prasannavenkateshgit, @rchen152, @rchiodo, @rubmary, @samwgoldman, @SamChou19815, @sargun, @stroxler, @VladimirMakaev, @migeed-z, @LycheeBay

Pyrefly v0.29.0

19 Aug 13:35

Choose a tag to compare

Status : ALPHA
Release date: 18 August 2025

Pyrefly 0.29 bundles 192 commits from 23 contributors. This release focuses on improving the type checker's behavior, particularly around handling Any and LiteralString, enhancing LSP features like "go to definition" and hover, and various internal refactors for maintainability.

✨ New & Improved

Area What’s new
Type Checker Behavior - The type checker now treats return outside of a function, and await, async for, async with outside of async function definitions as syntax errors.
- Support special LiteralString behavior for methods like str.join and str.format.
- Any handling for super().__init__ and super().__new__ calls have been improved.
- typing.Self is now correctly substituted inside method bodies.
- Using the new PEP 728 keywords (closed, extra_items) in TypedDict no longer throws type errors.
- Full support for PEP 728 is coming soon.
LSP Features - "Go to definition" now prioritizes .py files over .pyi for a more useful real implementation view.
- Docstrings now appear for standard library functions.
- Display ranges for generator expressions have been adjusted for consistency with Python AST.

🐛 Bug fixes

We closed 21 bug issues this release 👏

  • #940 - cannot use items as a key in a TypedDict
  • #915 - incorrect autocomplete suggestions for read_database
  • #872 - false positive inside while loops
  • #853 - excessive memory usage in VScode due to multiple processes being spawned
  • Too many panics, not enough discos:
    • #864 - panic for helion with pytorch installed
    • #848 - panic key lacking binding
  • Other bug fixes: #931, #833, #815, #748, #725, #655, #906, #905, #901, #895, #894, #891, #889, #931, #922

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 here

📦 Upgrade

pip install --upgrade pyrefly==0.29

How to safely upgrade your codebase

Upgrading the version of Pyrefly you're using or a third-party library you depend on can reveal new type errors in your code. Fixing them all at once is often unrealistic. We've written scripts to help you temporarily silence them. After upgrading, follow these steps:

1. pyrefly check --suppress-errors
2. run your code formatter of choice
3. pyrefly check --remove-unused-ignores
4. Repeat until you achieve a clean formatting run and a clean type check.

This will add # pyrefly: ignore comments to your code, enabling you to silence errors and return to fix them later. This can make the process of upgrading a large codebase much more manageable.

Read more about error suppressions in the [Pyefly documentation](https://pyrefly.org/en/docs/error-suppressions/)

🖊️ Contributors this release

Aahan Aggarwal, Abby Mitchell, Conner Nilsen, Danny Yang, David Luo, Fangyi Zhou, James Gill, Kc Balusu, Kyle Into, LyricalToxic, Maggie Moss, Maxime Arthaud, Neil Mitchell, Rebecca Chen, Rubmary Rojas, Sam Goldman, Sam Zhou, Steven Troxler, Vladimir Matveev, Xavi Simpson, Zach Riser, Zeina Migeed

Pyrefly v0.28.0

11 Aug 19:39

Choose a tag to compare

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

Pyrefly v0.27.0

07 Aug 15:06

Choose a tag to compare

Status: ALPHA

Release date: 2025-08-04

Pyrefly 0.27.0 bundles 212 commits from 20 contributors

📝 Changelog

Typechecking

  • Caught exception names are now correctly out of scope after except clauses.
  • Variables declared with only annotations (e.g., x: int) are no longer always assumed uninitialized.
  • Assignments to inherited attributes within method bodies are no longer treated as re-declarations.
  • Prevented crashes from overlapping UsageLink ranges by using YieldLink for yield calculations.
  • Corrected the type for __path__ to MutableSequence.

IDE

  • Overloads are now supported on completion and metaclass/__new__/__init__ calls are treated as overloads.
  • cls arguments are removed from completion and signature help.
  • VSCode extension name issue resolved by using displayName in package.json.
  • Docstring indentation trimming now ignores the first line.
  • More concise display for top-level types
  • Function arguments in hover types are formatted on new lines if there's more than one.

Misc.

  • Fix crash when receiving non-file change events.

📦 Upgrade

pip install --upgrade pyrefly==0.27.0

🖊️ Contributors this release

@stroxler @fangyi-zhou @rubmary @kinto0 @grievejia @rchen152 @ndmitchell @aahanaggarwal @javabster @connernilsen @migeed-z @SamChou19815 @yangdanny97

Full Changelog: https://github.com/facebook/pyrefly/compare/0.26.0..0.27.0

Pyrefly v0.26.0

29 Jul 18:19

Choose a tag to compare

Status: ALPHA

Release date: 2025-07-28

Pyrefly 0.26.0 bundles 179 commits from 24 contributors

📝 Changelog

Configuration

  • Added a "disable-search-path-heuristics" to disable search path heuristics for users that want to configure all imports manually.
  • Fixed issues with the --watch flag.
  • Support .pyx, .pyd, and .pyw compiled files for module finding and globbing.
  • Disabled imports from pycache to prevent incorrect imports.

Typechecking Features

  • Fix several bugs with variable scopes.
  • Warn on calling deprecated overloads.
  • Added support for checking code snippets directly from the command line.
  • Disallowed attribute assignment or deletion on super() objects.
  • Emit an error when an uncalled function is used as the condition for an if statement.
  • Improved new and init_subclass behavior.
  • Enabled support for descriptors in dataclass fields.
  • Fixed bugs related to TypedDict operations, including setitem and matching against PartialTypedDict.
  • Fix bug with synthesized namedtuple constructors.

IDE

  • Optimized autocomplete by filtering local variable results and providing a specialized path for builtins, effectively improving auto-import behavior.

Other

  • Enhanced performance with caching for node packages and rust-cache.
  • Improved display of default values and type information.
  • Improved subscript error messages to indicate non-subscriptable types.
  • Summary display is now more concise by default, with options for detailed or no summary.

📦 Upgrade

pip install --upgrade pyrefly==0.26.0

🖊️ Contributors this release

@grievejia @samwgoldman @stroxler @rchen152 @fangyi-zhou @ndmitchell @rubmary @kinto0 @arthaud @lolpack @migeed-z @darricklaidin @connernilsen @regexyl @danielocfb @WeixiMa @maggiemoss @yangdanny97

Full Changelog: https://github.com/facebook/pyrefly/compare/0.25.0..0.26.0

Pyrefly v0.25.0

22 Jul 21:19

Choose a tag to compare

Status: ALPHA

Release date: 2025-07-22

Pyrefly 0.25.0 bundles 307 commits from 19 contributors

📝 Changelog

  • Error Handling Improvements:
    • Avoid redundant error messages for positional arguments.
    • Show environment query errors and config loading errors in IDE.
  • Class and Attribute Handling:
    • Changed semantics of class objects initialized on class bodies.
    • Improved handling of read-only class attributes.
  • IDE Enhancements:
    • Support for "jump to definition" on hover.
    • Optimized module path sorting.
  • Type System Enhancements:
    • Improve handling for typing.Self.
  • Configuration and Migration:
    • Added support for ignore_missing_imports in Pyrefly config.
    • Improved config migration logic and added tests for various config options.
  • Error and Warning Enhancements:
    • Warn on deprecated method calls and overloaded calls.
    • Improve error labeling and severity-based color coding.
  • TypedDict Improvements:
    • Check keyword arguments in TypedDict initialization & makeself positional-only.
  • Documentation and Usability:
    • Updated documentation for IDE settings and config options.
  • Miscellaneous:
    • Raise error on variable use-before-assignment.
    • Improved mutable capture for global and nonlocal variables.

📦 Upgrade

pip install --upgrade pyrefly==0.25.0

🖊️ Contributors this release

@rchen152 @stroxler @ndmitchell @yangdanny97 @arthaud @kinto0 @connernilsen @SamChou19815 @rubmary @dluo @migeed-z @samwgoldman @fangyi-zhou @LyricalToxic @melvinhe @grievejia @lolpack

Full Changelog: 0.24.2...0.25.0

Pyrefly v0.24.2

15 Jul 14:34

Choose a tag to compare

Status: ALPHA

Release date: 2025-07-15

Pyrefly 0.24.2 bundles 290 commits from 26 contributors

📝 Changelog

  • Type System Enhancements: Improved handling of type() and bool() for narrowing, and the behavior for match statements w/ class patterns
  • Dataclass Transform: Full support for dataclass_transform
  • Interpreter Query Optimization: Significant reduction in import times and memory usage by optimizing search path handling and deduplication of search path entries.
  • Error Handling and Reporting: Introduced CLI flags to configure error severity for individual error codes (--error, --warn, --ignore) and improved error message clarity.
  • Semantic Tokens: Fixed issues with semantic tokens on the first line and improved deduplication logic.
  • Binop Support: Fixed issues with operations like float * bool and complex * bool.
  • Workspace Symbols: Implemented workspace symbol support using the fuzzy search infrastructure for auto-import.
  • Configuration Improvements: Added --typeshed-path CLI flag for custom typeshed modifications and improved config handling logic.

📦 Upgrade

pip install --upgrade pyrefly==0.24.2

🖊️ Contributors this release

@ndmitchell, @yangdanny97, @stroxler, @rchen152, @migeed-z, @connernilsen, @dluo, @maggiemoss, @rubmary, @xaskii, @kinto0, @grievejia, @SamChou19815, @melvinhe, @lianne, @krikera, @dluo, @Abel981, @fangyi-zhou, @Alex-Aron, @zpao, @slawlor, @diliop, @arnav-jain1, @samwgoldman

v0.23.0

09 Jul 21:16

Choose a tag to compare

Pyrefly 0.23.0

Status: ALPHA
Release date: 2025-07-07

Pyrefly 0.23.0 bundles 186 commits from 24 contributors. This release introduces significant improvements in type checking, configuration handling, and error management.


📝 Changelog

  • Dataclass improvements: Added checks for dataclas field ordering, keyword arguments, and inheritance, aligning with Python's typing specification. Started implementing support for dataclass transforms.
  • Error Handling and Suppression: Introduced more robust error handling and suppression options. Error suppression comments can now specify the type of error being suppressed, and are less sensitive to whitespace.
  • Go-to-def Enhancements: Added support for resolving a single goto-def request to multiple definitions.
  • Configuration and Environment Updates: Better error reporting and support for conda environments.
  • Jupyter Notebook Integration: Pyrefly can now work on notebooks in Jupyter Lab, via the jupyterlab-lsp extension.

📦 Upgrade

pip install --upgrade pyrefly==0.23.0

🖊️ Contributors this release

@aahanaggarwal, @yangdanny97, @stroxler, @rchen152, @dluo, @ndmitchell, @connernilsen, @xaskii, @melvinhe, @migeed-z, @TheRustyPickle, @arnav-jain1, @InSyncWithFoo, @rubmary, @arthaud, @samwgoldman, @grievejia, @danielocfb-test, @maggiemoss, @DavidTolnay, @junhao, @darricklaidin, @kinto0

v0.22.0

01 Jul 14:45

Choose a tag to compare

Pyrefly 0.22.0

Status : ALPHA

Release date: 30 Jun 2025

Pyrefly 0.22.0 bundles 216 commits from 23 contributors. This release includes significant improvements in type checking and performance enhancements.


✨ New & Improved

Area What’s new
Type Checking Implemented support for functools.total_ordering, allowing automatic generation of rich comparison methods.
IDE / LSP Added support for textDocument/rename and textDocument/prepareRename in LSP.
Configuration Introduced CLI flag for --conda-environment to manage Python environments more effectively.

🐛 Other bug fixes

  • Fixed bugs in attribute narrowing and method overrides.
  • Resolved issues with NamedTuple field ordering and TypedDict method synthesis.
  • Values with type[tuple] can now be used as a tuple constructor
  • Enums can now be subscripted with any str, not just literals.

📦 Upgrade

pip install --upgrade pyrefly==0.22.0

🖊️ Contributors this release

@Adist319, @adsi7698, @bigfootjon, @connernilsen, @CookieComputing, @dluo, @facebook-github-bot, @fangyi-zhou, @grievejia, @iwakitakuma33, @kinto0, @krathul, @melvinhe, @migeed-z, @ndmitchell, @pt2302, @rchen152, @SamChou19815, @stroxler, @vagabond-0, @xaskii, @yangdanny97, @zsol

Previous Release Notes

https://github.com/facebook/pyrefly/releases

Full Changelog: 0.21.0...0.22.0

v0.21.0

25 Jun 19:30

Choose a tag to compare

Pyrefly 0.21.0

Status : ALPHA
Release date: 23 June 2025

Pyrefly 0.21.0 delivers 176 commits from 20 contributors. We now support a number of highly requested features such as Semantic Highlighting, Signature Help, Document Highlights and Auto Import Completions! Follow along for more LSP functionality #344 ahead of our V1 release.


✨ New & Improved

Area What’s new
IDE / LSP (Issue #344) Richer semantic highlighting – method calls, property accesses, and the expressions nested in them now get distinct token types, so editors like VS Code underline exactly what you expect (#344).
• Added the defaultLibrary semantic-token modifier for symbols originating from builtins, typing, or typing_extensions; makes built-ins stand out in both dark/light themes.
Diagnostics Detailed override errors – incompatibilities between a subclass attribute and its parent now explain why they don’t match (“read-write vs read-only”, “int vs str”, etc.) on a second indented line.
Type-system smarts InitVar fields in @dataclass definitions are no longer treated as instance attributes, eliminating false “missing attribute” errors (PR [#437]).
• Full support for Variance Inference in Generic Classes with PEP 695
Performance • A pathological Callable | … union test that once blew up exponentially now checks in linear time.

🐛 Other bug fixes

  • Multiple edge-case panics removed, including starred targets inside augmented assignments and cyclic class-type substitutions.
  • Hover & go-to-definition in LSP no longer crash when traversing keyword-only or pattern-match bindings.
  • Cargo / Rust nightly warnings cleaned up; WASM build green again.

🚨 Potentially breaking

  • The new, more explicit override-mismatch diagnostics may fail code that relied on silent attribute-type changes.
  • Editors that hard-code semantic-token kinds should be updated to recognise the new defaultLibrary modifier.

📦 Upgrade

pip install --upgrade pyrefly==0.21.0

🖊️ Contributors this release

@yangdanny97 @Adist319 @grievejia @connernilsen @migeed-z @ndmitchell @xl4624 @stroxler @rchen152 @TheRustyPickle @dluo @kinto0 @pt2302 @SamChou19815 @ducdetronquito @xaskii @Alex-Aron @hugovk @grantlouisherman @rubmary