Pyre-check is a performant static type checker for Python, developed by Meta (formerly Facebook). It is compliant with PEP 484 and designed to analyze large codebases incrementally, providing quick feedback. It operates with a client-server architecture and includes Pysa, a security-focused static analysis tool. The library is actively maintained with regular updates.
pip install pyre-checkNo compatibility data collected yet for this library.
This quickstart demonstrates setting up a basic Python project, installing `pyre-check` in a virtual environment, initializing its configuration, and running a simple type check to identify errors. The primary interaction with Pyre-check is through its command-line interface.
Install `watchman` via your system's package manager (e.g., `brew install watchman` or `sudo apt-get install watchman`) and ensure it's running when using Pyre.
Stay informed about `Pyrefly`'s development if you plan long-term commitment to Meta's Python type-checking tools. Currently, `pyre-check` remains supported.
Add `"strict": true` to your `.pyre_configuration` file, or add `# pyre-strict` to the top of individual Python files.
Use the `pyre-upgrade` command to automatically insert suppression comments for new errors after an upgrade, then address them systematically.
Ensure `pyre-check` is fully updated (`pip install --upgrade pyre-check`), restart any running Pyre daemon (`pyre stop` then `pyre start`), and if issues persist, try reinstalling in a fresh virtual environment.
Install `watchman` using your system's package manager (e.g., `brew install watchman` on macOS, `sudo apt-get install watchman` on Ubuntu/Debian). Ensure `watchman` is in your system's PATH.
Correct the type annotation or the value assignment to ensure type consistency. For instance, if `i: int = 'string'` is the error, change it to `i: int = 123` or `i: str = 'string'`.
Ensure you are using Python 3.8 or newer (`python3 --version`). If your Python version is compatible, try updating `pip` and `setuptools` (`pip install --upgrade pip setuptools`) and clearing pip's cache.