Pyrefly 1.2 Adds Bazel Integration and Production-Ready Type Coverage
Key Takeaways
- ▸Bazel integration eliminates custom build logic—rules_pyrefly applies Pyrefly across existing py_library, py_binary, and py_test targets via an aspect
- ▸Native attrs type-checking recognizes both modern (@define, @frozen, @mutable) and classic (@attr.s, @attr.ib) APIs without configuration
- ▸Type coverage checking is now production-stable with reporting (JSON output) and CI enforcement (minimum threshold checking)
Summary
Meta has released Pyrefly 1.2, a major update to its Python type checker that expands developer tooling for Python codebases. The release introduces native Bazel build system support, automatic type-checking for attrs-based classes, and promotes type coverage analysis to production-ready status. This release represents 901 commits from 59 contributors and brings improvements across type checking, the language server, and CLI tooling. The new Bazel integration through rules_pyrefly (v0.1.0) eliminates the need for custom build logic, while native attrs support handles both modern and classic API variants without requiring plugin configuration.
Additional improvements include production-ready coverage reporting and CI enforcement, enhanced type checking for functools.partial and functools.singledispatch, improved pattern matching narrowing, and better support for Pydantic and Django. Projects including NumPy, Narwhals, and scipy-stubs already use Pyrefly's type coverage features to track type annotation completeness.
- Expanded type checking for functools utilities, pattern matching, and popular frameworks (Pydantic, Django)
