Pyre is Meta's performant type checker for Python (PEP 484 compliant).
It includes Pysa, a security-focused static analysis tool for taint analysis.
The core engine is written in OCaml (source/), with a Python CLI client (client/).
Note: Pyrefly is the next-generation replacement.
Assume the user is a Meta internal user by default. If the facebook/ directory is missing from the root of the project, the user is an open source user. All buck and arc commands are only available to Meta internal users.
If the file source/dune is missing, this must be a fresh repository clone.
In that case, run the following command:
# For Meta internal users (facebook/ directory exists)
./facebook/scripts/setup.sh --local
# For open source users
./scripts/setup.sh --localcd source && makeThe built binary is at source/_build/default/main.exe.
# All OCaml tests
cd source && make test
# Specific OCaml test - e.g. analysis/test/integration/methodTest.ml:
cd source && dune exec analysis/test/integration/methodTest.exe# For Meta internal users
buck test fbcode//tools/pyre/client/...# For Meta internal users
buck build fbcode//tools/pyre/client:pyreIMPORTANT: Always run linting and formatting after editing files.
For Meta internal users:
# Formatting
arc f
# Linting
arc lintSet PYRE_BINARY to your built binary to override the default:
export PYRE_BINARY=/path/to/source/_build/default/main.exe
pyre -n check # Use one-off check mode, not the server, when recompiling frequentlyPyrefly is the default type provider for Pysa tests. The setup script (./facebook/scripts/setup.sh --local) automatically builds the Pyrefly binary and symlinks it to source/pyrefly.exe. After setup, make test uses Pyrefly automatically — no manual steps needed.
To manually rebuild the Pyrefly binary (Meta internal only):
cd source && make pyreflyTo override the Pyrefly binary path (e.g., for a custom build):
cd source && PYREFLY_BINARY=<path-to-binary> make test- Avoid abbreviations
- Prefer
snake_casefor variables/functions,CamelCasefor modules/classes