Repository navigation
deps: Update dependency pyrefly to >=1.4.0 - #1075
Merged
Merged
Conversation
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.
This PR contains the following updates:
>=1.3.2→>=1.4.0Release Notes
facebook/pyrefly (pyrefly)
v1.4.0: Pyrefly v1.4.0Compare Source
Release date: October 14, 2026
Pyrefly v1.4.0 bundles 1191 commits from 66 contributors.
Release Highlights
Language Server
.venv), so your editor and your command line use the same version. If the environment has no Pyrefly, the extension falls back to its bundled binary. Setpyrefly.pyreflyExecutabletobundledto keep the old behavior. See Pyrefly binary selection.Configuration & CLI
sys.pathas an editable install. Pyrefly treated those directories as installed packages and skipped them, so errors in workspace members went unreported. Pyrefly now checks editable sources inside your project, while regularsite-packagesstay excluded.Type Checking
basedpyrightsections inpyproject.tomland applies the matching type checking mode preset.unknown-member-type,unknown-return-type,untyped-function-decorator, anduninitialized-instance-variablehelp you find whereAnyenters your code.Tensor Shapes
jax-pyrefly-stubspackage.These may change your editor setup or surface new errors in code that checked cleanly under v1.3.0.
--typeshed-pathnow replaces the bundled typeshed entirely instead of overlaying it.incompatible-overload-residualerror kind is renamed toincompatible-overload-argument. The old name still works as a deprecated alias.site-package-pathis renamed tosite-packages-path. The old name still works.✨ New & Improved
Type Checking
basedpyrightconfiguration sections inpyproject.tomland applies appropriate type checking mode presets, making it easier to migrate from BasedPyright.extra_itemsare now instantiated correctly, extra items can supply missing arguments, anddefinitely_seencalculation in callable checking has been fixed.Anyappears in the expected type.incompatible-overload-residualerror kind has been renamed toincompatible-overload-argument(the old name remains as a deprecated alias).uninitialized-instance-variablecheck for annotated instance attributes never assigned in__init__or class body, including@dataclass(init=False)fields.functools.partialnow uses standard quantified finalization and handles generic overload targets.if/elseblocks where all paths diverge.sys.version_infocomparisons against tuples with release levels like(3, 14, 0, "beta").Type Checking Fixes
__get__calls.type(...)calls in annotations now suggest valid type forms liketypes.NotImplementedType,types.EllipsisType,None,types.ModuleType, ortype[MyClass].TYPE_CHECKING = False) no longer report their suites as unreachable.Nevercontainers (list[Never],dict[Never, Never], etc.) are now recognized as falsy.max/mincalls withkey=anddefault=no longer report argument errors from rejected union hint members.Annotatedmetadata is no longer type checked, which removes spurious errors.Any, or whose decorator returnsT | Any, now bind correctly.__new__inherited from an intermediate NamedTuple subclass is now handled correctly.Anyoperand now inferbool.python-versionbelow 3.5 is now rejected with an error instead of crashing.Language Server
pyrefly.pyreflyExecutablesetting (from-environmentorbundled) controls this. Selecting a different interpreter restarts the server with the new binary when it changes.configPathsettings and reloads configuration when those files change..pyi) docstrings over implementation (.py) docstrings when both exist..pyfiles.__all__entries and handles re-export cycles.workspace/didChangeConfigurationonpythonsection.pyrefly/typeFactsrequest for batch type queries.--configto pin config for every file.Callableclass attributes now bindselfwhen first parameter is the containing class.Polars Support
selectandwith_columnsnow handle both positional and keyword arguments correctly, preserving schema information.with_columnsoutputs, and sole-argument list expansion rules.OutputCountenum to distinguish provable width from unknown width.pl.col.attribute completion, suggesting columns from the enclosing DataFrame operation.filter,sort,unique, anddrop_nullsmethods.Django Support
QuerySet.annotate()now preserves keyword annotation attributes on result rows for attribute lookup and LSP completion.to=keyword argument resolution.ForeignKeykeyword-formto=resolution.Configuration & CLI
pyrefly completioncommand to generate shell completion scripts for fish, bash, and zsh.baseline-auto-updateproject setting that automatically prunes baseline files when saving files in the IDE.extendssupport for layered configurations.site-package-pathtosite-packages-pathwith backward compatibility.--typeshed-pathto act as a full typeshed replacement instead of an overlay over the bundled typeshed.embed::Checker::try_new_with_typeshedto allow embedders to replace the bundled stdlib typeshed with in-memory.pyistubs, useful for sandboxed interpreters like Monty.--report-glean-ownershipflag to emit Glean ownership units for ACL-protected paths.--report-gleanto write compact JSON instead of pretty-printed.Error Reporting
unknown-member-typeerror kind for accessing attributes whose type is unknown.unknown-variable-typeto report loop, unpacking, andwithtargets in addition to plain assignments.untyped-function-decoratorcheck for decorators that return unknown types.untyped-class-decoratorcheck for class decorators that return unknown types.default-severityforpotential-bad-keyword-argumentto beignoreas documented.bad-keyword-argumentinstead ofpotential-bad-keyword-argument.unknown-return-typefor returning unknown values from unannotated functions and lambdas.untyped-namedtupleforcollections.namedtuplewithout field types.assert-type-unspellable-subtypefor unspellable types that are subtypes of expected type.unannotated-returnfalse positive on__init__methods.Performance
parking_lotfor per-module computing locks, reducing memory footprint in large projects.Answersstep directly instead of nested shared ownership.Require::Exportsfor implicit dependencies instead ofRequire::Everything.Tensor Shapes
Elementswrappers where postponed annotations allow it.shape_extensions.Shapedandshape_extensions.shape_vars, allowing libraries to use shape types without requiring downstream users to use Pyrefly.no-any-returnwarnings to avoid false positives when the return type union already containsAnyorUnknown.intandboolannotations.torch.uniquestub.Parametertype.AdaptiveAvgPool2dsize support and one-boundtorch.randintoverload.torch.is_tensornarrowing support.Seriesmasks.jax.typing.ArrayLikeshape-aware.np.interptype by adding missing__float__.jax-pyrefly-stubs. This is the first stable release that includes them.abssupport in shape arithmetic.ndarrayto be assignable toSupportsAbsby adding missing__abs__.+,-,*,//.jaxtypingconfiguration option to enable experimental jaxtyping shape checking support.jax.lax.scanshape inference for tuples of arrays.Tensor.Tshape tracking now reverses axes.nn.Moduleregistration types now fall back to the declared parameter type.🐛 Closed Bug Reports
Many of the changes above came from user reports: we closed 87 GitHub bug issues this release 👏 Here are some highlights:
TypeVarTuplewere not assignable to gradual types. Pyrefly was incorrectly wrapping the tuple in an extra layer, causingtuple[int, *Ts]to be rejected when assigned totuple[Any, *Ts].selectandwith_columns. Previously,selectlost schema information for keyword expressions andwith_columnslost it for positional expressions. Both now preserve schema correctly.@propertydecorators on methods with extra required parameters were not flagged as errors. Pyrefly now validates that property getters have the correct signature.__get__calls. When a descriptor's argument type containedAny, the first overload would incorrectly win instead of properly evaluating all branches.stubgen. Generating a.pyifor a single file with a large transitive import closure previously used ~14 GB; it now uses comparable memory topyrefly checkby usingRequire::Exportsinstead ofRequire::Everything.bad-returnerror for generator functions withIterator[X] | Treturn annotations. Pyrefly now correctly acceptsreturnstatements with non-None values in such generators.TypeIs[T]guards with free TypeVars producing no narrowing. When aTypeIsguard used a free TypeVar as its type argument, Pyrefly now correctly narrows to the TypeVar's bound.max/minkey lambdas whendefault=is passed. Pyrefly was incorrectly typing thekeycallable's parameter from the expected type of the whole call rather than from the iterable's element type.try/except, inference would degrade and report spurious errors.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
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:
pyrefly check --suppress-errorspyrefly check --remove-unused-ignoresThis will add
# pyrefly: ignorecomments 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 Pyrefly documentation.
🖊️ Contributors this release
@stroxler, @rchen152, @kinto0, @connernilsen, generatedunixname2066905484085733, @asukaminato0721, @jakevdp, @samwgoldman, @grievejia, @ndmitchell, David Tolnay, generatedunixname1699489071355949, @yeetypete, @QEDady, @javabster, @shahhamdihassan, @manmartgarc, @DetachHead, @yangdanny97, @alexander-beedie, generatedunixname89002005307016, @gaborv, @MarcoGorelli, @tonyyuyiding, @nitishagar, @vgvr0, @tobyh-canva, Catherine Gasnier, @stepanhruda, @pavelzw, @hrolfurgylfa, @NathanTempest, @oprypin, @arthaud, @akhil9tiet, @Aayushyaash, @savagecx, @n-gao, @dedsec-terminal, @Vishwaspatel2401, Willem Kokke, @Aniketsy, @Pager-dot, Alan Kurusingal, @digvijaysai29, @igorsugak, @shobhitmehro, @Trighap52, @maggiemoss, @dantrapp, @fineguy, @itamaro, @danielpassy, @aodihis, @kain88-de, Boyan Atanasov, @Parzivalart3mis, @cweider, @eriksimonson, @Divyansh151005, @iamhaseebn, @nikhil-CLTI, @WilliamK112, @nikmos3, @Wilfred, @kevin9327
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.