Pyre is a high-performance Python type checker that provides incremental type checking and includes a security-focused static analysis tool for detecting vulnerabilities.
Performant type-checking for python.
Pyre is used by Python developers to perform fast, incremental type checking compliant with PEP 484, enabling early detection of type errors during development. Security teams and developers can leverage its built-in Pysa tool to perform static security analysis focused on data flow vulnerabilities in Python applications, integrating seamlessly into DevSecOps workflows.
Pyre requires Python 3.8+ and watchman to be installed and configured properly. It runs a daemon process for incremental checking, which improves performance on subsequent runs. Users should be aware of the newer Pyrefly tool as the next-generation Python typechecker from the same team. Pysa extends Pyre for security analysis and can be integrated into CI/CD pipelines via GitHub Actions.
Install Python 3.8 or later
Install watchman (via Homebrew on macOS or brew on Ubuntu/Debian-based systems)
Create a project directory and navigate into it
Create a Python virtual environment: python3 -m venv ~/.venvs/venv
Activate the virtual environment: source ~/.venvs/venv/bin/activate
Install Pyre using pip: pip install pyre-check
pyre init
Initializes Pyre configuration and watchman files in the project directory
pyre
Starts the Pyre daemon and performs incremental type checking on the project
echo "i: int = 'string'" > test.py
Creates a test Python file with a deliberate type error to demonstrate Pyre's checking